Project

General

Profile

Cannot instance clustering strategy class: tigase.cluster.strategy.SMNonCachingAllNodes

bao qf
Added over 4 years ago

init.properties content is :

config-type=--gen-config-def

--admins=admin@test.xmpp

--virt-hosts = test.xmpp

--debug=server,cluster

--cluster-mode = true

--cluster-nodes=tigase1,tigase2

--sm-cluster-strategy-class=tigase.cluster.strategy.SMNonCachingAllNodes

--user-db=mysql

--user-db-uri=jdbc:mysql://192.168.3.210:3306/tigase?user=root&password=135246&useUnicode=true&characterEncoding=UTF-8

two server hosts is :

192.168.3.100 test.xmpp

192.168.3.100 tigase1

192.168.3.206 tigase2

Tigase1 os is CentOS 2.6.32-431.5.1.el6.x86_64,tigase server is 5.2.1.

Tigase2 os is win7 x64,tigase server is 5.2.0 source code run main at eclipse.

when i run tigase ./scripts/tigase.sh start etc/tigase.conf ,and tail -f tigase521/logs/tigase.log.0 at tigase1.

I find a error:

2014-06-30 17:04:46.428 [main] SessionManagerClustered.setProperties() SEVERE: Cannot instance clustering strategy class: tigase.cluster.strategy.SMNonCachingAllNodes

java.lang.InstantiationException

    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

    at java.lang.Class.newInstance(Class.java:374)

    at tigase.cluster.SessionManagerClustered.setProperties(SessionManagerClustered.java:618)

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

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

    at tigase.conf.Configurator.componentAdded(Configurator.java:50)

    at tigase.conf.Configurator.componentAdded(Configurator.java:33)

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

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

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

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

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

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

    at tigase.conf.Configurator.componentAdded(Configurator.java:50)

    at tigase.conf.Configurator.componentAdded(Configurator.java:33)

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

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

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

    at tigase.server.XMPPServer.start(XMPPServer.java:142)

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

tigase2 is ok,no error.

And use psi connect to tigase1 tips:Detail :disconnected.

Connect to tigase2 tips:Details:xmpp stream error:conflict(remote login replacing this one).

But is server not use cluster.psi can connect tigase1 and tigase2.

what happen? where error config?


Replies (10)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

bao qf wrote:

--sm-cluster-strategy-class=tigase.cluster.strategy.SMNonCachingAllNodes

This is default clustering strategy hence you don't need to explicitly specify it. The issue you experience comes from the change in the class name to: tigase.cluster.strategy.DefaultClusteringStrategy (this is more-or-less the same logic as with @SMNonCachingAllNodes@).

Added by bao qf over 4 years ago

remove --sm-cluster-strategy-class from ini file ,the Cannot instance clustering strategy class error is away.

But new error come as :

2014-06-30 18:34:24.845 [pool-11-thread-4]  XMPPIOService.processSocketData()  INFO:    null, type: connect, Socket: nullSocket[addr=tigase1/192.168.3.100,port=5277,localport=60674], jid: null, Incorrect XML data: <stream:stream xmlns='tigase:cluster' xmlns:stream='http://etherx.jabber.org/streams' from='localhost' to='localhost' id='ccbd6873-c8dc-47a8-932e-97834c554602'>, stopping connection: null, exception: 
java.lang.NullPointerException
        at tigase.cluster.ClusterConnectionManager.xmppStreamOpened(ClusterConnectionManager.java:684)
        at tigase.xmpp.XMPPIOService.xmppStreamOpened(XMPPIOService.java:802)
        at tigase.xmpp.XMPPDomBuilderHandler.startElement(XMPPDomBuilderHandler.java:316)
        at tigase.xml.SimpleParser.parse(SimpleParser.java:314)
        at tigase.xmpp.XMPPIOService.processSocketData(XMPPIOService.java:682)
        at tigase.net.IOService.call(IOService.java:265)
        at tigase.net.IOService.call(IOService.java:104)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

I find table cluster_nodes two rows,one row hostname is localhost,other row hostname is zgc-20130610jty(my win7 server name),why not tigase1,tigase2?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

You can remove the line:

--cluster-nodes=tigase1,tigase2

from your configuration as well. The version of the Tigase server you are using offers clustering auto-configuration, so it does not need it in the config.

Please note, Tigase uses canonical hostname to identify cluster nodes. Please make sure you have them set correctly or the cluster will not work. The locahost is not a correct canonical hostname. You have to set a different hostname or your cluster will not work.

Added by bao qf over 4 years ago

I remove the line --cluster-nodes=tigase1,tigase2.

And modify two server host as :

192.168.3.100 localhost

192.168.3.210 zgc-20130610jty

Now psi can login two server and chat each other.

But my CentOS server hostname is paopao,not localhost.Why tigase get cluster node hostname is localhost?

I try clear /etc/hosts,kill tigase ,delete etc/config-dump.properties,trancate table cluster_nodes,and restart tigase.

Table cluster_nodes only a row ,the field hostname always is localhost.

The config-dump.properties file is:

basic-conf/component-id[S]=basic-conf@localhost

basic-conf/def-hostname[S]=localhost

basic-conf/admins[s]=admin@test.xmpp

basic-conf/scripts-dir[S]=scripts/admin

basic-conf/command/ALL[S]=ADMIN

basic-conf/logging/.level[S]=CONFIG

basic-conf/logging/handlers[S]=java.util.logging.ConsoleHandler java.util.logging.FileHandler

basic-conf/logging/java.util.logging.ConsoleHandler.formatter[S]=tigase.util.LogFormatter

basic-conf/logging/java.util.logging.ConsoleHandler.level[S]=WARNING

basic-conf/logging/java.util.logging.FileHandler.append[S]=true

basic-conf/logging/java.util.logging.FileHandler.count[S]=5

basic-conf/logging/java.util.logging.FileHandler.formatter[S]=tigase.util.LogFormatter

basic-conf/logging/java.util.logging.FileHandler.limit[S]=10000000

basic-conf/logging/java.util.logging.FileHandler.pattern[S]=logs/tigase.log

basic-conf/logging/tigase.useParentHandlers[S]=true

basic-conf/logging/java.util.logging.FileHandler.level[S]=ALL

basic-conf/logging/tigase.server.level[S]=ALL

basic-conf/logging/tigase.cluster.level[S]=ALL

basic-conf/user-domain-repo-pool[S]=tigase.db.UserRepositoryMDImpl

basic-conf/auth-domain-repo-pool[S]=tigase.db.AuthRepositoryMDImpl

basic-conf/user-repo-pool-size[I]=10

basic-conf/data-repo-pool-size[I]=10

basic-conf/user-repo-class[S]=mysql

basic-conf/user-repo-url[S]=jdbc:mysql://192.168.3.210:3306/tigase?user=root&password=135246&useUnicode=true&characterEncoding=UTF-8

basic-conf/auth-repo-class[S]=tigase.db.jdbc.TigaseCustomAuth

basic-conf/auth-repo-url[S]=jdbc:mysql://192.168.3.210:3306/tigase?user=root&password=135246&useUnicode=true&characterEncoding=UTF-8

basic-conf/ssl-container-class[S]=tigase.io.SSLContextContainer

basic-conf/ssl-certs-location[S]=certs/

basic-conf/ssl-def-cert-domain[S]=default

basic-conf/config-dump-file[S]=etc/config-dump.properties

message-router/component-id[S]=message-router@localhost

message-router/def-hostname[S]=localhost

message-router/admins[s]=admin@test.xmpp

message-router/scripts-dir[S]=scripts/admin

message-router/command/ALL[S]=ADMIN

message-router/max-queue-size[I]=4660

message-router/scheduler-threads[I]=1

message-router/incoming-filters[S]=tigase.server.filters.PacketCounter

message-router/outgoing-filters[S]=tigase.server.filters.PacketCounter

message-router/components/msg-receivers/cl-comp.class[S]=tigase.cluster.ClusterConnectionManager

message-router/components/msg-receivers/cl-comp.active[B]=true

message-router/components/msg-receivers/id-names[s]=amp, bosh, c2s, cl-comp, monitor, s2s, sess-man, ws2s

message-router/components/msg-receivers/amp.class[S]=tigase.server.amp.AmpComponent

message-router/components/msg-receivers/amp.active[B]=true

message-router/components/msg-receivers/bosh.class[S]=tigase.cluster.BoshConnectionClustered

message-router/components/msg-receivers/bosh.active[B]=true

message-router/components/msg-receivers/c2s.class[S]=tigase.cluster.ClientConnectionClustered

message-router/components/msg-receivers/c2s.active[B]=true

message-router/components/msg-receivers/monitor.class[S]=tigase.cluster.MonitorClustered

message-router/components/msg-receivers/monitor.active[B]=true

message-router/components/msg-receivers/s2s.class[S]=tigase.cluster.S2SConnectionClustered

message-router/components/msg-receivers/s2s.active[B]=true

message-router/components/msg-receivers/sess-man.class[S]=tigase.cluster.SessionManagerClustered

message-router/components/msg-receivers/sess-man.active[B]=true

message-router/components/msg-receivers/ws2s.class[S]=tigase.cluster.WebSocketClientConnectionClustered

message-router/components/msg-receivers/ws2s.active[B]=true

message-router/components/registrators/id-names[s]=vhost-man, stats, cluster-contr

message-router/components/registrators/vhost-man.class[S]=tigase.cluster.VHostManagerClustered

message-router/components/registrators/vhost-man.active[B]=true

message-router/components/registrators/stats.class[S]=tigase.stats.StatisticsCollector

message-router/components/registrators/stats.active[B]=true

message-router/components/registrators/cluster-contr.class[S]=tigase.cluster.ClusterController

message-router/components/registrators/cluster-contr.active[B]=true

message-router/hostnames[s]=test.xmpp

message-router/disco-name[S]=Tigase

message-router/disco-show-version[B]=true

message-router/updates-checking[B]=true

message-router/updates-checking-interval[L]=7

vhost-man/component-id[S]=vhost-man@localhost

vhost-man/def-hostname[S]=localhost

vhost-man/admins[s]=admin@test.xmpp

vhost-man/scripts-dir[S]=scripts/admin

vhost-man/command/ALL[S]=ADMIN

vhost-man/repository-class[S]=tigase.vhosts.VHostJDBCRepository

vhost-man/hostnames[s]=test.xmpp

vhost-man/dns-srv-def-addr[S]=localhost

vhost-man/dns-def-ip[S]=127.0.0.1

vhost-man/domains-per-user-limit[I]=25

stats/component-id[S]=stats@localhost

stats/def-hostname[S]=localhost

stats/admins[s]=admin@test.xmpp

stats/scripts-dir[S]=scripts/admin

stats/command/ALL[S]=ADMIN

stats/stats-history-size[I]=0

stats/stats-update-interval[L]=10

cluster-contr/component-id[S]=cluster-contr@localhost

cluster-contr/def-hostname[S]=localhost

cluster-contr/admins[s]=admin@test.xmpp

cluster-contr/scripts-dir[S]=scripts/admin

cluster-contr/command/ALL[S]=ADMIN

amp/component-id[S]=amp@localhost

amp/def-hostname[S]=localhost

amp/admins[s]=admin@test.xmpp

amp/scripts-dir[S]=scripts/admin

amp/command/ALL[S]=ADMIN

amp/max-queue-size[I]=466

amp/scheduler-threads[I]=1

amp/incoming-filters[S]=tigase.server.filters.PacketCounter

amp/outgoing-filters[S]=tigase.server.filters.PacketCounter

amp/security-level[S]=STRICT

bosh/component-id[S]=bosh@localhost

bosh/def-hostname[S]=localhost

bosh/admins[s]=admin@test.xmpp

bosh/scripts-dir[S]=scripts/admin

bosh/command/ALL[S]=ADMIN

bosh/max-queue-size[I]=4660

bosh/scheduler-threads[I]=1

bosh/incoming-filters[S]=tigase.server.filters.PacketCounter

bosh/outgoing-filters[S]=tigase.server.filters.PacketCounter

bosh/connections/tls/use[B]=true

bosh/net-buffer[I]=2048

bosh/traffic-throttling[S]=

bosh/net-buffer-limit[I]=2097152

bosh/elements-number-limit[I]=1000

bosh/watchdog_delay[L]=600000

bosh/watchdog_timeout[L]=1740000

bosh/watchdog_ping_type[S]=WHITESPACE

bosh/connections/5280/type[S]=accept

bosh/connections/5280/socket[S]=plain

bosh/connections/5280/ifc[s]=*

bosh/connections/5280/remote-host[S]=localhost

bosh/connections/5280/connections/tls/required[B]=false

bosh/connections/ports[i]=5280

bosh/white-char-ack[B]=false

bosh/xmpp-ack[B]=false

bosh/max-inactivity-time[L]=600

bosh/cm-see-other-host[S]=

bosh/routings/multi-mode[B]=true

bosh/routings/.+[S]=sess-man@localhost

bosh/socket-close-wait[L]=1

bosh/tls-want-client-auth-enabled[B]=false

bosh/max-wait[L]=30

bosh/min-polling[L]=10

bosh/max-inactivity[L]=10

bosh/concurrent-requests[I]=2

bosh/hold-requests[I]=1

bosh/max-batch-size[I]=15

bosh/batch-queue-timeout[L]=100

c2s/component-id[S]=c2s@localhost

c2s/def-hostname[S]=localhost

c2s/admins[s]=admin@test.xmpp

c2s/scripts-dir[S]=scripts/admin

c2s/command/ALL[S]=ADMIN

c2s/max-queue-size[I]=4660

c2s/scheduler-threads[I]=1

c2s/incoming-filters[S]=tigase.server.filters.PacketCounter

c2s/outgoing-filters[S]=tigase.server.filters.PacketCounter

c2s/connections/tls/use[B]=true

c2s/net-buffer[I]=2048

c2s/traffic-throttling[S]=

c2s/net-buffer-limit[I]=2097152

c2s/elements-number-limit[I]=1000

c2s/watchdog_delay[L]=600000

c2s/watchdog_timeout[L]=1740000

c2s/watchdog_ping_type[S]=WHITESPACE

c2s/connections/5222/type[S]=accept

c2s/connections/5222/socket[S]=plain

c2s/connections/5222/ifc[s]=*

c2s/connections/5222/remote-host[S]=localhost

c2s/connections/5222/connections/tls/required[B]=false

c2s/connections/5223/type[S]=accept

c2s/connections/5223/socket[S]=ssl

c2s/connections/5223/ifc[s]=*

c2s/connections/5223/remote-host[S]=localhost

c2s/connections/5223/connections/tls/required[B]=false

c2s/connections/ports[i]=5222, 5223

c2s/white-char-ack[B]=false

c2s/xmpp-ack[B]=false

c2s/max-inactivity-time[L]=86400

c2s/cm-see-other-host[S]=

c2s/routings/multi-mode[B]=true

c2s/routings/.+[S]=sess-man@localhost

c2s/socket-close-wait[L]=1

c2s/tls-want-client-auth-enabled[B]=false

cl-comp/component-id[S]=cl-comp@localhost

cl-comp/def-hostname[S]=localhost

cl-comp/admins[s]=admin@test.xmpp

cl-comp/scripts-dir[S]=scripts/admin

cl-comp/command/ALL[S]=ADMIN

cl-comp/max-queue-size[I]=4660

cl-comp/scheduler-threads[I]=1

cl-comp/incoming-filters[S]=tigase.server.filters.PacketCounter

cl-comp/outgoing-filters[S]=tigase.server.filters.PacketCounter

cl-comp/connections/tls/use[B]=true

cl-comp/net-buffer[I]=65536

cl-comp/traffic-throttling[S]=

cl-comp/net-buffer-limit[I]=20971520

cl-comp/elements-number-limit[I]=100000

cl-comp/watchdog_delay[L]=600000

cl-comp/watchdog_timeout[L]=1740000

cl-comp/watchdog_ping_type[S]=WHITESPACE

cl-comp/connections/5277/type[S]=accept

cl-comp/connections/5277/socket[S]=plain

cl-comp/connections/5277/ifc[s]=*

cl-comp/connections/5277/remote-host[S]=localhost

cl-comp/connections/5277/connections/tls/required[B]=false

cl-comp/connections/ports[i]=5277

cl-comp/white-char-ack[B]=false

cl-comp/xmpp-ack[B]=false

cl-comp/max-inactivity-time[L]=86400000

cl-comp/repository-class[S]=tigase.cluster.repo.ClConSQLRepository

cl-comp/cluster-nodes[s]=localhost

cl-comp/repo-autoreload-interval[L]=15

cl-comp/repo-uri[S]=jdbc:mysql://192.168.3.210:3306/tigase?user=root&password=135246&useUnicode=true&characterEncoding=UTF-8

cl-comp/service-disco[B]=true

cl-comp/identity-type[S]=generic

cl-comp/connect-all[B]=false

cl-comp/cluster-controller-id[S]=cluster-contr@localhost

cl-comp/compress-stream[B]=false

cl-comp/cluster-connections-per-node[I]=2

monitor/component-id[S]=monitor@localhost

monitor/def-hostname[S]=localhost

monitor/admins[s]=admin@test.xmpp

monitor/scripts-dir[S]=scripts/admin

monitor/command/ALL[S]=ADMIN

monitor/max-queue-size[I]=466

monitor/scheduler-threads[I]=1

monitor/incoming-filters[S]=tigase.server.filters.PacketCounter

monitor/outgoing-filters[S]=tigase.server.filters.PacketCounter

s2s/component-id[S]=s2s@localhost

s2s/def-hostname[S]=localhost

s2s/admins[s]=admin@test.xmpp

s2s/scripts-dir[S]=scripts/admin

s2s/command/ALL[S]=ADMIN

s2s/max-queue-size[I]=466

s2s/scheduler-threads[I]=2

s2s/incoming-filters[S]=tigase.server.filters.PacketCounter

s2s/outgoing-filters[S]=tigase.server.filters.PacketCounter

s2s/connections/tls/use[B]=true

s2s/net-buffer[I]=65536

s2s/traffic-throttling[S]=

s2s/net-buffer-limit[I]=20971520

s2s/elements-number-limit[I]=1000

s2s/watchdog_delay[L]=600000

s2s/watchdog_timeout[L]=1740000

s2s/watchdog_ping_type[S]=WHITESPACE

s2s/connections/5269/type[S]=accept

s2s/connections/5269/socket[S]=plain

s2s/connections/5269/ifc[s]=*

s2s/connections/5269/remote-host[S]=localhost

s2s/connections/5269/connections/tls/required[B]=false

s2s/connections/ports[i]=5269

s2s/white-char-ack[B]=false

s2s/xmpp-ack[B]=false

s2s/max-inactivity-time[L]=900

s2s/max-packet-waiting-time[L]=420

s2s/max-in-conns[I]=4

s2s/max-out-total-conns[I]=1

s2s/max-out-per-ip-conns[I]=1

s2s/s2s-conn-selector[S]=tigase.server.xmppserver.S2SRandomSelector

s2s/cid-connections-tasks-threads[I]=2

sess-man/component-id[S]=sess-man@localhost

sess-man/def-hostname[S]=localhost

sess-man/admins[s]=admin@test.xmpp

sess-man/scripts-dir[S]=scripts/admin

sess-man/command/ALL[S]=ADMIN

sess-man/max-queue-size[I]=4660

sess-man/scheduler-threads[I]=1

sess-man/incoming-filters[S]=tigase.server.filters.PacketCounter

sess-man/outgoing-filters[S]=tigase.server.filters.PacketCounter

sess-man/admin-scripts-dir[S]=scripts/admin/

sess-man/plugins[s]=session-close, session-open, default-handler, jabber:iq:register, jabber:iq:auth, urn:ietf:params:xml:ns:xmpp-sasl, urn:ietf:params:xml:ns:xmpp-bind, urn:ietf:params:xml:ns:xmpp-session, jabber:iq:roster, jabber:iq:privacy, jabber:iq:version, http://jabber.org/protocol/stats, starttls, vcard-temp, http://jabber.org/protocol/commands, jabber:iq:private, urn:xmpp:ping, presence, disco, domain-filter, zlib, amp, message-carbons

sess-man/plugins-concurrency[S]=

sess-man/skip-privacy[B]=false

sess-man/trusted[s]=admin@test.xmpp

sess-man/offline-user-autocreate[S]=false

sess-man/sm-threads-pool[S]=default

sess-man/force-detail-stale-connection-check[B]=true

sess-man/stale-connection-closer-queue-size[I]=1000

sess-man/sm-cluster-strategy-class[S]=tigase.cluster.strategy.DefaultClusteringStrategy

sess-man/error-forwarding[S]=drop

sess-man/domain-name[S]=test.xmpp

ws2s/component-id[S]=ws2s@localhost

ws2s/def-hostname[S]=localhost

ws2s/admins[s]=admin@test.xmpp

ws2s/scripts-dir[S]=scripts/admin

ws2s/command/ALL[S]=ADMIN

ws2s/max-queue-size[I]=4660

ws2s/scheduler-threads[I]=1

ws2s/incoming-filters[S]=tigase.server.filters.PacketCounter

ws2s/outgoing-filters[S]=tigase.server.filters.PacketCounter

ws2s/connections/tls/use[B]=true

ws2s/net-buffer[I]=2048

ws2s/traffic-throttling[S]=

ws2s/net-buffer-limit[I]=2097152

ws2s/elements-number-limit[I]=1000

ws2s/watchdog_delay[L]=600000

ws2s/watchdog_timeout[L]=1740000

ws2s/watchdog_ping_type[S]=WHITESPACE

ws2s/connections/5290/type[S]=accept

ws2s/connections/5290/socket[S]=plain

ws2s/connections/5290/ifc[s]=*

ws2s/connections/5290/remote-host[S]=localhost

ws2s/connections/5290/connections/tls/required[B]=false

ws2s/connections/ports[i]=5290

ws2s/white-char-ack[B]=false

ws2s/xmpp-ack[B]=false

ws2s/max-inactivity-time[L]=86400

ws2s/cm-see-other-host[S]=

ws2s/routings/multi-mode[B]=true

ws2s/routings/.+[S]=sess-man@localhost

ws2s/socket-close-wait[L]=1

ws2s/tls-want-client-auth-enabled[B]=false

Added by Wojciech Kapcia TigaseTeam over 4 years ago

bao qf wrote:

Now psi can login two server and chat each other.

But my CentOS server hostname is paopao,not localhost.Why tigase get cluster node hostname is localhost?

I try clear /etc/hosts,kill tigase ,delete etc/config-dump.properties,trancate table cluster_nodes,and restart tigase.

Table cluster_nodes only a row ,the field hostname always is localhost.

Please make sure your system hostname configuration is correct and it identifies (including FQDN) correctly, i.e. check output of $ hostname and @$ hostname -f@.

Under RHEL/CentOS you should modify /etc/sysconfig/network as well and restart network service.

Added by bao qf over 4 years ago

Yes,hostname -f must return value./etc/hosts must delete ipv6 hostname:#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6.

Now two tigase server init.properties both are:

config-type=--gen-config-def
--admins=admin
--virt-hosts=xxx.com
--debug=server,cluster
--user-db=mysql
--user-db-uri=jdbc:mysql://10.162.70.106:53306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8
--c2s-ports=5555,5556
--s2s-ports=4444,4445
--cluster-mode=true
--sm-plugins=-jabber:iq:register,-jabber:iq:roster

/etc/hosts both are:

127.0.0.1 localhost
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.161.222.70 AY140423162328295c02Z
10.162.70.106 AY14060509302866026aZ

AY140423162328295c02Z,AY14060509302866026aZ is server name.

Use psi two account can connect two server ,and chat each other.

But now i use jaxmpp to connect tigase server cluster in android app.

When i connect AY14060509302866026aZ by public ip address and port,server return very slow and logcat :

07-07 09:28:10.397: W/System.err(27473): tigase.jaxmpp.core.client.exceptions.JaxmppException: java.net.ConnectException: failed to connect to ay140423162328295c02z/60.191.124.236 (port 5555): connect failed: ETIMEDOUT (Connection timed out)
07-07 09:28:10.407: W/System.err(27473):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.start(SocketConnector.java:693)
07-07 09:28:10.407: W/System.err(27473):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.workerTerminated(SocketConnector.java:766)
07-07 09:28:10.407: W/System.err(27473):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.access$200(SocketConnector.java:72)
07-07 09:28:10.407: W/System.err(27473):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector$Worker.run(SocketConnector.java:191)
07-07 09:28:10.417: W/System.err(27473): Caused by: java.net.ConnectException: failed to connect to ay140423162328295c02z/60.191.124.236 (port 5555): connect failed: ETIMEDOUT (Connection timed out)
07-07 09:28:10.417: W/System.err(27473):    at libcore.io.IoBridge.connect(IoBridge.java:114)
07-07 09:28:10.427: W/System.err(27473):    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
07-07 09:28:10.427: W/System.err(27473):    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
07-07 09:28:10.427: W/System.err(27473):    at java.net.Socket.startupSocket(Socket.java:596)
07-07 09:28:10.437: W/System.err(27473):    at java.net.Socket.<init>(Socket.java:225)
07-07 09:28:10.437: W/System.err(27473):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.start(SocketConnector.java:642)
07-07 09:28:10.437: W/System.err(27473):    ... 3 more
07-07 09:28:10.447: W/System.err(27473): Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
07-07 09:28:10.447: W/System.err(27473):    at libcore.io.Posix.connect(Native Method)
07-07 09:28:10.447: W/System.err(27473):    at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
07-07 09:28:10.457: W/System.err(27473):    at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
07-07 09:28:10.457: W/System.err(27473):    at libcore.io.IoBridge.connect(IoBridge.java:112)

My android client source code is :

                String un = app.getUser().getUid() + "@" + Consts.XMPP_DOMAIN;
                String pd = app.getUser().getPassword();
                XmppIpPort ipp = app.getUser().getXmppServer();
                xmpp.getProperties().setUserProperty(SessionObject.USER_BARE_JID, BareJID.bareJIDInstance(un));
                xmpp.getProperties().setUserProperty(SessionObject.PASSWORD, pd);
                xmpp.getProperties().setUserProperty(SocketConnector.SERVER_HOST, ipp.getIp());
                xmpp.getProperties().setUserProperty(SocketConnector.SERVER_PORT, ipp.getPort());
                xmpp.login(true);

ipp.getIp() is AY14060509302866026aZ public ip address.

Why client connect to othe server ay140423162328295c02z domain?

Added by Wojciech Kapcia TigaseTeam over 4 years ago

If using psi can you connect to both nodes?

Error:

connect failed: ETIMEDOUT (Connection timed out)

would indicate that something is blocking connection.

Added by bao qf over 4 years ago

yes,psi can connect.But android client use jaxmpp not connect.

Added by bao qf over 4 years ago

I guess it connect to another cluster hostname? But i connect the ip address.

Added by Wojciech Kapcia TigaseTeam over 4 years ago

You haven't provided information that you are able to connect to both AY140423162328295c02Z and AY14060509302866026aZ using Psi. You haven't said that your jaxmpp android client can connect to the other node (i.e. @AY14060509302866026aZ@). Please try all of this cases.

    (1-10/10)