天天看点

openfire集群

环境

192.168.253.150 openfire150

192.168.253.151 openfire151  nginx负载均衡

在150上安装配置openfire-4.0.3

tar -xzvf openfire-4.0.3.tar.gz

mv openfire /usr/local/

cd /usr/local/openfire

bin/openfire start

浏览器打开192.168.253.150:9090 

<a href="http://s1.51cto.com/wyfs02/M00/86/A8/wKioL1fGm9iS0q5MAACiActeZ88954.png-wh_500x0-wm_3-wmp_4-s_4061364338.png" target="_blank"></a>

域这里集群成员机器必须一致!

<a href="http://s1.51cto.com/wyfs02/M01/86/A8/wKiom1fGm9iQjBP-AAAVTsZ-nto827.png-wh_500x0-wm_3-wmp_4-s_4145936664.png" target="_blank"></a>

两台openfire连接同一台数据库。

<a href="http://s2.51cto.com/wyfs02/M02/86/A8/wKiom1fGm9mjJ_GmAAC4uBerR4Y024.png-wh_500x0-wm_3-wmp_4-s_2337036141.png" target="_blank"></a>

<a href="http://s1.51cto.com/wyfs02/M01/86/A8/wKioL1fGm9nBrPdZAACT1fZXcu0695.png-wh_500x0-wm_3-wmp_4-s_834129395.png" target="_blank"></a>

<a href="http://s1.51cto.com/wyfs02/M00/86/A8/wKiom1fGm9ngZgESAAA-IFZL0z0966.png-wh_500x0-wm_3-wmp_4-s_1770965447.png" target="_blank"></a>

添加集群插件Hazelcast clusting plugin 和Broadcast.

<a href="http://s2.51cto.com/wyfs02/M02/86/A8/wKiom1fGm9qB1WasAABddb9ib5c997.png-wh_500x0-wm_3-wmp_4-s_1017066435.png" target="_blank"></a>

<a href="http://s2.51cto.com/wyfs02/M02/86/A8/wKioL1fGm9qRLalkAAE-tKEgwfQ294.png-wh_500x0-wm_3-wmp_4-s_3196462517.png" target="_blank"></a>

进入服务器配置添加的集群插件Hazelcast clusting plugin

vi /usr/local/openfire/plugins/hazelcast/classes/hazelcast-cache-config.xml

&lt;join&gt;

            &lt;multicast enabled="false"/&gt;

            &lt;tcp-ip enabled="true"&gt;

                &lt;member&gt;192.168.253.150:5701&lt;/member&gt;

                &lt;member&gt;192.168.253.151:5701&lt;/member&gt;

            &lt;/tcp-ip&gt;

            &lt;aws enabled="false"/&gt;

        &lt;/join&gt;

        &lt;interfaces enabled="true"/&gt;

            &lt;interface&gt;192.168.253.150&lt;/interface&gt;

        &lt;/interfaces&gt;

192.168.253.151配置同上。

配置完成,重启openfire,

进入openfire控制台开启集群服务。完成!

下一章配置openfire集群+nginx负载均衡代理。

OPENFIRE_OPTS="-Xmx4G -Xms4G -XX:NewRatio=1 -XX:SurvivorRatio=4 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC

-XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=1 

 -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly  -XX:+PrintGCDetails -XX:+PrintPromotionFailure"

     本文转自yzy121403725 51CTO博客,原文链接:http://blog.51cto.com/lookingdream/1844841,如需转载请自行联系原作者

继续阅读