Code Monkey home page Code Monkey logo

Comments (2)

dergraf avatar dergraf commented on May 17, 2024

Hi there!

Thanks for reporting!
Regarding clustering I recommend to read https://vernemq.com/docs/clustering.html. Especially the sections about node names and firewalls.

This could be due to multiple problems, but restarting the service is definitely not needed for joining a cluster. You're making a mistake there. What is vmq-admin cluster status telling you? Have you checked the /var/log/vernemq/console.log?
Regarding your second problem, are you sure that it isn't the keepalive canceling the connections?

We've encountered two different issues that may cause problems during cluster setup

Problem 1: Change of node names

It is important that all of your VerneMQ nodes have a unique node name set in vernemq.conf before trying to cluster. Once the node is part of the cluster you should not change it's nodename, otherwise you will run into a problem where your cluster is not ready to serve requests anymore (unless you're explicitly telling it to do so.. but that's another topic). Changing node names once a node was part of a cluster is currently a bad idea, don't do it.

Two options exist:

  • 1st Option (Good):
    • Shutdown the faulty node
    • Login to other machine and execute vmq-admin cluster leave node=<<faultynode>>
    • Change the node name in vernemq.conf
    • Startup the node
    • Make the node part of the cluster using vmq-admin cluster join discovery-node=<<othernode>>
  • 2nd Option (Bad):
    • Shutdown every cluster node and delete the /var/lib/vernemq/meta/peer_service/cluster_state file
    • Set proper node names in the vernemq.conf on every machine
    • Restart all nodes
    • go on with joining the cluster using vmq-admin cluster join discovery-node=<<othernode>>

Also a single running node is running in a cluster, namely a single node cluster. Everything said here also applies if you want to change e.g. the name of such a single node. In this case however only the 2nd option currently works. This case is ugly and needs to be improved!

Problem 2: Wrong Listener Setup

We've seen a case, especially when run in a virtualized environment, that binding to the 0.0.0.0 interface is a bad idea, as this interface is somehow shared across multiple instances. However, this is currently the default for the vmq listener used for the cluster communication. You may want to try to set the listener.vmq.clustering to a specific interface.

Please let me know if this helps!

from vernemq.

berrywira avatar berrywira commented on May 17, 2024

Hi,

Sorry, so late give feedback to you.
I follow your suggestion. Now, all clustering running and awesome.
My problem is wrong listener cluster.
Thanks for helping me.

from vernemq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.