Project

General

Profile

Cluster deployment failed with S2S error message

Bruce Chung
Added over 2 years ago

I setup 2 machine for Tigase server cluster as shown as below:

The cluster configuration in etc/init.properties:


config-type=--gen-config-def

--virt-hosts = swiftlive.conversant.com.cn

--debug=server,xmpp.XMPPIOService,muc,http,db

--user-db=pgsql

--user-db-uri=jdbc:postgresql://192.168.1.23/tigasedb?user=tigase_user&password=tigase_dev&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true

--cluster-mode=true


The DNS configuration is below:


im5.swiftlive IN A 192.168.4.23

im6.swiftlive IN A 192.168.4.24

_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im5.swiftlive

_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im6.swiftlive

_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5269 im5.swiftlive

_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5269 im6.swiftlive


nslookup _xmpp-client._tcp.swiftlive.conversant.com.cn:


[conversant@im6 tigase]$ nslookup -querytype=SRV _xmpp-client._tcp.swiftlive.conversant.com.cn

Server: 192.168.1.24

Address: 192.168.1.24#53

_xmpp-client._tcp.swiftlive.conversant.com.cn service = 0 5 5222 im5.swiftlive.conversant.com.cn.

_xmpp-client._tcp.swiftlive.conversant.com.cn service = 0 5 5222 im6.swiftlive.conversant.com.cn.

_xmpp-client._tcp.swiftlive.conversant.com.cn service = 0 5 5269 im5.swiftlive.conversant.com.cn.

_xmpp-client._tcp.swiftlive.conversant.com.cn service = 0 5 5269 im6.swiftlive.conversant.com.cn.

The machine im5 host settings:


127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.4.23 im5 im5.swiftsync.conversant.com.cn

192.168.4.24 im6 im6.swiftsync.conversant.com.cn


vi /etc/sysconfig/network on im5:


NETWORKING=yes

HOSTNAME=im5


The machine im6 host settings:


127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.4.24 im6 im6.im6.swiftsync.conversant.com.cn

192.168.4.23 im5 im5.swiftsync.conversant.com.cn


vi /etc/sysconfig/network on im6:


NETWORKING=yes

HOSTNAME=im6


When using XMPP client to connet to swiftlive.conversant.com.cn, if the request is sending to im5, it works well.

But if the XMPP connection is connected to im6, the client got error: can't connect to swiftlive.conversant.com.cn.

Below is the error log on both im5 and im6:

===============================================

2016-10-12 03:23:00.476 [pool-11-thread-1] S2SConnectionManager.processSocketData() FINEST: Processing socket data:

from=null, to=null, DATA=

pop, SIZE=146, XMLNS=jabber:client, PRIORITY=NORMAL,

PERMISSION=NONE, TYPE=get

2016-10-12 03:23:00.476 [pool-11-thread-1] S2SAbstractProcessor.generateStreamError() FINEST: Called from:

java.lang.Throwable

    at tigase.server.xmppserver.proc.S2SAbstractProcessor.generateStreamError(S2SAbstractProcessor.java:154)

    at tigase.server.xmppserver.proc.PacketChecker.process(PacketChecker.java:111)

    at tigase.server.xmppserver.S2SConnectionManager.processSocketData(S2SConnectionManager.java:355)

    at tigase.server.xmppserver.S2SConnectionManager.processSocketData(S2SConnectionManager.java:71)

    at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:422)

    at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:71)

    at tigase.net.IOService.call(IOService.java:254)

    at tigase.net.IOService.call(IOService.java:94)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

2016-10-12 03:23:00.477 [pool-11-thread-1] S2SAbstractProcessor.generateStreamError() FINEST: CID: null, null,

type: accept, Socket: TLS: nullSocket[addr=/192.168.6.68,port=49754,localport=5269], jid: null, Sending stream error:

stream:error/stream:error/stream:stream

===============================================

Below is the log on im6 Tigase server when I register a user using XMPP client which tried to connect to swiftlive.conversant.com.cn :

===============================================

2016-10-12 03:40:18.716 [ConnectionOpenThread] ConnectionManager$ConnectionListenerImpl.accept() FINEST:

Accept called for service: null@null, port_props: {type=accept, socket=plain, ifc=[Ljava.lang.String;@615e3f51,

remote-host=localhost, required=false, port-no=5269}

2016-10-12 03:40:18.717 [ConnectionOpenThread] ConnectionManager.serviceStarted() FINER: s2s Connection started:

CID: null, null, type: accept, Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null

2016-10-12 03:40:18.717 [ConnectionOpenThread] S2SConnectionManager.serviceStarted() FINEST: s2s connection opened:

CID: null, null, type: accept, Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null

2016-10-12 03:40:18.718 [pool-11-thread-4] S2SConnectionManager.xmppStreamOpened() FINER: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null,

Stream opened: {xmlns:stream=http://etherx.jabber.org/streams, xmlns=jabber:client, to=swiftlive.conversant.com.cn, version=1.0}

2016-10-12 03:40:18.718 [pool-11-thread-4] StreamOpen.streamOpened() FINEST: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null, Accept Stream opened for unknown CID,

session id: 1a5594f4-3fba-43d4-806b-bb9539891945

2016-10-12 03:40:18.719 [pool-11-thread-4] StreamFeatures.streamOpened() FINEST: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null, Sending stream features:

stream:features

/stream:features

2016-10-12 03:40:18.719 [pool-11-thread-4] S2SConnectionManager.xmppStreamOpened() FINER: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null, Sending stream open:

<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:server' xmlns:db='jabber:server:dialback'

id='1a5594f4-3fba-43d4-806b-bb9539891945' version='1.0'>

2016-10-12 03:40:18.916 [pool-11-thread-3] S2SConnectionManager.processSocketData() FINEST: Processing socket data:

from=null, to=null, DATA=, SIZE=51, XMLNS=urn:ietf:params:xml:ns:xmpp-tls,

PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null

2016-10-12 03:40:18.917 [pool-11-thread-3] StartTLS.process() FINEST: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null, Sending packet:

2016-10-12 03:40:18.917 [pool-11-thread-3] StartTLS.process() FINEST: CID: null, null, type: accept,

Socket: nullSocket[addr=/192.168.6.143,port=52837,localport=5269], jid: null, Starting TLS handshaking server side.

2016-10-12 03:40:33.720 [pool-11-thread-2] ConnectionManager.serviceStopped() FINER: s2s Connection stopped:

CID: null, null, type: accept, Socket: TLS: nullSocket[unconnected], jid: null

===============================================


Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 2 years ago

Your issue has nothing to do with wrong Tigase XMPP Server configuration or with misbehaviour of Tigase XMPP Server.

Your issues is caused by DNS misconfiguration.

In your DNS configuration

im5.swiftlive IN A 192.168.4.23
im6.swiftlive IN A 192.168.4.24
_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im5.swiftlive
_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im6.swiftlive
_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5269 im5.swiftlive
_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5269 im6.swiftlive

it is configured that server listens for incoming XMPP client connections at ports 5222 and 5269 for domain @swiftlive@.

It is wrong as port 5269 is used for server-to-server connections and should not be registered as _xmpp-client._tcp SRV record for domain swiftlive as XMPP clients are not allowed to connect to this port (only XMPP server are allowed).

It should be registered as _xmpp-server._tcp SRV records for domain @swiftlive@.

So in your case DNS configuration should look like this:

_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im5.swiftlive
_xmpp-client._tcp.swiftlive 86400 IN SRV 0 5 5222 im6.swiftlive
_xmpp-server._tcp.swiftlive 86400 IN SRV 0 5 5269 im5.swiftlive
_xmpp-server._tcp.swiftlive 86400 IN SRV 0 5 5269 im6.swiftlive

Added by Bruce Chung over 2 years ago

Thank you very much.

I delete the 5269 SRV record. And it works fine now.

By the way , I also modify the hosts as below:

The machine im5/im6 hosts settings:


127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.4.23 im5

192.168.4.24 im6

    (1-2/2)