config-type=--gen-config-def
--admins=admin@www.youserver.com
--virt-hosts = www.youserver.com
#--debug=net
--debug=server,xmpp,cluster,pubsub
--auth-db=tigase.mongodb.MongoRepository
--user-db=tigase.mongodb.MongoRepository
--user-db-uri=mongodb://www.youserver.com:27017/tigase
--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
http/http/port[I]=8080
http/dns-webservice/active[B]=true
http/api-keys[s]=open_access
http/rest-scripts-dir[S]=scripts/rest
http/server-class[S]=tigase.http.java.JavaStandaloneHttpServer
#MUC
--comp-name-2 = muc
--comp-class-2 = tigase.muc.MUCComponent
--muc/history-db-uri=mongodb://www.youserver.com:27017/tigase
--muc/history-db=tigase.mongodb.muc.MongoHistoryProvider
#PUBSUB
--comp-name-3 = pubsub
--comp-class-3 = tigase.pubsub.PubSubComponent
--pubsub/pubsub-repo-url=mongodb://www.youserver.com:27017/tigase
--pubsub/pubsub-repo-class=tigase.mongodb.pubsub.PubSubDAOMongo
#AMP
--comp-name-4=amp
--comp-class-4=tigase.server.amp.AmpComponent
# amp组件配置
amp/amp-repo-uri=mongodb://www.youserver.com:27017/tigase
amp/amp-repo-class=tigase.mongodb.MongoMsgRepository
# amp插件配置
sess-man/plugins-conf/amp/amp-repo-uri=mongodb://www.youserver.com:27017/tigase
sess-man/plugins-conf/amp/amp-repo-class=tigase.mongodb.MongoMsgRepository
#MWSSAGE-ARCHIVE
--comp-name-5=message-archive
--comp-class-5=tigase.archive.MessageArchiveComponent
message-archive/archive-repo-uri=mongodb://www.youserver.com:27017/tigase
message-archive/auto=true
sess-man/plugins-conf/message-archive-xep-0136/component-jid=message-archive@www.youserver.com
sess-man/plugins-conf/message-archive-xep-0136/default-store-method=message
sess-man/plugins-conf/message-archive-xep-0136/required-store-method=body
sess-man/plugins-conf/message-archive-xep-0136/store-muc-messages=user
--sm-plugins=+jabber:iq:register,+message-archive-xep-0136
几个主要的配置文件
1.tigase.xml tigase server的唯一配置文件,存储所有的运行时数据,若是缺失的话,会根据Init.properties文件生成一个,动态生成数据的话,可以用Ad-hoc命令。但是不推荐
2.init.properties key=value存储的格式,修改不会影响已经在运行的服务,若是动态修改的话,通过
3.tigase.conf 不是tigase本身使用,主要是操作系统一些信息,例如JAVA_HOME、JAVA_OPTIONS等信息,只有在linux系统下才有用,windows下是用wrapper.conf
一 init.properties中的详细配置
http://www.tigase.org/content/tigase-xmpp-server-configuration-properties
基本配置:
–user-db 用户数据的存储方式 –user-db = ldap
–user-db-uri 存储的具体地址 –user-db-uri = jdbc:postgresql://localhost/tigase?user=tigase
–user-domain-repo-pool 每个不同域下用户数据库连接池的实现
–user-repo-pool 用户数据库连接实现 –user-domain-repo-pool = tigase.db.UserRepositoryMDImpl
–vhost-anonymous-enabled 是否允许anonymous用户登陆,默认是true ,需要修改为false
–virt-hosts:虚拟服务器的配置
–vhost-tls-required : 是否开启tls
–script-dir 管理员脚本的存放路径
–sm-cluster-strategy-class 集群环境的使用
–test 测试模式,关闭所有的日志
–tigase-config-repo-class 读取tigase的配置方式,默认是xml,也可以自定义
–tigase-config-repo-uri 通过数据库的方式读取tigase的配置 案例:–tigase-config-repo-uri = jdbc:mysql://localhost/tigase?user=root&password=mypass
–trusted 一些可信任的账户 –trusted = user@domain.com,user-2@domain2.com
–cmpname-ports s2s之间的TCP端口地址 案例:–s2s-ports=5269,5270,5271
–data-repo-pool-size 数据访问层的数据库连接池大小 DataRepository 是一个抽象
–debug、–debug-packages 是否开启debug 案例:–debug = server,xmpp.impl –debug-packages = com.company.CustomPlugin,com.company.custom
–external 外部组件
–monitoring 监控信息,案例:–monitoring = jmx:9050,http:9080,snmp:9060 具体详见http://www.tigase.org/content/setting-remote-monitoring-server
集群部署
–config-type 决定服务器启动的是 ,最重要的一个配置 –gen-config-def|–gen-config-all|–gen-config-sm|–gen-config-cs|–gen-config-comp
1)–gen-config-all:会话管理、c2s连接管理,s2s连接管理,一个额外组件连接管理、节点发送、节点接受
2)–gen-config-def:会话管理、c2s连接管理,s2s连接管理
3)–gen-config-sm:会话管理,一个额外组件连接管理
4)–gen-config-cs:c2s’, ‘s2s’, ‘ext2s’ 适合分布式系统
5)–gen-config-comp:只有一个额外组件的管理
–cluster-connect-all 新增节点时候是否自动建立已经在–cluster-nodes中的节点,默认是false,若是集群部署可以修改为true –cluster-connect-all = true
–cluster-mode 是否集群模式 案例:–cluster-mode=true
–cluster-nodes 集群部署信息 案例 –cluster-nodes = node1.domain,node2.domain,node3.domain 。 不同机器间必须能够互相解析对方的DNS地址
–client-access-policy-file 客户端的访问策略,是否允许跨域访问,默认配置文件是etc/client-access-policy.xml
–cross-domain-policy-file 跨域访问策略 默认是在etc/cross-domain-policy.xml
–cm-see-other-host 是否允许查看其它节点,默认实现是–cm-see-other-host=tigase.server.xmppclient.SeeOtherHostHashed,需要同Tigase Load Balancing配合使用
–domain-filter-policy 不同域下的用户是否可以进行通信,默认是ALL ,运行在不同子域下通信
安全:
–bosh-close-connection 是否在数据传递后关闭连接 默认是false,不需要去修改
–bosh-extra-headers-file 一些额外头信息的控制 详细见:http://www.tigase.org/content/bosh-extra-headers-file
性能优化:
–net-buff-high-throughput 高吞吐量下的网络缓存区大小 默认64k, 案例–net-buff-high-throughput = 256k
–net-buff-standard 标准情况下缓存区大小,默认是2K,
–new-connections-throttling 每秒连接到指定端口的并发数 默认5222:200,5223:50,5269:100,5280:1000,案例:–new-connections-throttling = 5222:100
–nonpriority-queue 是否启动无优先级队列 ,导致的后果会导致消息的乱序,但是对同一个用户的消息不回乱序
–queue-implementation 队列的实现,默认是tigase.util.PriorityQueueRelaxed
1)tigase.util.PriorityQueueRelaxed – 非要改的优先级队列,有较高的性能
2)tigase.util.PriorityQueueStrict – 严格的优先级队列,性能比不上PriorityQueueRelaxed
3)tigase.util.NonpriorityQueue – 无优先级队列
–max-queue-size 队列的最大长度 案例:–max-queue-size=10000
–cm-traffic-throttling 客户端和服务端节点间的控制c2s 具体解析同–cm-ht-traffic-throttling
–cm-ht-traffic-throttling 服务节点间的流量控制s2s 案例:–cm-ht-traffic-throttling = xmpp:25k:0:disc,bin:200m:0:disc
[xmpp|bin]:协议类型 xmpp协议和二进制流数据
[25k|200m]:每分钟最大的传输个数,0代表没有限制
0:每次连接传输的数据大小,0代表没有限制
[disc|drop]:对于超过的数据采取什么策略,disc是断开连接,drop是放弃数据
–vhost-max-users 单个虚拟节点的最大用户数,若是0,无限制
–elements-number-limit 最大连接数 案例:–elements-number-limit=20000
扩展:
–comp-name 定义那些非config-type指定的服务,命名而已 案例:–comp-name-1 = muc 同–comp-class配合使用
–comp-class 加载的其他服务 案例:–comp-class-1 = tigase.muc.MUCComponent
其他配置见:http://www.tigase.org/content/tigase-xmpp-server-configuration-properties
二 tigase.conf配置
JAVA_HOME:JDK地址
TIGASE_HOME:本身的部署地址
TIGASE_CONSOLE_LOG:日志存放地址,默认是在 TIGASE_HOME/logs/tigase-console.log
TIGASE_PID :PID的存放路径 :TIGASE_HOME/logs/tigase.pid
TIGASE_CONFIG:配置文件存放路径
JAVA_OPTIONS :JVM的一些参数设置
TIGASE_OPTIONS:一些其他配置
示例:
ENC=”-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8″
DRV=”-Djdbc.drivers=org.postgresql.Driver”
JAVA_OPTIONS=”${ENC} ${DRV} -server -Xms100M -Xmx100M ”
CLASSPATH=””
TIGASE_CONFIG=”tigase-pgsql.xml”
TIGASE_OPTIONS=” –property-file etc/init.properties ”
https://blog.youkuaiyun.com/lqglqglqg/article/details/43267757tigase集群配置
https://blog.youkuaiyun.com/weixin_34122604/article/details/89585729 Tigase负载均衡策略
https://blog.youkuaiyun.com/weixin_34376986/article/details/91666805 tigase集群整理
https://www.cnblogs.com/mstk/p/3937191.html Tigase集群设置
http://www.inter12.org/archives/879