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 都是独立的机器(可以理解独立的服务器,任何一台挂掉,不影响使用)
# 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 都是独立的机器(可以理解独立的服务器,任何一台挂掉,不影响使用)
相关文章推荐
- Laravel 5的redis哨兵(sentinel)支持
- springmvc整合redis的小案例
- Redis3.2+Tomcat实现集群的Session管理 -- tomcat-redis-session-manager的编译和开发部署环境搭建
- PHP中应用Redis
- Redis主从配置
- Redis配置
- Redis数据类型
- Redis安装
- redis 配置 linux
- Ubuntu 14 环境下编译安装 Redis 并将其注册为系统服务
- Ubuntu 14 环境下编译安装 Redis 并将其注册为系统服务
- redis使用场景
- win10 下php安装redis扩展
- redis项目问题
- [PHP][REDIS]phpredis 'RedisException' with message 'read error on connection'
- 开源项目Redis学习方法
- redis内存数据库
- redis的hGetAll函数的性能问题
- Redis学习笔记一
- Redis作者谈Redis比较适合的应用场景