原文及更多文章请见个人博客:http://heartlifes.com
vert.x支持集群化部署,默认封装使用的是一个叫Hazelcast的框架,从官方github上看到的开发进度表示,3.1可能会引入比较大众点的zookeeper作为集群的协作框架。
demo工程还是使用第5章中的dubbo服务demo代码
启动多个主程序,会发现后台输出类似如下的日志信息
八月 04, 2015 2:05:09 下午 com.hazelcast.instance.DefaultAddressPicker 信息: [LOCAL] [p-dev] [3.5] Prefer IPv4 stack is true. 八月 04, 2015 2:05:09 下午 com.hazelcast.instance.DefaultAddressPicker 信息: [LOCAL] [p-dev] [3.5] Picked Address[192.168.1.119]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true 八月 04, 2015 2:05:09 下午 com.hazelcast.spi.OperationService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Backpressure is disabled 八月 04, 2015 2:05:09 下午 com.hazelcast.spi.impl.operationexecutor.classic.ClassicOperationExecutor 信息: [192.168.1.119]:5701 [p-dev] [3.5] Starting with 2 generic operation threads and 4 partition operation threads. 八月 04, 2015 2:05:10 下午 com.hazelcast.system 信息: [192.168.1.119]:5701 [p-dev] [3.5] Hazelcast 3.5 (20150617 - 4270dc6) starting at Address[192.168.1.119]:5701 八月 04, 2015 2:05:10 下午 com.hazelcast.system 信息: [192.168.1.119]:5701 [p-dev] [3.5] Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. 八月 04, 2015 2:05:10 下午 com.hazelcast.instance.Node 信息: [192.168.1.119]:5701 [p-dev] [3.5] Creating MulticastJoiner 八月 04, 2015 2:05:10 下午 com.hazelcast.core.LifecycleService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Address[192.168.1.119]:5701 is STARTING 八月 04, 2015 2:05:14 下午 com.hazelcast.cluster.impl.MulticastJoiner 信息: [192.168.1.119]:5701 [p-dev] [3.5] Members [1] { Member [192.168.1.119]:5701 this } 八月 04, 2015 2:05:14 下午 com.hazelcast.core.LifecycleService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Address[192.168.1.119]:5701 is STARTED 八月 04, 2015 2:05:15 下午 com.hazelcast.partition.InternalPartitionService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Initializing cluster partition table first arrangement... 八月 04, 2015 2:05:22 下午 com.hazelcast.nio.tcp.SocketAcceptor 信息: [192.168.1.119]:5701 [p-dev] [3.5] Accepting socket connection from /192.168.1.119:59906 八月 04, 2015 2:05:22 下午 com.hazelcast.nio.tcp.TcpIpConnectionManager 信息: [192.168.1.119]:5701 [p-dev] [3.5] Established socket connection between /192.168.1.119:5701 八月 04, 2015 2:05:28 下午 com.hazelcast.cluster.ClusterService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Members [2] { Member [192.168.1.119]:5701 this Member [192.168.1.119]:5702 } 八月 04, 2015 2:05:29 下午 com.hazelcast.partition.InternalPartitionService 信息: [192.168.1.119]:5701 [p-dev] [3.5] Re-partitioning cluster data... Migration queue size: 135 八月 04, 2015 2:05:30 下午 com.hazelcast.partition.InternalPartitionService 信息: [192.168.1.119]:5701 [p-dev] [3.5] All migration tasks have been completed, queues are empty.转载于:https://www.cnblogs.com/heartlifes/p/6971037.html
相关资源:vertx应用开发实例教程-完整版