设为首页 收藏本站
查看: 3597|回复: 0

[经验分享] Tigase服务器安装以及集群

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-4-11 22:47:49 | 显示全部楼层 |阅读模式
安装第一台tigase服务器
安装tigase服务器所需环境。
[iyunv@tigase3~]# yum install java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64
下载tigase服务器软件包。
[iyunv@tigase3tmp]#wget https://projects.tigase.org/atta ... ver-5.2.0-b3447.jar
建立一个服务器安装路径。
root@tigase3tmp]# mkdir /opt/tigase-server
开始安装软件。
[iyunv@tigase3tmp]# java -jar tigase-server-5.2.0-b3447.jar –console
press1 to continue, 2 to quit, 3 to redisplay
按1继续
Theinstalled application needs a JDK. A java runtime environment (JRE)will be not sufficient.
Enterpath: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
输入JDK的路径再按回车键
Thewizards you want to execute
Installationof the Tigase Server
[on,off]
选择:on
Configurationof the Tigase Server
[on,off]
选择:on
press1 to continue, 2 to quit, 3 to redisplay
按1继续
1. I accept the terms of this license agreement.
2. I do not accept the terms of this license agreement.
Choosenumber (1-2):输入1
press1 to continue, 2 to quit, 3 to redisplay
按1继续
Selecttarget path [/tmp]
/opt/tigase-server
设置tigase服务器的安装路径。
r => Redisplay menu
d => Done

Chooseaction:选d
0  [x] Defaultinstallation
1  [ ] Default plusextra components
2  [ ] Session Manageronly
3  [ ] Networkconnectivity only
inputselection:选1
YourXMPP (Jabber) domains [tigase3.test.com]
test.com            #设置XMPP域为test.com
YourXMPP (Jabber) domains [tigase3.test.com]
admin@test.com
Adminpassword [tigase]

0  [x] Derby (built-indatabase)
1  [ ] MySQL
2  [ ] PostgreSQL
3  [ ] SQLServer
4  [ ] Other...
inputselection:选2         
Advanced configurationoptions
[on, off]
Off
PostgreSQLsuper user account will be used only to create and configure databasefor the Tigase server. It will not be used by the Tigase server lateron.

Super user accountname: [root]
postgres                               #输入postgres数据库超级用户和密码.
WARNING:password will be visible while entering
Superuser password: postgres
WARNING:password will be visible while entering
Retypepassword: postgres

PostgreSQLdatabase details. It will be created automatically if it does notexist.
Databaseaccount: [tigase]                 #输入存放tigase数据的数据库用户名和密码
tigase
Accountpassword: [tigase12]
tigase
Databasename: [tigasedb]
tigasedb
Databasehost or IP: [localhost]
127.0.0.1
Additionaldatabase parameters: []

press1 to continue, 2 to quit, 3 to redisplay
1
PerformingDB tasks

Checkingconnection to the database  
ConnectionOK
Checkingif the database exists  
ExistsOK
Checkingthe database schema  
Newschema loaded OK
Checkingwhether the database needs conversion  
Conversionnot needed
Apr05, 2014 3:55:48 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Table schema found: public, database type: postgresql, databasedriver: org.postgresql.Driver
Apr05, 2014 3:55:48 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Initialized database connection:jdbc:postgresql://127.0.0.1/tigasedb?user=postgres&password=postgres
Apr05, 2014 3:55:48 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Table schema found: public, database type: postgresql, databasedriver: org.postgresql.Driver
Apr05, 2014 3:55:48 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Initialized database connection:jdbc:postgresql://127.0.0.1/tigasedb?user=postgres&password=postgres

Allusers added
Postinstallation actions  
Finalizing...completed OK
Loadingsocks5 component schema  
Loadingsocks5 schema... completed OK
LoadingPubSub component schema  
LoadingPubSub schema... completed OK


Installwas successeful
applicationinstalled on /opt/tigase-server
[Console installation done ]
启动tigase服务并添加到系统启动服务.
[iyunv@tigase3tmp]# cd /opt/tigase-server/
[iyunv@tigase3tigase-server]# ./scripts/tigase.sh start etc/tigase.conf
StartingTigase:
Tigaserunning pid=1217
nohup:redirecting stderr to stdout
[iyunv@tigase3tigase-server]# cd /opt/tigase-server/scripts/redhat/init.d
[root@tigase3init.d]# cp tigase /etc/init.d/
[root@tigase3init.d]# cd /etc/init.d/
[root@tigase3init.d]# chmod a+x tigase
[root@tigase3init.d]# useradd tigase
[root@tigase3init.d]# chown -R tigase:tigase /opt/tigase-server/logs
[root@tigase3init.d]# vi tigase
TIGASE_HOME=/opt/tigase-server     安装目录改为:/opt/tigase-server
[root@tigase3init.d]# chkconfig --add /etc/init.d/tigase
[root@tigase3init.d]# chkconfig tigase on
[root@tigase3init.d]# service tigase start
StartingTigase XMPP server
Tigasestarted[  OK  ]


安装第二台tigase服务器实现集群
安装部署与第一台tigase服务器一样,只是选择数据库时不是选择本地,而是选择安装在第一台tigase服务器上的数据库,实现一台数据库做了后端集群,也是目前最简单最实用的方法。
安装时不同之处如下:
PostgreSQLdatabase details. It will be created automatically if it does notexist.

Databaseaccount: [tigase]
Tigase                         #存放tigase数据的用户、密码以及数据库相同
Accountpassword: [tigase12]
tigase
Databasename: [tigasedb]
tigasedb
Databasehost or IP: [localhost]
192.168.3.180                   #设置数据库连接安装在第一台tigase服务器的数据库.

最后输出时显示信息有一点不一样。
PerformingDB tasks

Checkingconnection to the database  
ConnectionOK
Checkingif the database exists  
ExistsOK
Checkingthe database schema  
SchemaOK, accounts number: 7
Checkingwhether the database needs conversion  
Conversionnot needed
AddingXMPP admin accounts  Apr 05, 2014 1:41:17 PMtigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Table schema found: public, database type: postgresql, databasedriver: org.postgresql.Driver
Apr05, 2014 1:41:17 PM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO:Initialized database connection:jdbc:postgresql://192.168.3.180/tigasedb?user=postgres&password=postgres
Allusers added
Postinstallation actions  
Finalizing...completed OK
Loadingsocks5 component schema  
Loadingsocks5 schema...
Socks5schema exists, skipping schema load
LoadingPubSub component schema  
LoadingPubSub schema...
PubSubschema exists, skipping schema load

重启两台服务器查看日志
tigase-console.log tigase.log.0
出现以下日志表示集群成功.
2014-04-0513:51:56.486 [ConnectionOpenThread] ClusterConnectionManager.serviceStarted()  INFO: cluster connectionopened: 192.168.3.181, type: connect,id=192.168.3.180_54221_192.168.3.181_5277

如不从启服务有可能出现以下日志
2014-04-0513:51:41.400 [pool-16-thread-5] ClusterConnectionManager.processHandshake()  WARNING: Handshakingpassword doesn't match, disconnecting: null, type: accept, Socket:nullSocket[addr=/192.168.3.180,port=54219,localport=5277], jid: null

重启服务都不行,就有可能是域名解析的原因.可用hostname–f查看你计算机的FQDN,tigase5.2后安装就实现自动集群,但对计算机的FQDN比较严格.
如:
[iyunv@tigase3logs]# hostname -f
tigase3.test.com
[iyunv@tigase4logs]# hostname -f
tigase4.test.com
如hostname–f出来是未知主机,那集群将无法实现.改正以下两个地方
/etc/hosts
/etc/sysconfig/network

安装后系统集群成功后默认可以在不同服务器上登录以及添加联系人,但建立room后不能实现不同服务器之前通信.
实现方法如下:
1检查/opt/tigase-server/jars下是否有tigase-acs.jar包,如果没有可到官网下载max包,解压后再复制进去,MAX包是最完整的,一般推荐下这个,然后按需所取即可!
2.修改两台集群服务器的/opt/tigase-server/etc/init.properties文件.
将--comp-class-1= tigase.muc.MUCComponent改为
--comp-class-1= tigase.muc.cluster.MUCComponentClustered
两台集群服务器配置都改成一样.
重新启动tigase服务,测试成功.



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-17173-1-1.html 上篇帖子: centos6.4下DNS+squid+nginx+mysql搭建高可用web服务器 下篇帖子: arp_ignore和arp_announce内核参数 服务器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表