前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ZOOKEEPER安装

ZOOKEEPER安装

作者头像
98k
发布2018-04-12 12:11:31
8530
发布2018-04-12 12:11:31
举报
文章被收录于专栏:Django Scrapy

1.将ZOOKEEPER安装包上传到服务器上 /usr/local 2.解压并重命名目录 tar xzvf zookeeper-3.4.8.tar.gz mv zookeeper-3.4.8 zookeeper 3.修改环境变量 vi /etc/profile export ZOOKEEPER_HOME=/usr/local/zookeeper export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$ZOOKEEPER_HOME/bin 修改完环境变量后必须应用 source /etc/profile 查看是否修改成功 echo $ZOOKEEPER_HOME

4.修改zookeeper配置文件 cd /usr/local/zookeeper/conf mv zoo_sample.cfg zoo.cfg mkdir -p /usr/local/zookeeper/data 然后将以下内容或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.

dataDir=/usr/local/zookeeper/data

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

server.1=name1:2888:3888 server.2=name2:2888:3888 server.3=data1:2888:3888 server.4=data2:2888:3888 server.5=data3:2888:3888

以上需要注意的是有几个机器就用几个server. server.n=主机名:端口号1:端口号2 端口号1和端口号2万万不能一样

server.1=xxxx:yyyy:zzzz //此处指的是你有多少台zookeeper 每台安装zookeeper的服务器主机名又叫什么以及相应的端口号。

在/usr/local/zookeeper/data下生成myid文件 生成方法 echo 1 > /usr/local/zookeeper/data/myid myid文件代表的意思是告诉zookeeper我是该集群中的第几号机器 然后在myid文件中从1开始填入对应的数字

5.以上步骤完成后启动zookeeper zkServer.sh start 打开zookeeper zkServer.sh status(看到stantalone说明是单节点,并且启动成功) zkServer.sh stop 关闭zookeeper zkServer.sh restart 重启zookeeper

输入命令:jps

26467 QuorumPeerMain ---->>>这个就代表zookeeper进程已经启动 46773 ResourceManager 46329 NameNode 26523 Jps 46876 NodeManager 46430 DataNode 46623 SecondaryNameNode

jps |grep -v Jps

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017.07.12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 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
  • the directory where the snapshot is stored.
  • do not use /tmp for storage, /tmp here is just
  • example sakes.
  • dataDir=/usr/local/zookeeper/data
  • 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
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档