Last active
December 7, 2016 11:41
-
-
Save harekumar/0b131d7cdd2bbfca38b70306c15c7083 to your computer and use it in GitHub Desktop.
Instruction to setup ejabberd 15.04 cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Let's say we need to join two node nodeA & nodeB. Then makesure both the node has the same erlang-cookies & basics ports are open | |
| i.e needed to communicate nodes internally. | |
| Steps: | |
| 1. Ensure all the node has the same erlang-cookies. | |
| 2. Now go to any one of the node let's say we wish to add NodeB to NodeA cluster. Then go to the NodeB & run the following command in debug mode i.e by running ./bin/ejabberdctl debug | |
| Node = NodeAName. | |
| net_adm:ping(Node). #==> Check if node can connect with each other. If the response is Pang abort & fix the issue first & then comeback. | |
| application:stop(ejabberd). | |
| application:stop(mnesia). | |
| mnesia:delete_schema([node()]). # Delete old schema | |
| application:start(mnesia). | |
| mnesia:change_config(extra_db_nodes, [Node]). | |
| mnesia:change_table_copy_type(schema, node(), disc_copies). | |
| spawn(fun() -> | |
| lists:foreach(fun(Table) -> | |
| Type = call(Node, mnesia, table_info, [Table, storage_type]), | |
| mnesia:add_table_copy(Table, node(), Type) | |
| end, mnesia:system_info(tables)--[schema]) | |
| end). | |
| application:start(ejabberd). | |
| After running all the above command successfully. You can check if the node has been added to the cluster or not by running | |
| mnesia:info() command. This should list all the clustered node under "running db nodes" key. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment