From 16fcb2997ee140a121903c4444ecb3364a3ff2c0 Mon Sep 17 00:00:00 2001 From: Feng Date: Tue, 19 Apr 2016 16:14:07 +0800 Subject: [PATCH] issue#516 - The erlang '-name' requires the fully qualified host name --- docs/source/cluster.rst | 53 ++++++++++++++++++++++------------------- docs/source/config.rst | 5 +++- rel/files/vm.args | 10 ++++++-- 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/docs/source/cluster.rst b/docs/source/cluster.rst index bf6bcfdd2..8ebd992ba 100644 --- a/docs/source/cluster.rst +++ b/docs/source/cluster.rst @@ -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 diff --git a/docs/source/config.rst b/docs/source/config.rst index f8cd21657..d964205d0 100644 --- a/docs/source/config.rst +++ b/docs/source/config.rst @@ -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 diff --git a/rel/files/vm.args b/rel/files/vm.args index 245e369c6..27c743997 100644 --- a/rel/files/vm.args +++ b/rel/files/vm.args @@ -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 ##-------------------------------------------------------------------------