{"action":"created","issue":{"url":"https://api.github.com/repos/erlio/vernemq/issues/82","repository_url":"https://api.github.com/repos/erlio/vernemq","labels_url":"https://api.github.com/repos/erlio/vernemq/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/erlio/vernemq/issues/82/comments","events_url":"https://api.github.com/repos/erlio/vernemq/issues/82/events","html_url":"https://github.com/erlio/vernemq/issues/82","id":129859621,"number":82,"title":"Unable to remove node from cluster without stopping it","user":{"login":"andrehp","id":5660895,"avatar_url":"https://avatars.githubusercontent.com/u/5660895?v=3","gravatar_id":"","url":"https://api.github.com/users/andrehp","html_url":"https://github.com/andrehp","followers_url":"https://api.github.com/users/andrehp/followers","following_url":"https://api.github.com/users/andrehp/following{/other_user}","gists_url":"https://api.github.com/users/andrehp/gists{/gist_id}","starred_url":"https://api.github.com/users/andrehp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrehp/subscriptions","organizations_url":"https://api.github.com/users/andrehp/orgs","repos_url":"https://api.github.com/users/andrehp/repos","events_url":"https://api.github.com/users/andrehp/events{/privacy}","received_events_url":"https://api.github.com/users/andrehp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-29T19:29:33Z","updated_at":"2016-04-12T18:22:00Z","closed_at":null,"body":"Hello,\r\n\r\nI'm doing some tests with clusters and to do so I have two instances of VerneMQ running on different machines.\r\n\r\nI was able to put them on the same cluster and test it is working properly, but I wasn't able to remove one node from the cluster correctly. The two machines are VerneMQChat@10.0.1.76 and VerneMQChat@10.0.1.23.\r\n\r\nFrom .76 I ran\r\n`sudo vmq-admin cluster join discovery-node=VerneMQChat@10.0.1.23`\r\nand the result was as expected.\r\n```\r\n+---------------------+-------+\r\n|        Node         |Running|\r\n+---------------------+-------+\r\n|VerneMQChat@10.0.1.23| true  |\r\n|VerneMQChat@10.0.1.76| true  |\r\n+---------------------+-------+\r\n```\r\n\r\nBut then I tried to remove the node .23 from the cluster from .76:\r\n```\r\nubuntu@ip-10-0-1-76:~$ sudo vmq-admin cluster leave node=VerneMQChat@10.0.1.23\r\nDone! Use -k to teardown and migrate existing sessions!\r\nubuntu@ip-10-0-1-76:~$ sudo vmq-admin cluster leave node=VerneMQChat@10.0.1.23 -k\r\nRPC to 'VerneMQChat@10.0.1.76' failed: timeout\r\n```\r\n\r\nThe result of status was still\r\n```\r\n+---------------------+-------+\r\n|        Node         |Running|\r\n+---------------------+-------+\r\n|VerneMQChat@10.0.1.23| true  |\r\n|VerneMQChat@10.0.1.76| true  |\r\n+---------------------+-------+\r\n```\r\n\r\nOnly when I stopped the instance on .23 by hand (killing it because stop isn't working) is that I got the output\r\n```\r\n+---------------------+-------+\r\n|        Node         |Running|\r\n+---------------------+-------+\r\n|VerneMQChat@10.0.1.23| false |\r\n|VerneMQChat@10.0.1.76| true  |\r\n+---------------------+-------+\r\n```\r\n\r\nAnd after running leave node again I got an error and then .23 disappeared from the list. But when I run vmq-admin cluster status on .76 (after restarting it) it still shows both nodes as active in the cluster.\r\n\r\nI then tried adding .23 back to the cluster, the command response was \"Done!\" but status doesn't reflect that and console.log has the output as follows:\r\n`2016-01-29 19:15:31.647 [warning] <0.7428.0>@vmq_cluster_com:loop:70 terminate due to remote_node_not_available`\r\n\r\nAlso, I wasn't able to find information about the -k flag for cluster leave. Does it migrate offline messages and queues to one of the other servers? I would really appreciate a way of removing a node from the cluster and still having all the information on one of the other nodes, particularly the messages queued to offline users."},"comment":{"url":"https://api.github.com/repos/erlio/vernemq/issues/comments/209040954","html_url":"https://github.com/erlio/vernemq/issues/82#issuecomment-209040954","issue_url":"https://api.github.com/repos/erlio/vernemq/issues/82","id":209040954,"user":{"login":"dergraf","id":155396,"avatar_url":"https://avatars.githubusercontent.com/u/155396?v=3","gravatar_id":"","url":"https://api.github.com/users/dergraf","html_url":"https://github.com/dergraf","followers_url":"https://api.github.com/users/dergraf/followers","following_url":"https://api.github.com/users/dergraf/following{/other_user}","gists_url":"https://api.github.com/users/dergraf/gists{/gist_id}","starred_url":"https://api.github.com/users/dergraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dergraf/subscriptions","organizations_url":"https://api.github.com/users/dergraf/orgs","repos_url":"https://api.github.com/users/dergraf/repos","events_url":"https://api.github.com/users/dergraf/events{/privacy}","received_events_url":"https://api.github.com/users/dergraf/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T18:22:00Z","updated_at":"2016-04-12T18:22:00Z","body":"@ioolkos they are in the code https://github.com/erlio/vmq_server/blob/master/src/vmq_server_cli.erl#L122-L131 ;)"}}