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系统版 ...
随机推荐
- Date Calendar
1 毫秒值概念 时间和日期的计算,必须依赖毫秒值获取当前日期的毫秒值:System.currentTimeMillis() 返回值long类型参数, 时间原点:公元1970年1月1日,午夜0:00:0 ...
- python终端打印带颜色的print
原理 实现过程: 终端的字符颜色是用转义序列控制的,是文本模式下的系统显示功能,和具体的语言无关. 转义序列是以ESC开头,即用\033来完成(ESC的ASCII码用十进制表示 ...
- python框架之Django(4)-视图&路由
视图 负责接收请求和返回响应 FBV和CBV FBV FBV(function base views) 就是在视图里使用函数处理请求. from django.conf.urls import url ...
- MySql 创建索引原则
https://blog.csdn.net/csdnones/article/details/50412603 为了使索引的使用效率更高,在创建索引时,必须考虑在哪些字段上创建索引和创建什么类型的索引 ...
- 安装和使用ZFS
一.安装和使用ZFS Centos7上安装和使用ZFS:https://blog.csdn.net/linuxnews/article/details/51286358
- web状态管理机制
引入:b/s(浏览器/服务器模式)区别于winform的是winform中只加载一次页面构造函数,而b/s中只要点击按钮或者其他涉及后台的操作都会调用后台代码.一般情况下为了防止服务器过载,b/s不会 ...
- pytorch预训练模型的下载地址以及解决下载速度慢的方法
https://github.com/pytorch/vision/tree/master/torchvision/models 几乎所有的常用预训练模型都在这里面 总结下各种模型的下载地址: 1 R ...
- 富文本之BootStrap-wysiwyg 带图片上传功能
BootStrap-wysiwyg插件具有良好的编辑功能和展示效果. 一.使用方法在网上有很多,在此记录自己使用过程中的一些问题和解决方式. 相关依赖: bootstrap-wysiwyg.js (核 ...
- 使用dbeaver查mysql的表会导致锁表的问题
查询完成之后接着需要使用rollback,不然其它session没法执行语句.
- Nginx 解析PHP的原理 | CGI、FastCGI及php-fpm的关系
Nginx解析PHP的原理,CGI/FastCGI以及PHP-Fpm的关系. 一.PHP+Nginx应运而生的场景.随着互联网的发展,用户对此接受面广,数据流的增大使得Web端的运行承载压力日益增大, ...