Merge pull request #519 from emqtt/emq10

issue#516 - The erlang '-name' requires the fully qualified host name
This commit is contained in:
Feng Lee 2016-04-19 16:30:46 +08:00
commit 18b8e8195f
3 changed files with 40 additions and 28 deletions

View File

@ -144,22 +144,26 @@ Suppose client1 PUBLISH a message to the topic 't/a', the message Route and Deli
Cluster Setup
-------------
Suppose we deploy two nodes cluster on host1, host2:
Suppose we deploy two nodes cluster on s1.emqtt.io, s2.emqtt.io:
+----------------+-----------+---------------------+
| Node | Host | IP and Port |
+----------------+-----------+---------------------+
| emqttd@host1 | host1 | 192.168.1.10:1883 |
+----------------+-----------+---------------------+
| emqttd@host2 | host2 | 192.168.1.20:1883 |
+----------------+-----------+---------------------+
+--------------------------+-----------------+---------------------+
| Node | Host(FQDN) | IP and Port |
+--------------------------+-----------------+---------------------+
| emqttd@s1.emqtt.io or | s1.emqtt.io | 192.168.0.10:1883 |
| emqttd@192.168.0.10 | | |
+--------------------------+-----------------+---------------------+
| emqttd@s2.emqtt.io or | s2.emqtt.io | 192.168.0.20:1883 |
| emqttd@192.168.0.20 | | |
+--------------------------+-----------------+---------------------+
emqttd@host1 setting
--------------------
.. WARNING:: The node name is Name@Host, where Host is IP address or the fully qualified host name.
emqttd@s1.emqtt.io setting
--------------------------
emqttd/etc/vm.args::
-name emqttd@host1
-name emqttd@s1.emqtt.io
or
@ -167,12 +171,12 @@ emqttd/etc/vm.args::
.. WARNING:: The name cannot be changed after node joined the cluster.
emqttd@host2 setting
--------------------
emqttd@s2.emqtt.io setting
--------------------------
emqttd/etc/vm.args::
-name emqttd@host2
-name emqttd@s2.emqtt.io
or
@ -181,25 +185,25 @@ emqttd/etc/vm.args::
Join the cluster
----------------
Start the two broker nodes, and 'cluster join ' on emqttd@host2::
Start the two broker nodes, and 'cluster join ' on emqttd@s2.emqtt.io::
$ ./bin/emqttd_ctl cluster join emqttd@host1
$ ./bin/emqttd_ctl cluster join emqttd@s1.emqtt.io
Join the cluster successfully.
Cluster status: [{running_nodes,['emqttd@host1','emqttd@host2']}]
Cluster status: [{running_nodes,['emqttd@s1.emqtt.io','emqttd@s2.emqtt.io']}]
Or 'cluster join' on emqttd@host1::
Or 'cluster join' on emqttd@s1.emqtt.io::
$ ./bin/emqttd_ctl cluster join emqttd@host2
$ ./bin/emqttd_ctl cluster join emqttd@s2.emqtt.io
Join the cluster successfully.
Cluster status: [{running_nodes,['emqttd@host1','emqttd@host2']}]
Cluster status: [{running_nodes,['emqttd@s1.emqtt.io','emqttd@s2.emqtt.io']}]
Query the cluster status::
$ ./bin/emqttd_ctl cluster status
Cluster status: [{running_nodes,['emqttd@host1','emqttd@host2']}]
Cluster status: [{running_nodes,['emqttd@s1.emqtt.io','emqttd@s2.emqtt.io']}]
Leave the cluster
-----------------
@ -210,14 +214,13 @@ Two ways to leave the cluster:
2. remove: remove other nodes from the cluster
emqttd@host2 node tries to leave the cluster::
emqttd@s2.emqtt.io node tries to leave the cluster::
$ ./bin/emqttd_ctl cluster leave
Or remove emqttd@host2 node from the cluster on emqttd@host1::
$ ./bin/emqttd_ctl cluster remove emqttd@host2
Or remove emqttd@s2.emqtt.io node from the cluster on emqttd@s1.emqtt.io::
$ ./bin/emqttd_ctl cluster remove emqttd@s2.emqtt.io
--------------------
Session across Nodes

View File

@ -30,10 +30,13 @@ etc/vm.args
Configure and Optimize Erlang VM::
##-------------------------------------------------------------------------
## Name of the node
## Name of the node: Name@Host
##-------------------------------------------------------------------------
-name emqttd@127.0.0.1
# or
#-name emqttd@localhost.
## Cookie for distributed erlang
-setcookie emqttdsecretcookie

View File

@ -1,7 +1,13 @@
##-------------------------------------------------------------------------
## Name of the node
## Name of the emqttd node: Name@Host
##
## NOTICE: The Host should be IP address or the fully qualified host name.
## The short hostname cannot work!
##-------------------------------------------------------------------------
-name emqttd@127.0.0.1
# or
#-name emqttd@localhost.
## Cookie for distributed erlang
-setcookie emqttdsecretcookie
@ -34,7 +40,7 @@
## Valid range is 1-2097151. Default is 1024.
## +zdbbl 8192
## CPU Schedulers
## Set scheduler bind type.
## +sbt db
##-------------------------------------------------------------------------