Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
rabbitmq [2015/12/08 11:37]
steve [Creating a Cluster]
rabbitmq [2015/12/08 11:46]
steve
Line 61: Line 61:
 A cluster can be created with more than one node. You will first create one instance which will act as the primary node, and then additional ones after that. Any time that a node is added to a running cluster, it will remove all the data currently in the primary node. A cluster can be created with more than one node. You will first create one instance which will act as the primary node, and then additional ones after that. Any time that a node is added to a running cluster, it will remove all the data currently in the primary node.
  
-First, start rabbitmq as normal on the primary node:+In this example, there will be two nodes only. A primary node which will start as normal using the default configuration,​ and then a secondary node which will be added to the first, therefore creating a cluster. 
 + 
 +First of all, start rabbitmq as normal on both of the nodes.
  
 <​code>​ <​code>​
Line 67: Line 69:
 </​code>​ </​code>​
  
-Get the erlang cookie ​of the primary node, and set it to the same value in the secondary node.+When a node is first started, RabbitMQ will create unique cookie (or identifier) for that node at ''/​var/​lib/​rabbitmq/​.erlang.cookie''​. For the two nodes to join together, ​the cookie must be the same on all nodes.
  
-On the primary node:+RabbitMQ will generate one itself on first startup, or it can be set manually to another value if wanted. 
 + 
 +One gotcha to be aware of is that the default cookie set will have no end-of-line for the string. Adding a new line will change the hash. In this case, it may be simpler to just create your own erlang cookie before starting ​the primary node.
  
 <​code>​ <​code>​
-cat /​var/​lib/​rabbitmq/​.erlang.cookie+pwgen 8 1 | tee /​var/​lib/​rabbitmq/​.erlang.cookie 
 +chmod 0600 /​var/​lib/​rabbitmq/​.erlang.cookie
 </​code>​ </​code>​
- 
-Alternatively,​ set the cookie manually: 
- 
-<​code>​ 
- 
-Note that by default, RabbitMQ will generate its own cookie, and the file will not have an EOL. So, there are two options. You can set