linux安装tigase

linux安装tigase

 

1  下载安装包

https://projects.tigase.org/projects/tigase-server/files

从中选一个,我这边选的是  tigase-server-5.1.0-beta2-b2555.tar.gz 

 

2  上传到linux服务器,解压

tar -zxvf tigase-server-5.1.0-beta2-b2555.tar.gz

 

3  进入 tigase目录  

cd tigase-server-5.1.0-beta2-b2555

 

4  赋予权限

chmod u+x ./scripts/tigase.sh

chmod u+x ./scripts/db-create-mysql.sh

 

5  设置JAVA_HOME

vi etc/tigase.conf

将JAVA_HOME 设置下JAVA_HOME="${JAVA_HOME}"

保存退出

 

6  设置初始化配置文件

vi etc/init.properties

 

config-type=--gen-config-def

[email protected]

--virt-hosts =tt.com

--debug=server

--monitoring=jmx:9050,http:9080,snmp:9060

--user-db=mysql

--user-db-uri=jdbc:mysql://127.0.0.1:3306/tigasedb?user=root&password=111111&useUnicode=true&characterEncoding=UTF-8

 

--comp-name-1 = muc

--comp-class-1 = tigase.muc.MUCComponent

--comp-name-2 = pubsub

--comp-class-2 = tigase.pubsub.PubSubComponent

 

以上是例子

保存退出

 

7  初始化数据库

 

 ./scripts/db-create-mysql.sh database/mysql-installer-create-db.sql 111111 tigasedb root e4b3k7y8-123 localhost


参数分别是   <未知>  <数据库名>  <数据库用户名>  <数据库密码>  <数据库地址>

 

8  启动tigase服务器

./scripts/tigase.sh start etc/tigase.conf

 

期间可能会出现以下情况

 

tigase.db.DBInitException: Problem initializing jdbc connection: null

        at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:828)

        at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)

        at tigase.server.xmppsession.SessionManager.setProperties(SessionManager.java:678)

        at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)

        at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

        at tigase.server.MessageRouter.addComponent(MessageRouter.java:131)

        at tigase.server.MessageRouter.addRouter(MessageRouter.java:171)

        at tigase.server.MessageRouter.setProperties(MessageRouter.java:697)

        at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)

        at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

        at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:157)

        at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)

        at tigase.server.XMPPServer.main(XMPPServer.java:135)

Caused by: java.lang.NullPointerException

        at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:784)

        at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:318)

        at tigase.server.xmppsession.SessionManager.setProperties(SessionManager.java:678)

        at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)

        at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

        at tigase.server.MessageRouter.addComponent(MessageRouter.java:131)

        at tigase.server.MessageRouter.addRouter(MessageRouter.java:171)

        at tigase.server.MessageRouter.setProperties(MessageRouter.java:697)

        at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:880)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:218)

        at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:71)

        at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

        at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:157)

        at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)

        at tigase.server.XMPPServer.main(XMPPServer.java:135)


查看了下资料,可能是mysql权限的问题,需要执行以下操作

登陆mysql ,执行

mysql -u root -p passwod 

mysql >grant all privileges on *.* to root@"%" identified by "Passwd"

mysql >flush privileges;

 

执行

./scripts/tigase.sh restart etc/tigase.conf

然后用spark注册连接吧,应该没问题了

 


你可能感兴趣的:(linux安装tigase)