1 基础知识
1.1 Tigase支持的数据库
Database |
Recommended |
Minimum Version |
Additional |
DerbyDB |
10.12.1.1 |
10.12.1.1 |
Included with Tigase |
MySQL |
5.7 |
5.6.4 |
Required to properly support timestamp |
SQLServer |
2014 |
2012 |
2012 needed so we can count use |
PostgreSQL |
9.5 |
9.4 |
New UA schema requires at least 9.4 |
MongoDB |
3.2 |
3.0 |
|
MariaDB |
? |
10.0.12 |
Basic features works with |
1.2 Tigase集成数据的的条件
– 合适的Java MongoDB驱动(即/usr/tigase/jars/tigase-mongodb.jar)
– 数据库分配具有root权限的用户
2 最佳实践
2.1 环境部署
2.1.1 部署Tigase
如果你尚未部署Tigase 8.x,请参阅以下章节部署,
2.1.2 部署MongoDB
如果你尚未部署Tigase所需的MongoDB,请参阅以下章节部署,
2.2 配置Tigase
2.2.1 准备Tigase所需的数据(可选)
mongo
使用如下命令完成数据库认证,
use admin db.auth("root","rootpwd")
使用如下命令创建应用所需的数据库权限,
use tigasedb db.createUser( { user:"tigase", pwd:"tigasepwd", roles:[{role:"dbOwner",db:"tigase"}] } ) quit()
2.2.2 运行配置向导
http://cmdschool.org:8080/
由于以上是界面操作,详细步骤省略,参数填写可参考如下信息,
company name: cmdschool.org Configuration type: Default installation Your XMPP (Jabber) default domain: cmdschool.org Server administrators: admin@cmdschool.org Admin password: adminpwd Select database: MongoDb Name of the database: tigasedb Address of the database: localhost Name of the user: tigase Password of the user: tigasepwd Database root account username: root Database root account password: rootpwd User Name of Security: admin Password of Security: adminpwd
最终生成的配置文件可通过如下命令查询,
cat /etc/tigase/config.tdsl
详细配置如下,
admins = [ 'admin@cmdschool.org' ] 'config-type' = 'default' debug = [ 'server' ] 'default-virtual-host' = 'cmdschool.org' dataSource () { default () { uri = 'mongodb://tigase:tigasepwd@localhost/tigasedb' } } http () { setup () { 'admin-password' = 'tigasepwd' 'admin-user' = 'tigase' } } pubsub () { trusted = [ 'http@{clusterNode}' ] } 'sess-man' () { 'audit-log' () {} msgoffline () {} 'pep-simple' () {} 'presence-offline' () {} }
注:从向导生成的配置可知,“dataSource ()”函数的配置用于集成MongoDB数据库。
2.2.3 重启服务是配置生效
systemctl restart tigase-server
然后,你可以使用如下命令查看倾听端口的变化,
netstat -antp | grep `pgrep -u tigase java`
可见如下显示,
tcp6 0 0 :::5290 :::* LISTEN 3721/java tcp6 0 0 :::8080 :::* LISTEN 3721/java tcp6 0 0 :::5269 :::* LISTEN 3721/java tcp6 0 0 :::5280 :::* LISTEN 3721/java tcp6 0 0 :::5222 :::* LISTEN 3721/java tcp6 0 0 :::5223 :::* LISTEN 3721/java tcp6 0 0 127.0.0.1:57378 127.0.0.1:27017 ESTABLISHED 3721/java tcp6 0 0 127.0.0.1:57380 127.0.0.1:27017 ESTABLISHED 3721/java
2.2.4 注册管理员
如上图所示,
单击【Register】
窗口显示如下,
如上图所示,
单击【Next】
窗口显示如下,
如上图所示,
按如下参数范例填写,
Username: admin
Password: adminpwd
Email: will@cmdschool.org
单击【Next】
窗口显示如下,
如上图所示,
单击【Close】即可完成管理员账号的创建
2.2.5 测试管理员登录
http://cmdschool.org:8080/admin/
Username: admin@cmdschool.org
Password: adminpwd
参阅文档
=======================
管理员创建失败
————
https://github.com/tigase/tigase-server/issues/52
没有评论