Cassandra集群:一,搭建一个三节点的集群
环境准备
Python2.7* https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
Cassandra 2.1.* http://archive.apache.org/dist/cassandra/2.1.20/apache-cassandra-2.1.20-bin.tar.gz
| Host Name | IP Address | OS | |
| sht-sgmhadoopcm-01 | 172.16.101.54 | CentOS7.1 | |
| sht-sgmhadoopnn-01 | 172.16.101.55 |
CentOS7.1 |
|
| sht-sgmhadoopnn-02 | 172.16.101.56 |
|
1. 各节点做准备工作
安装python和java
[root@sht-sgmhadoopcm- ~]# tar -zxf Python-2.7..tgz
[root@sht-sgmhadoopcm- ~]# cd Python-2.7.
[root@sht-sgmhadoopcm- Python-2.7.]# ./configure --prefix=/usr/local/python-2.7. --enable-optimizations
[root@sht-sgmhadoopcm- Python-2.7.]# make && make install
[root@sht-sgmhadoopcm- ~]# /usr/local/python-2.7./bin/python --version
Python 2.7. [root@sht-sgmhadoopcm- ~]# tar -zxf jdk-8u111-linux-x64.tar.gz -C /usr/java/
[root@sht-sgmhadoopcm- ~]# /usr/java/jdk1..0_111/bin/java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) -Bit Server VM (build 25.111-b14, mixed mode)
配置系统用户
[root@sht-sgmhadoopcm- ~]# groupadd -r -g dba
[root@sht-sgmhadoopcm- ~]# useradd -r -u -d /home/cassandra -g dba -G root cassandra
[root@sht-sgmhadoopcm- ~]# cat /home/cassandra/.bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs export CASSANDRA_HOME=/usr/local/cassandra
export JAVA_HOME=/usr/java/jdk1..0_171
export PYTHON_HOME=/usr/local/python-2.7.
export PATH=$PYTHON_HOME/bin:$JAVA_HOME/bin:$CASSANDRA_HOME/bin:$CASSANDRA_HOME/tools/bin:$PATH:$HOME/bin:/usr/local/bin
安装Cassandra
[root@sht-sgmhadoopcm- ~]# tar -zxf apache-cassandra-2.1.-bin.tar.gz -C /usr/local/
[root@sht-sgmhadoopcm- ~]# ln -s /usr/local/apache-cassandra-2.1. /usr/local/cassandra
[root@sht-sgmhadoopcm- ~]# chown -R cassandra.dba /usr/local/apache-cassandra-2.1./
2. 配置cassandra
cassandra-topology.properties文件各节点一致
[cassandra@sht-sgmhadoopcm-01 conf]$ cat cassandra-topology.properties
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. # Cassandra Node IP=Data Center:Rack
#192.168.1.100=DC1:RAC1
#192.168.2.200=DC2:RAC2 #10.0.0.10=DC1:RAC1
#10.0.0.11=DC1:RAC1
#10.0.0.12=DC1:RAC2 #10.20.114.10=DC2:RAC1
#10.20.114.11=DC2:RAC1 #10.21.119.13=DC3:RAC1
#10.21.119.10=DC3:RAC1 #10.0.0.13=DC1:RAC2
#10.21.119.14=DC3:RAC2
#10.20.114.15=DC2:RAC2
172.16.101.54=EAST:RAC1
172.16.101.55=EAST:RAC1
172.16.101.56=EAST:RAC1 # default for unknown nodes
default=DC1:r1 # Native IPv6 is supported, however you must escape the colon in the IPv6 Address
# Also be sure to comment out JVM_OPTS="$JVM_OPTS -Djava.net.preferIPv4Stack=true"
# in cassandra-env.sh
fe80\:0\:0\:0\:202\:b3ff\:fe1e\:8329=DC1:RAC3
cassandra.yaml
cluster_name: 'NavigationData'
data_file_directories:
- /usr/local/cassandra/data
commitlog_directory: /usr/local/cassandra/commitlog
saved_caches_directory: /usr/local/cassandra/saved_caches
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: "172.16.101.54,172.16.101.55"
listen_address: 172.16.101.54 #修改为各节点的IP地址
rpc_address: 172.16.101.54 #修改为各节点的IP地址
endpoint_snitch: PropertyFileSnitch
cassandra-env.sh注释如下
#if [ "x$LOCAL_JMX" = "x" ]; then
# LOCAL_JMX=yes
#fi
3.启动并查看cassandra
[cassandra@sht-sgmhadoopcm- ~]$ /usr/local/cassandra/bin/cassandra &
[cassandra@sht-sgmhadoopnn- ~]$ /usr/local/cassandra/bin/cassandra &
[cassandra@sht-sgmhadoopnn- ~]$ /usr/local/cassandra/bin/cassandra & [cassandra@sht-sgmhadoopcm- ~]$ nodetool status
Datacenter: EAST
================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 172.16.101.54 51.75 KB 64.5% 0ec471a6--4c53-9b70-78b03b40d13b RAC1
UN 172.16.101.55 118.25 KB 69.2% d4c873d0-e3b8-4e73-a9eb-1e238a399183 RAC1
UN 172.16.101.56 162.38 KB 66.4% 6f7b0f6e-f4bc--b431-dddbeb16dcc1 RAC1
Cassandra集群:一,搭建一个三节点的集群的更多相关文章
- 项目进阶 之 集群环境搭建(三)多管理节点MySQL集群
上次的博文项目进阶 之 集群环境搭建(二)MySQL集群中,我们搭建了一个基础的MySQL集群,这篇博客咱们继续讲解MySQL集群的相关内容,同时针对上一篇遗留的问题提出一个解决方案. 1.单管理节点 ...
- 理解 OpenStack Swift (1):OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置
本系列文章着重学习和研究OpenStack Swift,包括环境搭建.原理.架构.监控和性能等. (1)OpenStack + 三节点Swift 集群+ HAProxy + UCARP 安装和配置 ( ...
- 11. 搭建一个完整的K8S集群
11. 搭建一个完整的Kubernetes集群 1. kubectl的命令遵循分类的原则(重点) 语法1: kubectl 动作 类 具体的对象 例如: """ kube ...
- rancher三节点k8s集群部署例子
rancher三节点k8s集群部署例子 待办 https://rorschachchan.github.io/2019/07/25/使用Rancher2-1部署k8s/
- Kubernetes — 从0到1:搭建一个完整的Kubernetes集群
准备工作 首先,准备机器.最直接的办法,自然是到公有云上申请几个虚拟机.当然,如果条件允许的话,拿几台本地的物理服务器来组集群是最好不过了.这些机器只要满足如下几个条件即可: 满足安装 Docker ...
- etcd三节点安全集群搭建-pki安全认证
etcd安全集群搭建就是 pki安装认证 1.环境: 三台centos7. 主机 192.168.0.91 192.168.0.92 192.168.0.93 都关闭防火墙 都关闭selinux 配置 ...
- 部署elasticsearch(三节点)集群+filebeat+kibana
用途 ▷ 通过各个beat实时收集日志.传输至elasticsearch集群 ▷ 通过kibana展示日志 实验架构 名称:IP地址:CPU:内存 kibana&cerebro:192.168 ...
- 仅需60秒,使用k3s创建一个多节点K8S集群!
作者: Dawid Ziolkowski丨Container Solution云原生工程师 最近,我一直在Kubernetes上进行各种测试和部署.因此,我不得不一次又一次创建和销毁Kubernete ...
- 搭建一个完整的K8S集群-------基于CentOS 8系统
创建三个centos节点: 192.168.5.141 k8s-master 192.168.5.142 k8s-nnode1 192.168.5.143 k8s-nnode2 查看centos系统版 ...
随机推荐
- LwIP协议栈规范翻译——摘要目录
摘要 LwIP是一种TCP/IP协议栈的实现.LwIP协议栈专注于减少内存的使用和代码的大小,使LwIP适用于嵌入式系统中在有限的资源下能够使用小型的客户机.为了减少处理和内存的需求,LwIP使用裁剪 ...
- js/jquery 元素是否存在
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>spli ...
- Socket,ServerSocket,WebSocket
一 区别 首先来说下区别吧, Socket和ServerSocket 指传输层网络接口协议,是基于套接字的服务端和客户端实现. 而WebScoket是应用层协议,是客户端-服务器的异步通信方法,用于双 ...
- vue 自适应 Responsive 设计
使用阿里的 lib-flexible 及 vue-meta 库: https://github.com/amfe/lib-flexible/ https://github.com/nuxt/vue-m ...
- SparkML之推荐引擎(二)---推荐模型评估
本文内容和代码是接着上篇文章来写的,推荐先看一下哈~ 我们上一篇文章是写了电影推荐的实现,但是推荐内容是否合理呢,这就需要我们对模型进行评估 针对推荐模型,这里根据 均方差 和 K值平均准确率 来对模 ...
- cocos creator 背景音乐音量和音效音量百分比设置
把音效的音量大小百分比保存在本地,播放音效的时候,带上音量大小,就像这样 你播放背景音乐时候,保存背景音乐的id,通过改变音量大小来调节背景音乐,就像这样 cc.audioEngine.setVolu ...
- js中变量名加“-” new Vue()不执行
如var app-1 = new Vue(): 不执行的 var app1 = new Vue(): 才能执行
- 基于Jenkins实现持续集成【持续更新中】
持续集成 1.什么是持续集成:Continuous integration (CI)持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员每天至少集成一次,也就意味着每天可能会发生 ...
- xshell 利用密钥登录
第一步:新建用户密钥 第二步:选择加密方式,密钥长度越长越安全 第三步:设置密钥名称和密码(密码可为0,这里是密钥的密码非服务器密码) 第四步:保存公钥到本地 第五步:导出私钥到本地 第六步:将公钥和 ...
- 记账本微信小程序开发七
完成所有后续代码 主页代码 教程做的感觉很好,但是自己做出来感觉就low了很多,还是有很多需要改进的地方,这也是我下一步的改进点.