zookeeper详细的安装流程

安装:
版本:
3.4.10
安装节点:
奇数台节点
1台 数据安全性不高 不建议
至少3台
安装准备:
底层 java
依赖 jdk
节点id 分配:
hdp01 – 1
hdp02 2
hdp03 3
安装步骤:
1)上传
2)解压
tar -xvzf zookeeper-3.4.10.tar.gz
3)配置环境变量
export ZK_HOME=/home/hadoop/apps/zookeeper-3.4.10
export PATH= P A T H : PATH: PATH:ZK_HOME/bin

	source /etc/profile
	4)修改zk的配置文件
	$ZK_HOME/conf
	mv zoo_sample.cfg zoo.cfg
	vi zoo.cfg
	
	# The number of milliseconds of each tick 心跳时间间隔
	tickTime=2000
	# The number of ticks that the initial 
	# synchronization phase can take  初始化心跳次数
	initLimit=10
	# The number of ticks that can pass between 
	# sending a request and getting an acknowledgement  发送请求 请求响应的心跳次数
	syncLimit=5
	# the directory where the snapshot is stored.
	# do not use /tmp for storage, /tmp here is just 
	# example sakes.  快照存储位置 id文件 0-255 
	每一个节点 唯一id   我们手动指定的  一个集群中的id 不可重复的  投票使用的  这个id 必须写在一个文件中 文件名必须myid   快照位置-- myid文件的位置
	dataDir=/home/hadoop/data/zookeeperdata
	# the port at which the clients will connect 客户端连接端口
	clientPort=2181
	# the maximum number of client connections.
	# increase this if you need to handle more clients
	#maxClientCnxns=60
	#
	# Be sure to read the maintenance section of the 
	# administrator guide before turning on autopurge.
	#
	# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
	#
	# The number of snapshots to retain in dataDir
	#autopurge.snapRetainCount=3
	# Purge task interval in hours
	# Set to "0" to disable auto purge feature
	#autopurge.purgeInterval=1
	
	指定zk集群的节点信息  将节点 id绑定
	server.id=主机:2888:3888  一个配置  代表一个节点  一行
	server.1=hdp01:2888:3888
	server.2=hdp02:2888:3888
	server.3=hdp03:2888:3888
	
	
	
	1.id   每一个节点 分配的唯一id  0-255 
	2.2888 选举   3888 心跳
	
	5)创建每一个节点的myid文件   将每一个节点的id写入
	dataDir=/home/hadoop/data/zookeeperdata  这个目录下
	创建  myid的文件
	
	文件内容  只能有id   不能有多余的空格或换行
	
	id 和 zoo.cfg中的配置文件中保持一致
	
	6)远程发送zookeeper安装包
	scp -r zookeeper-3.4.10 hdp02:/home/hadoop/apps/
	scp -r zookeeper-3.4.10 hdp03:/home/hadoop/apps/
	
	发送/etc/profile 
	sudo scp /etc/profile hdp02:/etc/
	sudo scp /etc/profile hdp03:/etc/
	
	source /etc/profile
	
	7)启动
	保证  时间同步 
	保证 防火墙关闭 
	zkServer.sh start   每个节点都要执行
	
	启动完成:
	验证:
	1.jps
	4789 QuorumPeerMain
	2.zkServer.sh status
	follower   leader 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值