dubbo系列--zookeeper搭建

前面已经把工程搭好了,下面是zookeeper的安装及搭建,(Windows版本)

下载zookeeper-3.4.5包,再把conf下面的文件改成:

再按照网上所说的在环境变量里配置好,注意一定要配置准确,不然会很坑的,

zoo.cfg文件内容,这里是我自己配的,

# The number of milliseconds of each tick
tickTime=40000
# 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=E:\\DUBBO\\zk\\zookeeper
# the port at which the clients will connect
clientPort=2181
#
# 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.0=10.10.202.252:2181:7770

作为制作demo,其中clientPort=2181,server.0=10.10.202.252:2181:7770很重要,其他的暂时不说

这个zookeeper启动后再启动工程,windows环境中启动是双击在bin下面的zkServer.cmd,再用cmd命令中jps,为什么采取jps命令查看,是因为zookeeper是java开发

这样代表启动成功


猜你喜欢

转载自blog.51cto.com/10983206/2564256