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系统版 ...
随机推荐
- React-Router4.x中文文档
以下为翻译的中文API(水平有限,凑合看,欢迎纠正补充~) <BrowserRouter> 使用HTML5历史记录API(pushState,replaceState和popstate事件 ...
- javaweb(4)之Listener&Filter
监听器 (Listener) 介绍 监听器用于监听 web 应用中某些对象.信息的创建.销毁.增加,修改,删除等动作的发生,然后作出相应的响应处理.当范围对象的状态发生变化的时候,服务器自动调用监听器 ...
- vue -about
j基于webpack4 搭建vue 环境:https://juejin.im/post/5bc30d5fe51d450ea1328877
- AppUtil
import java.io.File;import java.util.ArrayList;import java.util.LinkedHashMap;import java.util.List; ...
- cocos2dx 实现文字的一键复制功能(IOS、Android)
1.IOS篇(用OC和C++混编) 头文件声明: public static void copy(std::string str); 实现如下: void copy(std::string str) ...
- 0007-20180403-python-自动化基础学习000--while-if 循环实操
python-自动化基础学习000 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64 ...
- 记录Js 文本框验证 与 IE兼容性
最近的日常就是将测试小姐姐提交的bug进行修改,想来这种事情还是比较好开展的,毕竟此项目已上线一年多,现在只是一些前端的问题需要改正.实际上手的时候并不是这样,原项目是在谷歌上运行,后来由于要新增一个 ...
- python hello 的三种方法
1)直接 print("hello") 2)使用main函数: def main(): print("Helloa你好") if __name__ == &qu ...
- ztree模糊搜索
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta http-equiv="X ...
- openGL学习----光照
0.光照处理时候,向量点乘一定要是标准化后的单位向量!!! 1.冯氏光照模型:光照=环境光+漫反射+镜面反射 vec3 result = ambient + diffuse + specular; 一 ...