Linux下搭建即时通讯聊天服务Tigase 实战详解
闲话不说,先总结下我在部署的过程中遇到的问题以及官方打包的程序中存在的问题:
官方文档存在的问题:
1、官方安装文档没有说明要在部署的服务器上安装mysql或者其他你要使用的数据库的环境,而是简单的说要安装相应的驱动
2、官方文档中提供的版本(tigase-server-7.0.1)中其mysql驱动jar包有不兼容的问题,进而导致tigase服务器安装不成功。
我在安装过程中遇到的问题:
一、准备
linux版本
<pre name="code" class="csharp">[root@iZ235okehetZ tigase]# uname -a Linux iZ235okehetZ 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
内核
<pre name="code" class="csharp">[root@iZ235okehetZ tigase]# cat /proc/version Linux version 2.6.32-431.23.3.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Thu Jul 31 17:20:51 UTC 2014
java jdk
[root@iZ235okehetZ tigase]# java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
tigase server 版本
tigase-server-7.0.1
mysql数据库
二、Tigase Server 安装
1、run the jar file
[root@iZ235okehetZ tigase]# ll total 60776 -rwxrwxrwx 1 root root 62168336 Mar 24 17:11 tigase-server-7.0.1-b3809.jar [root@iZ235okehetZ tigase]# <strong><span style="color:#ff0000;">java -jar tigase-server-7.0.1-b3809.jar -console
2、Initial Screen
On this screen you will find server version info which will be useful if you would to suggest something to Tigase developers.Welcome to the installation of Tigase XMPP (Jabber) Server 7.0.1-b3809! - Artur Hefczyc <[email protected]> - Bartosz Ma?kowski <[email protected]> - Wojciech Kapcia <[email protected]> - Andrzej W贸jcik <[email protected]> - Wojciech Czubaszek <[email protected]> - Eric Dziewa <[email protected]> - Jacek Predki <[email protected]> - Piotr Kontek - Alexander Gnauck - Tomasz Sterna - Mateusz Fio?ka - David Pache - Peter Sandstr枚m - Yonas Yanfa The homepage is at: http://www.tigase.org/ press 1 to continue, 2 to quit, 3 to redisplay
3、JDK Selection
输入你安装jdk的目录The installed application needs a JDK. A java runtime environment (JRE) will be not sufficient. Enter path: /usr/java/jdk1.7.0_71
4、Actions Selection
*** Select what you want to do next: On this panel you can specify whether you want to install only or configure already installed server or to do both. If you are just installing a server on your machine it is a good idea to do both steps. ------------------- The wizards you want to execute Installation of the Tigase Server [on, off] on Configuration of the Tigase Server [on, off] on -------------------
5、Installer Info
Please note! While the Tigase server is quite stable and well tested application the installer itself is a new addition. Take precautions especially if you upgrade the server from earlier version. Backup old server files and the database. If you notice any problems please report them to address: [email protected] press 1 to continue, 2 to quit, 3 to redisplay
6、Server Info
一直回车,直到出现下一个选项
7、Server License
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>. 1. I accept the terms of this license agreement. 2. I do not accept the terms of this license agreement. Choose number (1-2): 1</span> <span style="font-family:Courier New;">press 1 to continue, 2 to quit, 3 to redisplay 1
8、Server Location Selection
Select target path [/mnt/xmpp_service/soft/tigase] /mnt/xmpp_service/service/tigase press 1 to continue, 2 to quit, 3 to redisplay 1 ------
9、Selection of Packs to be Installed
选择你要安装的选项Select the packs you want to install: 1 => Base, The base files 2 => Unix Files, Files needed to run the server on Unix like systems 3 => [x] Docs, The documentation 4 => [x] Extras, Extras libraries, MUC, PubSub, STUN, Socks5, Message Archiving, ACS 5 => [x] Groovy scripting, Various Groovy scripts extending server functionality 6 => [x] Derby Database (DB included), Derby database (included) and JDBC driver 7 => [x] MySQL Database driver (DB not included), MySQL JDBC driver (MySQL has to be installed separately) 8 => [ ] PostgreSQL Database driver (DB not included), PostgreSQL JDBC driver (PostgreSQL has to be installed separately) 9 => [ ] SQL Server Database driver (DB not included), SQL Server JDBC driver (SQL Server has to be installed separately) 10 => [ ] MongoDB Database support (DB not included), Libraries need to use MongoDB from Tigase (includes driver) 11 => [x] OSGi dependencies, If you intend to run Tigase in OSGi mode you need additional libraries. Enabling this Pack will also setup configuration files to start Tigase XMPP server in OSGi mode. 12 => [x] HTTP API Component, Interface for the service administration, monitoring and exchange data between Tigase and external system 13 => [x] Sources, The server source files, tools and libraries sources are not included r => Redisplay menu d => Done Choose action: d
press 1 to continue, 2 to quit, 3 to redisplay 1 [ Starting to unpack ] [ Processing package: Base (1/10) ] [ Processing package: Unix Files (2/10) ] [ Processing package: Docs (3/10) ] [ Processing package: Extras (4/10) ] [ Processing package: Groovy scripting (5/10) ] [ Processing package: Derby Database (DB included) (6/10) ] [ Processing package: MySQL Database driver (DB not included) (7/10) ] [ Processing package: OSGi dependencies (8/10) ] [ Processing package: HTTP API Component (9/10) ] [ Processing package: Sources (10/10) ] [ Unpacking finished ] *** Basic Tigase server configuration On this panel you can specify basic configuration settings for the Tigase server. Based on your selection here more configuration options might be presented later on. After the configuration is complete init.properties file will be created.
10、Basic Configuration
You can optionally restart the server at the end of the process if you like. ------------------- 0 [x] Default installation 1 [ ] Default plus extra components 2 [ ] Session Manager only 3 [ ] Network connectivity only input selection: 0 Your XMPP (Jabber) domains [<strong>iZ235okehetZ</strong>] Server administrators [<strong>admin@iZ235okehetZ</strong>] Admin password [<strong>tigase</strong>] 0 [x] Derby (built-in database) 1 [ ] MySQL 2 [ ] PostgreSQL 3 [ ] SQLServer 4 [ ] Other... input selection: 1 -------------------
11、Advanced Configuration
------------------- Advanced configuration options [on, off] off press 1 to continue, 2 to quit, 3 to redisplay 1 *** Database configuration: You have selected MySQL database. This database needs additional configuration parameters. Please enter all required information. -------------------
12、Database Configuration
All users added Post installation actions Finalizing... completed OK Loading socks5 component schema Loading socks5 schema... Socks5 schema exists, skipping schema load Loading PubSub component schema Loading PubSub schema... PubSub schema exists, skipping schema load Install was successeful application installed on /mnt/xmpp_service/service/tigase [ Console installation done ]
13、启动以及fix bug
[root@iZ235okehetZ tigase]# ./scripts/tigase.sh start etc/tigase.conf Starting Tigase: Tigase running pid=19179 [root@iZ235okehetZ tigase]# nohup: redirecting stderr to stdout
然后我们查看日志
Mar 27, 2015 11:41:56 AM tigase.conf.ConfiguratorAbstract setProperties Mar 27, 2015 11:41:58 AM tigase.db.jdbc.DataRepositoryImpl initRepository SEVERE: null java.lang.ClassNotFoundException: com.mysql.jdbc.Driver not found by tigase-server [26] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1988) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:274) at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:262) at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:458) at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:575) at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:660) at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:903) at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:832) at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540) at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177) at tigase.conf.Configurator.componentAdded(Configurator.java:50) at tigase.conf.Configurator.componentAdded(Configurator.java:33) at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116) at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131) at tigase.server.MessageRouter.setConfig(MessageRouter.java:603) at tigase.server.XMPPServer.start(XMPPServer.java:142) at tigase.osgi.Activator.start(Activator.java:89) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2152) at org.apache.felix.framework.Felix.startBundle(Felix.java:2070) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1297) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.lang.Thread.run(Thread.java:745)
#osgiEnabled=(true|false) #osgiEnabled=false <strong>OSGI=false</strong> ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver" #GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks" #EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0" JAVA_HOME="/usr/java/jdk1.7.0_71" CLASSPATH="" JAVA_OPTIONS="${GC} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} <strong>-server -Xms1000M -Xmx2000M -XX:PermSize=320m -XX:MaxPermSize=2560m -XX:MaxDirectMemorySize=1280m</strong> " TIGASE_CONFIG="etc/tigase.xml" TIGASE_OPTIONS=" --property-file etc/init.properties "
三、测试
用spark客户端进行测试
注册
登录:
登录成功!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。