tinode/chat

[How to access the cluster ? ]

fallenleavesguy opened this issue · 6 comments

How to access the cluster ? Only accessing to the leader node or accessing to any node of the cluster ? Which is the right way. Thank you.

Any client can connect to any node.

We currently run the cluster behind an Nginx proxy which load balances connections (round-robin):

events {}
stream {
    server {
        listen 80;
        proxy_pass tinode;
    }
    server {
        listen 443;
        proxy_pass tinode_tls;
    }
    upstream tinode {
        server tinode-0:80 max_fails=5 fail_timeout=30s;
        server tinode-1:80 max_fails=5 fail_timeout=30s;
        server tinode-2:80 max_fails=5 fail_timeout=30s;
    }
    upstream tinode_tls {
        server tinode-0:443 max_fails=5 fail_timeout=30s;
        server tinode-1:443 max_fails=5 fail_timeout=30s;
        server tinode-2:443 max_fails=5 fail_timeout=30s;
    }
}

Keep in mind that there are some bugs in the cluster. We are actively working on it now.
Cluster is not necessary unless you have more than 100,000 users.

Thank you. I mean that can client establish websocket to any node of cluster ? Because according to raft protocol, it seems like only can request to the leader node to make changes

Thank you. I mean that can client establish websocket to any node of cluster ?

Yes.

So, the leader node is only use to maintain the Ping status ?

So, the leader node is only use to maintain the Ping status ?

Correct. The leader node is only for maintaining consistency of the cluster.

Thank you very much.