dubbo zk注册中心(二)单节点搭建

机器xxx.xx.xxx.126

1、https://zookeeper.apache.org/releases.html#download、https://archive.apache.org/dist/zookeeper/

  如我下载的3.6.1版本apache-zookeeper-3.6.1-bin.tar.gz

2、创建zookeeper目录

mkdir -p /usr/local/zookeeper

 上传压缩包并解压:

tar -zxvf apache-zookeeper-3.6.1-bin.tar.gz

3、创建数据目录、日志目录。

mkdir -p /usr/local/zookeeper/apache-zookeeper-3.6.1-bin/data
mkdir -p /usr/local/zookeeper/apache-zookeeper-3.6.1-bin/log

这时整个目录结构如下:

4、修改配置文件:

# 进入配置文件目录
cd /usr/local/zookeeper/apache-zookeeper-3.6.1-bin/conf/
# ZooKeeper 启动默认加载名为 zoo.cfg 的配置文件,复制一份命名为 zoo.cfg
cp zoo_sample.cfg zoo.cfg
# 修改配置文件
vi zoo.cfg

主要修改数据目录dataDir、日志目录dataLogDir两处即可,修改结果如下:

# 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/apache-zookeeper-3.6.1-bin/data
dataLogDir=/usr/local/zookeeper/apache-zookeeper-3.6.1-bin/log
# 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

## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

5、启动/关闭:

启动命令:

cd /usr/local/zookeeper/apache-zookeeper-3.6.1-bin/
bin/zkServer.sh start

启动成功: 

关闭命令:

cd /usr/local/zookeeper/apache-zookeeper-3.6.1-bin/
bin/zkServer.sh stop

关闭成功:

均测试成功,单节点安装完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

w_t_y_y

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值