CentOS中配置CDH版本的ZooKeeper
三台CentOS:Host0,Host1,Host2
在三台中分别安装zookeeper-server
yum install zookeeper-server -y
修改zookeeper的配置文件(/etc/zookeeper/conf/zoo.cfg)
因为zookeeper集群共有3个节点,所以在配置文件中添加server.0,server.1,server.2
# 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. maxClientCnxns=
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=
# the directory where the transaction logs are stored.
dataLogDir=/var/lib/zookeeper
#server
server. = Host0::
server. = Host1::
server. = Host2::
2888:3888是Zookeeper多节点之间的通信端口
2888接收端端口,3888发送端端口
在各个Host中添加myid文件,并修改文件所属用户。
echo "" > /var/lib/zookeeper/myid
chown zookeeper:zookeeper /var/lib/zookeeper/myid
注意,三个主机的/var/lib/zookeeper/myid文件内容不能相同,且与之间的server.0,server.1,server.2的0,1,2相对应。
初始化zookeeper,并启动zookeeper
service zookeeper-server init
service zookeeper-server start
查看zookeeper节点状态
[root@Host0 ~]# zookeeper-server status
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Mode: follower [root@Host1 ~]# zookeeper-server status
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Mode: leader [root@Host2 ~]# zookeeper-server status
JMX enabled by default
Using config: /etc/zookeeper/conf/zoo.cfg
Mode: follower
可得Host1是leader,Host0和Host2是follower
CentOS中配置CDH版本的ZooKeeper的更多相关文章
- CentOS中配置Kafka集群
环境:三台虚拟机Host0,Host1,Host2 Host0:192.168.10.2 Host1: 192.168.10.3 Host2: 192.168.10.4 在三台虚拟机上配置zook ...
- VS Code中配置python版本以及Python多版本
VS Code中配置python版本VS Code十分方便配置python的版本:可以选在在本地setting.json或者全局setting.json文件中配置:python.pythonPath在 ...
- 【Hadoop离线基础总结】CDH版本的zookeeper环境搭建
CDH版本的zookeeper环境搭建 下载 下载地址 http://archive.cloudera.com/cdh5/cdh/5/ 修改配置文件 创建ZooKeeper数据存放目录 mkdir - ...
- CentOS中配置LNMP环境打开提示File not found
在centos系统中配置好php环境了,但是发现能运行html页面并不能运行php文件了,这样我就在gg的帮助下一步不解决了,下面来看问题的具体解决过程. 安装之后测试发现,怎么Html能运行 ...
- maven中配置jdk版本
1 maven 中配置 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins< ...
- cdh版本的zookeeper安装以及配置(伪分布式模式)
需要的软件包:zookeeper-3.4.5-cdh5.3.6.tar.gz 1.将软件包上传到Linux系统指定目录下: /opt/softwares/cdh 2.解压到指定的目录:/opt/mo ...
- 2017-03-05 CentOS中配置守护服务(Supervisor)监听dotnet core web程序的运行
我们继续解决上篇博客的问题,我这个人有个毛病,不喜欢遗留什么问题,也不喜欢问题说不明白,具体要怎么解决一定要详尽,因为经常自己遇到问题的时候,去翻别人的博客,就会遇到这样的问题,很苦恼,又说废话了. ...
- CentOS中配置NFS
https://www.cnblogs.com/yeungchie/ NFS是Network File System的缩写,即网络文件系统. 它的主要功能是通过网络(一般是局域网)让不同的主机系统之间 ...
- CentOS中配置xrdp,通过微软远程桌面访问CentOS桌面
环境:CentOS 6.4 1.安装相关软件 yum groupinstall "Desktop" (已安装桌面的就可以缺略这条命令) yum install xrdp yum i ...
随机推荐
- onlyoffice文档协作的权限开发,利用casbin和golang语言
登录用户,对于已经进行了权限设置的文档,将根据权限数据库,比对用户名,当与用户有关时,就显示相对应的权限,当都与登录用户无关时,则显示拒绝访问: 对于未登录用户,已经设置了权限的文档,都将显示拒绝访问 ...
- JNI使用方法
JNI可以让我们在java代码中调用本地库的功能. 下面记录一下JNI简单的使用方法 创建java端接口 public class JNIIterface { // 导入最终生成的dll文件 stat ...
- Mac配置SDK+JDK环境
1.打开默认终端设备,编辑.bash_profile文件,命令:vi .bash_profile 2.执行,打开文件,编辑,配置环境命令如下: ①JDK环境:export JAVA_HOME=/lib ...
- Java为什么不支持多继承
类定义属性和方法 描述某一类事物的抽象 而接口定义的是行为 并不限于任何具体意向 按照逻辑上来说 单继承更明确 一个子类就应该是其父类代表的事物中的某个更具体的类别 不应该即是这种东西又是那种东西 而 ...
- Linux 同步时间 设置时区
简化版 同步时间 #直接用域名同步中国上海时间 ntpdate -u ntp.api.bz # hwclock --hctosys 或者 # clock --hctosys hc代表硬件时间,sys代 ...
- mysql的又一个让人捉摸不透的bug?
这次就不说很多没有写博客了,因为前几天已经写过了.\^o^/ 昨天我们刚讨论了关于自动化运维工作的实现方式,如果批量执行,中间出错怎么办?突然有人提出mysql支持--force,可以跳过出错继续执行 ...
- 在 Azure Resource Manager 中为虚拟机设置密钥保管库
Note Azure 具有两种不同的部署模型,用于创建和处理资源:Resource Manager 模型和经典模型.本文介绍使用 Resource Manager 部署模型.Azure 建议对大多数新 ...
- S5700的Eth-Trunk端口汇聚(trunk实验)
S5700的Eth-Trunk端口汇聚 链路汇聚和端口汇聚,就是端口聚合,交换机的堆叠是堆叠和端口聚合无关. 端口聚合概念:(包括二层端口聚合和三层端口聚合) 1.端口聚合IEEE标准是将最多16条链 ...
- SQL 性能不佳的几个原因
•不准确的统计数据•差劲的索引•差劲的查询设计 •差劲的执行计划,通常是由不正确的参数引起的•过度阻塞和死锁 •非基于集合的操作•不良数据库设计 •过度碎片 •不能重复使用执行计划 •查询频繁重编译 ...
- beta冲刺————第二天(2/5)
完善具体内容: 前端: (1)添加了更多设置 (2)点击后出现底栏,分别可以进行字体背景设置.收藏.分享等操作,同时可以看出对文章的排版进行了完善 后端: 对阿里云服务器中的环境进行配置,同时熟悉阿里 ...