Tigase集群设置

http://www.cnblogs.com/mstk/p/3937191.html


在两台Linux服务器ddd(IP:10.3.93.212)和tsung213(IP:10.3.93.213)上安装了Tigase,要把这两台服务器组成一个Tigase集群,只需要修改这两台服务器的init.properties文件的相关配置即可。 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
config-type=--gen-config-def
--admins=admin @myserver
--virt-hosts =myserver
--debug=server,cluster
--monitoring=jmx: 9050 ,http: 9080 ,snmp: 9060
--user-db=mysql
--user-db-uri=jdbc:mysql: //localhost:3306/tigase_db?user=tigase_user&password=123456&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true
--comp-name- 1  = muc
--comp- class - 1  = tigase.muc.MUCComponent
--comp-name- 2  = pubsub
--comp- class - 2  = tigase.pubsub.PubSubComponent
--cluster-mode = true
--cluster-nodes = tsung213,ddd
--cluster-connect-all = true

主要设置的含义如下:

--virt-hosts =myserver        集群名称为myserver
--cluster-mode = true         开启集群模式
--cluster-nodes = tsung213,ddd    集群包含了tsung213和ddd两个节点


tigase 集群 数据库配置



http://chenzhou123520.iteye.com/blog/1542852
http://hi.baidu.com/bngoogle/item/ac18ba1ed31530463a176ef2

集群的时候,调用同一个数据库,会报错;在调用存储过程的时候,会报错

 Problem initializing jdbc connection: jdbc:mysql://192.168.0.8:3306/tigase?user=xxxxxxxxxx


解决方案为;授权存储过程的权限;如下:

http://chenzhou123520.iteye.com/blog/1542852

在java中通过JDBC连接MySQL执行存储过程时报错:

 

Log代码   收藏代码
  1. java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.  

 

经过查阅资料得知,JDBC在调用存储过程时不光用户要有execute的权限,还需要对mysql.proc具有访问权限。否则它无法访问metadata。有两种解决方法:

一.给数据库连接设置一个noAccessToProcedureBodies属性,属性值为true,示例如下:

 

Xml代码   收藏代码
  1. jdbc:mysql://ipaddress:3306/test?noAccessToProcedureBodies=true  

 

 网上说设置noAccessToProcedureBodies=true会带来一些影响(未经考证):


1. 调用存储过程时,将没有类型检查,设为字符串类型,并且所有的参数设为int类型,但是在调用registerOutParameter时,不抛出异常。

2. 存储过程的查询结果无法使用getXXX(String parameterName)的形式获取,只能通过getXXX(int parameterIndex)的方式获取。

 

 

二.给数据库用户赋权,赋执行mysql.proc表的select权限,示例如下:

Sql代码   收藏代码
  1. GRANT SELECT ON mysql.proc TO 'user'@'localhost';  
 

 

参考资料:

  1. http://stackoverflow.com/questions/986628/mysql-java-cant-execute-stored-procedure
  2. http://space.itpub.net/18945822/viewspace-683363
  3. http://cau99.blog.51cto.com/1855224/348792



http://my.oschina.net/greki/blog/224596

集群配置

直接贴配置现在2台机器,s3-1,s3-4

s3-1配置

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
config- type =--gen-config-def
--cluster-mode = true
--cluster-nodes = s3-1.guahao.com:5333,s3-4.guahao.com:5333
--cluster-connect-all = true
 
--admins=admin@guahao.com
--virt-hosts=guahao.com
--debug=server,xmpp.impl,db,cluster
--monitoring=jmx:9050,http:9080,snmp:9060
--user-db=mysql
--user-db-uri=jdbc:mysql: //192 .168.1.15:3306 /tigasedb ?user=tigase&password=tigase&useUnicode= true &characterEncoding=UTF-8&autoCreateUser= true
 
--comp-name-1=message-archive
--comp-class-1=tigase.archive.MessageArchiveComponent
 
message-archive /archive-repo-uri =jdbc:mysql: //192 .168.1.15:3306 /tigasedb ?user=tigase&password=tigase&useUnicode= true &characterEncoding=UTF-8
 
--sm-plugins=+message-archive-xep-0136
sess- man /plugins-conf/message-archive-xep-0136/component-jid =message-archive@s3-1
 
sess- man /plugins-conf/message-archive-xep-0136/default-store-method =body
sess- man /plugins-conf/message-archive-xep-0136/required-store-method =body



s3-4
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
config- type =--gen-config-def
--cluster-mode = true
--cluster-nodes = s3-1.guahao.com:5333,s3-4.guahao.com:5333
--cluster-connect-all = true
 
--admins=admin@guahao.com
--virt-hosts=guahao.com
--debug=server,xmpp.impl,db,cluster
--monitoring=jmx:9050,http:9080,snmp:9060
--user-db=mysql
--user-db-uri=jdbc:mysql: //192 .168.1.15:3306 /tigasedb ?user=tigase&password=tigase&useUnicode= true &characterEncoding=UTF-8&autoCreateUser= true
 
--comp-name-1=message-archive
--comp-class-1=tigase.archive.MessageArchiveComponent
 
message-archive /archive-repo-uri =jdbc:mysql: //192 .168.1.15:3306 /tigasedb ?user=tigase&password=tigase&useUnicode= true &characterEncoding=UTF-8
 
--sm-plugins=+message-archive-xep-0136
sess- man /plugins-conf/message-archive-xep-0136/component-jid =message-archive@s3-1
 
sess- man /plugins-conf/message-archive-xep-0136/default-store-method =body
sess- man /plugins-conf/message-archive-xep-0136/required-store-method =body



注意集群要通,要确保主机名能相互访问,比如ping s3-4;

特别是用的虚拟主机,如果不通可以配下host

?
1
2
3
4
5
6
7
8
9
2.修改 /etc/hosts 里面的名字
vi /etc/hosts
 
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.1.26  s3-1
192.168.1.28  s3-4



配置参考:http://www.tigase.org/content/cluster-nodes

另外如果配置“cluster port”,作用是在已有的集群里添加,新服务器的时候,已有的服务器,不用任何动作;

集群策略

默认为集群策略说明,https://projects.tigase.org/projects/tigase-server/wiki/Default_clustering_strategy;要应用的时候多看看,这个策略不是做大量用户的

另外还有个商业化组件,需要购买license(它妹的上当了)

http://www.tigase.com/content/tigase-acs-advanced-clustering-strategy

这快还没真正使用,还得在研究研究



  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值