Skip to content

Instantly share code, notes, and snippets.

@harekumar
Last active December 7, 2016 11:41
Show Gist options
  • Save harekumar/0b131d7cdd2bbfca38b70306c15c7083 to your computer and use it in GitHub Desktop.
Save harekumar/0b131d7cdd2bbfca38b70306c15c7083 to your computer and use it in GitHub Desktop.

Revisions

  1. harekumar revised this gist Dec 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ejabberd_15.04_cluster_setup.txt
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ 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.
    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.
  2. harekumar renamed this gist Dec 7, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. harekumar created this gist Dec 7, 2016.
    28 changes: 28 additions & 0 deletions cluster_setup.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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.

    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.