Seperate CS from SM

Submitted by Anonymous on Tue, 2008-05-20 14:19.

good day

In the configuration wizard i came across the gen-config-sm and gen-config-cs
basically allowing to seperate the session manager from the C2s and S2s anf having a clustered approache. I have tried but cannot seem to make te two "servers" communicate. For testing purposes they are both running on the same machine.

Trackback URL for this post:

http://www.tigase.org/en/trackback/1412
kobit's picture
Submitted by kobit on Wed, 2008-05-21 09:41.

This is exactly what I am working on right now. Some code is already implemented and waiting in SVN repository the rest of the implementation should be ready soon.

If you are interested in details please have a look at the project roadmap.


Submitted by Anonymous (not verified) on Wed, 2008-05-21 09:18.

thank you for your help and time
It works fine now i have created a local and distant cs as well as a single SM and everyone communicates fine, the port was what stopped me yesterday.
On a slightly different topic, is it possible to cluster SM servers, having two or more answering for the same domain, and thus sharing the load. I have read the "Two or more SessionManagers" but it seems to only work for the case where you would want to reroute packets according to domain name, and as such different domain names. Could you have for example a Sm manager and a backup that share same domain name and maybe same user database with multiple distant C2s's, in the same way you can cluster the client part.

kobit's picture
Submitted by kobit on Tue, 2008-05-20 20:48.

Connection between SM and CS is done through "--ext-comp" pair. For each SM-CS pair you need corresponding --ext-comp pair (one in accept mode and the second in connect mode).

Ext-comp accepts only one connection so even if you have a single SM and 2 CS you have 2 connections SM-CS1 and SM-CS2, therefore you need 2 pairs of ext-comp. So for example on your SM the configuration should look like:

--ext-comp_1=sm.yoono-crawl,cs1.yoono-crawl,5768,very-secret,plain,accept
--ext-comp_2=sm.yoono-crawl,cs2.yoono-crawl,5769,very-secret,plain,accept

Note! Each ext-comp listens on a different port. Similarly in your CSes configurations each one has to point to proper, corresponding port.

Alternatively if you put connect connection type in your SM configuration you can use the same port as listening side is on a different machine. (Hopefully I haven't confused you too much. But if you have some TCP/IP knowledge you should know what I am talking about.)

The next version of ext-comp will support multiple connections by a single component.


Submitted by Anonymous (not verified) on Tue, 2008-05-20 17:32.

hello again

I have tried a creating 2 cs conf one local and one distant if i look at the Sm logs it seems he switches from one to the other but does not maintain both C2s alive a the same time. On my CS logs they say disconnected from sm server and reconnecting.
I have added a second ext-comp in the sm initial.properties file:
--ext-comp=sm.yoono-crawl,cs2.yoono-crawl,5768,very-secret,plain,accept

kobit's picture
Submitted by kobit on Tue, 2008-05-20 17:28.

Lines:

--comp-name-1=msn
--comp-class-1=tigase.server.gateways.Gateway

Should add MSN transport to your server already. Just browser service discovery to see if it is there. It might temporary not work however as I have done lots of changes to the code already.

I am now working on getting MSN transport to work correctly so it should work again very soon.

Regarding your question "Where?"

In theory it doesn't really matter where, it should work on CS or on SM equally well. The decision where to put it depends on your particular case. MSN gateway needs to make network connections to the MSN server so if SM is in location without direct access to the internet then you could put it in CS. This also makes more sense as CS is generally considered a connectivity part with s2s, c2s and possible msn component.

Putting MSN on SM however could be simpler to configure maybe.


Submitted by Anonymous (not verified) on Tue, 2008-05-20 17:01.

hello
thanks a bunch for your help i am slowly catching on but it works fine.
How and where do you add the msn transport when using a seperated CS,SM configuration.

kobit's picture
Submitted by kobit on Tue, 2008-05-20 16:23.

The CS tries to establish connection with SM and it attempts to connect to sm.yoono-crawl host on port 5678. Apparently it can not resolve the hostname: sm.yoono-crawl.

All the hostnames you use must be resolvable by your DNS system. The simplest way to make them resolvable in your local testing environment is to put them in hosts file.


Submitted by Anonymous (not verified) on Tue, 2008-05-20 16:16.

thank you for your help
I have added the ext-comp definition
and on my cs server log get the following error:

service c2s
2008-05-20 18:09:19 ConnectionManager$1.run() FINE: Reconnecting
service ext-comp
2008-05-20 18:09:19 ConnectionManager$1.run() FINE: Reconnecting
service s2s
2008-05-20 18:09:22 ConnectionOpenThread.run() SEVERE: Other service
exception.java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at tigase.net.ConnectionOpenThread.addISA(ConnectionOpenThread.java:145)

at tigase.net.ConnectionOpenThread.addPort(ConnectionOpenThread.java:123
)
at tigase.net.ConnectionOpenThread.addAllWaiting(ConnectionOpenThread.ja
va:159)
at tigase.net.ConnectionOpenThread.run(ConnectionOpenThread.java:208)
at java.lang.Thread.run(Unknown Source)

both my initial files are:
SM:
config-type=--gen-config-sm
--admins=admin@localhost
--virt-hosts = yoono-crawl,sm.yoono-crawl
--debug=server
--comp-name-1=msn
--comp-class-1=tigase.server.gateways.Gateway
--ext-comp=sm.yoono-crawl,cs.yoono-crawl,5678,very-secret,plain,accept

and CS:

config-type=--gen-config-cs
--admins=admin@localhost
--virt-hosts = cs.yoono-crawl,yoono-crawl,sm.yoono-crawl
--debug=server
--ext-comp=cs.yoono-crawl,sm.yoono-crawl,5678,very-secret,plain,connect

thanking you again for your time

kobit's picture
Submitted by kobit on Tue, 2008-05-20 15:39.

If you look at the configuration wizards guide, at the bottom of the page you can see 2 example configs. One for SM and another for CS.

If you scroll the content of the example config right you will see what is missing in your property files:

-ext-comp cs.tigase.org,sm.tigase.org,5678,very-secret,plain,connect"

This part is responsible for connectivity between both elements. As this is missing in your files both nodes can not communicate.


Submitted by Anonymous (not verified) on Tue, 2008-05-20 14:48.

My 2 initial.properties file:

config-type=--gen-config-sm
--admins=admin@localhost
--virt-hosts = sm-server
--debug=server
--comp-name-1=msn
--comp-class-1=tigase.server.gateways.Gateway

and

config-type=--gen-config-cs
--admins=admin@localhost
--virt-hosts = localhost
--debug=server

I am guessing i was a little hasty and should change admin@ to admin@server1 admin@server2
and change the second virt-hosts=server2

kobit's picture
Submitted by kobit on Tue, 2008-05-20 14:37.

In order to make it works like this, both servers must be available under a different domain name, even if they work on the same machine.

Could you please post here or to via contact form your configuration files (the files you used as configuration wizards) for me to look at them?
I would be able then to replicate your system here to find out what is wrong.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.