Project

General

Profile

MUC In Cluster Mode

Subir Jolly
Added over 5 years ago

Hi Guys,

I look at all(most) your MUC documentation but I am unable to get clustering to work.

I have 3 users and 2 servers.

user1, user2, user3

host1, host2

user2 is logged in on host1.

user1 and user3 are logged in on host2.

When user2 tries to create a chatroom and invites user1 and user3, the room does get created but NO invites are received by user1 and user3.

When user1/3 try to create a chatroom and invite users then the room does NOT get created and NO invites are sent either.

I am attaching host1.init.properties.txt, host2.init.properties.txt(init.properties files on respective servers host1 and host2) and tigase.conf.

I am using:

tigase-server: 5.2.0 latest

tigase-xmltools: 3.4.4 latest

tigase-utils: 3.4.2 latest

tigase-muc: 2.2.0 latest

Please tell me if my configs are wrong for MUC. Rest everything is working fine for now.

Thanks,

Subir


Replies (33)

(1)

Added by Subir Jolly over 5 years ago

Also the servers are load balanced.

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Could you please run one more test with your configuration. Please rename your MUC component from rooms to muc*. I remember there was *muc hardcoded somewhere in the past. I think this has been fixed already but just in case it is not, please use the muc for the component name to exclude that possibility.

Otherwise I do not see anything wrong with your configuration. We have it working like this on our installations. Maybe Wojciech can have a look at it once he is online.

Added by Wojciech Kapcia TigaseTeam over 5 years ago

Configuration indeed looks ok. There shouldn't be also any problem with different name of component. I've run a quick test and in fact it's working without any problem on our side. Logs would definitely be helpful.

I assume clustering works ok for you? You have correct hostname configuration (including FQDN!) and components are correctly identified (i.e. sess-man@hostname1)?

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Yes, this is another possibility which comes to my mind, that the cluster does not work correctly, that is, cluster nodes are not connected to each other.

Added by Subir Jolly over 5 years ago

I changed rooms to muc everywhere. Still seeing the same issue. Clustering seems to be working for me as users on a same domain on different servers can see each other. I do see sess-man@hostname in logs too. I do notice a message in the logs:

2013-12-03 15:42:20.778 [pool-11-thread-3] ClusterConnectionManager.processHandshake() WARNING: Handshaking password doesn't match, disconnecting...

Could this be the reason?

I am not sure what logs would you like to see?

(1)

Added by Subir Jolly over 5 years ago

I just noticed that clustering isn't working for me now. I will try to figure out why clustering is broken.

Added by Subir Jolly over 5 years ago

I just used 5.2.0 beta3 packages for tigase-server/utils/xmltools/muc. Noticed that clustering is working fine now. Still having the same issue with MUC. I can get stand-alone MUC working on host1(not host2) but not clustered. Users on host2 don't send/get any muc invites. I also noticed that tigase keeps spitting the following line for a long time. Seems like it goes in infinite loop or something:

2013-12-03 19:06:05.994 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: Still no comp name matches: te323r@muc.dev.email.us/test8, for map: {cl-comp=tigase.cluster.ClusterConnectionManager@1c4d98da, c2s=tigase.cluster.ClientConnectionClustered@63eb7fdd, basic-conf=tigase.conf.Configurator@ceee5f1, s2s=tigase.cluster.S2SConnectionClustered@105ad386, cluster-contr=tigase.cluster.ClusterController@42a014ef, bosh=tigase.cluster.BoshConnectionClustered@23e34235, vhost-man=tigase.vhosts.VHostManager@183a37d9, sess-man=tigase.cluster.SessionManagerClustered@9c2806a, ws2s=tigase.server.websocket.WebSocketClientConnectionManager@3e403c23, message-router=tigase.server.MessageRouter@162893fc, stats=tigase.stats.StatisticsCollector@78900845, amp=tigase.server.amp.AmpComponent@572433e7, monitor=tigase.cluster.MonitorClustered@59961a07, muc=tigase.cluster.VirtualComponent@d86ef84}, for all VHosts: {3}

Added by Subir Jolly over 5 years ago

I am using the latest rc1 packages with the same configs and clustering is definitely not working for me.

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

Subir Jolly wrote:

2013-12-03 15:42:20.778 [pool-11-thread-3] ClusterConnectionManager.processHandshake() WARNING: Handshaking password doesn't match, disconnecting...

This means that clustering basically doesn't work. Version 5.2.0 introduces improved protection (and automatic discovery of cluster nodes) - each node has it's own password stored in the db. Please verify that all nodes can access database without any problem; also - list of nodes is no longer needed - please try removing it to see if it helps (this may be the culprit).

Added by Subir Jolly over 5 years ago

That makes sense. Where can I find the documentation around clustering update and how to update tigase databases(in production)?

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

This log message means that the server cannot find the MUC component. Most likely a configuration mistake. Either the MUC component or virtual component is not present or they are configured under a different name.

(1)

Added by Subir Jolly over 5 years ago

Do I have to add any new tables in db or just update any existing tables to set password for the nodes? Also, Where can I find the documentation around clustering update and how to update tigase databases(in production)?

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

There is no documentation because everything should be automatic. Assuming the DB user you use for the Tigase server to connect to the database has permissions to create tables. You can check your database if there is cluster_nodes table and if it contains up to date entries from both nodes.

(1)

Added by Subir Jolly over 5 years ago

Ah I just removed

--cluster-nodes=xxxxxx

--cl-conn-repo-class=tigase.cluster.repo.ClConConfigRepository

and it created cluster_nodes table in db. Now I will try clustering again.

(1)

Added by Subir Jolly over 5 years ago

Okay.. So, I have got the clustering working. Users can see each other in cluster mode using rc1 packages. Back to MUC issue. Still having the same issue. MUC not working. I am using beta3 version of MUC. Rest of the packages are rc1. Could this cause an issue?

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

This shouldn't be an issue - there wasn't much changes in MUC component between beta3 and rc1 release.

Again - an excerpt from logs (complete tigase-console.log and tigase.log.x with @--debug=server,xmpp.impl,muc@) from the time when you try entering same room would be helpful.

(1)

Added by Subir Jolly over 5 years ago

Here are the logs. I tried to create two rooms, "qwerty" and "qwertyuiop". qwerty showed a chat room but never sent invite to the user on the other server. qwertyuiop did not even send any invite or show a chat room. Just made tigase on server 2 go crazy.

Added by Wojciech Kapcia TigaseTeam over 5 years ago

  • Please include complete @tigase-console.log* files right from the start.

  • Did you you included muc in debugging?

  • Could you please clear VHost list of stale/not needed entries, especially those starting with muc. and/or chat*, conference., *rooms. as well as those matching hostnames.

Added by Subir Jolly over 5 years ago

I did have muc debugging turned on. Before taking these new logs, I reset db. Attaching latest logs.

Added by Subir Jolly over 5 years ago

In the mean time, can you provide me with a working MUC config?

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

How did you reset the DB? It seems that all previous configuration regarding VHosts are there:

2013-12-05 16:59:47.700 [hostnames]        ConfigRepository.addItem()         INFO:     No repoChangeListener for: Domain: $host_name, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL repoChangeListener for: Domain: localhost, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL
2013-12-05 16:59:51.286 [hostnames]        ConfigRepository.addItem()         INFO:     No repoChangeListener for: Domain: domain.com, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL
2013-12-05 16:59:51.466 [hostnames]        ConfigRepository.addItem()         INFO:     No repoChangeListener for: Domain: muc.host1, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL

etc...

Please either use fresh DB or remove unnecessary VHost items from current on and try to reproduce the issue.

(1)

Added by Subir Jolly over 5 years ago

I created a fresh db. Just ran tigase a couple of times in cluster mode before I got these logs.

Added by Wojciech Kapcia TigaseTeam over 5 years ago

That's odd, despite using fresh DB and no VHost configuration you still end up having extra entries. I've noticed that you're using custom VHostRepository implementation - could you share it's details?

On the one hand VHostManager reports 8 Vhosts (among which there is @muc.chat.staging.srvr.com@) yet MessageRouter reports for all VHosts: {3}. Given, that MessageRouter is dependent on VHost configuration for routing we need to sort out issue with additional entries, namely where they come from and why there are here. I would suggest looking for your custom implementation of VHostRepository (did you by any chance hardcoded those entries or fetch them from different source?).

Added by Subir Jolly over 5 years ago

This what the VHostRepository looks like. I also tried using without any of the custom plugins.

public class CustomVHostRepository extends VHostJDBCRepository {

    private static final Logger log =
            Logger.getLogger(CustomVHostRepository.class.getName());

    @Override
    public boolean contains(String domain) {
        boolean result = super.contains(domain);

        if (!result) {
            if (!domain.contains("@") && !"proxy.eu.jabber.org".equals(domain)) {
                VHostItem item;
                try {
                    item = new VHostItem(domain);
                    addItem(item);
                } catch (TigaseStringprepException ex) {
                    log.log(Level.SEVERE, null, ex);
                }
                result = true;
            }
        }

        return result;
    }

    @Override
    public void getDefaults(Map<String, Object> defs, Map<String, Object> params) {
        super.getDefaults(defs, params);
    }

    @Override
    public void setProperties(Map<String, Object> properties) {
        super.setProperties(properties);
    }

    @Override
    public String validateItem(VHostItem item) {
        return null;
    }
}

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

Could you provide output of following DB query?

select * from tig_pairs where pkey='vhosts-lists';

Is it possible that you have another source of VHosts? Admin-ad hoc queries, REST calls, etc.?

(1-25/33)