您的位置:首页 > 数据库 > Redis

apache+tomcat+Jfinal 2.2+dubbo2.5.4+zookeeper3.3.6 +redis+druid 分布式(集群)部署成功的一点心得(二)

2016-06-12 15:07 555 查看
1.  修改zookeeper配置文件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.

dataDir=D:\\zookeeper-3.3.6\\data

# the port at which the clients will connect

clientPort=2181

server.1=10.58.178.64:2555:3555

server.2=10.58.178.113:2555:3555

2. 修改服务提供者程序配置文件provider.xml,内容如下

把原来的

<!-- 使用zookeeper广播注册中心暴露服务地址 -->

    <dubbo:registry protocol="zookeeper" address="zookeeper://10.58.178.64:2181" />

修改成

    <!-- 使用zookeeper广播注册中心暴露服务地址 (zookeeper集群)  -->

    <dubbo:registry

    protocol="zookeeper"

        address="10.58.178.64:2181,10.58.178.113:2181"/>

3. 修改服务消费者程序配置文件consumer.xml,内容如下

<!-- 使用zookeeper广播注册中心暴露发现服务地址-->

    <dubbo:registry protocol="zookeeper" address="zookeeper://10.58.178.64:2181" />

修改成   

    <!-- 使用zookeeper广播注册中心暴露发现服务地址 (zookeeper集群)  -->

    <dubbo:registry

    protocol="zookeeper"

        address="10.58.178.64:2181,10.58.178.113:2181"/>

4.  10.58.178.64 和 10.58.178.113  都是独立的机器(可以理解独立的服务器,任何一台挂掉,不影响使用)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: