yywx001 发表于 2015-11-21 13:54:21

dubbo+zookeeper+spring的demo

  前面已经把工程搭好了,下面是zookeeper的安装及搭建,
  下载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,

  这样代表启动成功,但是查看是否启动成功还有其他办法的,
  


页: [1]
查看完整版本: dubbo+zookeeper+spring的demo