2016-04-26 73 views
0

嗨,我一直在試圖建立一個ejabberd集羣。 然而在試圖從節點2加入到node1,我得到一個錯誤說Erlang - Ejabberd join_cluster錯誤:{no_ping ...}

在節點2:

# ejabberdctl join_cluster [email protected]<internal ip of node1> 
Error: {no_ping,'[email protected]<internal ip of node1>'} 

我可以明確的ping節點1,由節點。

這兩個節點都位於AWS的同一區域。 我曾嘗試允許節點1上的所有流量。 兩者都具有相同的.erlang.cookie。

不知道爲什麼我繼續得到這個錯誤。

# ejabberdctl status 
The node '[email protected]<internal ip of node1>' is started with status: started 
ejabberd 16.03.107 is running in that node 

# netstat -lnptu 
tcp  0  0 0.0.0.0:4369   0.0.0.0:*    LISTEN  2190/epmd  
tcp  0  0 0.0.0.0:5269   0.0.0.0:*    LISTEN  2233/beam.smp 
tcp  0  0 0.0.0.0:22    0.0.0.0:*    LISTEN  975/sshd   
tcp  0  0 0.0.0.0:52189   0.0.0.0:*    LISTEN  2233/beam.smp 
tcp  0  0 0.0.0.0:5280   0.0.0.0:*    LISTEN  2233/beam.smp 
tcp  0  0 0.0.0.0:5222   0.0.0.0:*    LISTEN  2233/beam.smp 
tcp6  0  0 :::4369     :::*     LISTEN  2190/epmd  
tcp6  0  0 :::22     :::*     LISTEN  975/sshd   

ejabberdctl.cfg在node1:

loglevel: 4 

log_rotate_size: 10485760 
log_rotate_date: "" 
log_rotate_count: 1 

log_rate_limit: 100 





hosts: 
    - "<external ip of node1>" 



listen: 
    - 
    port: 5222 
    module: ejabberd_c2s 
    max_stanza_size: 65536 
    shaper: c2s_shaper 
    access: c2s 
    - 
    port: 5269 
    module: ejabberd_s2s_in 


    - 
    port: 5280 
    module: ejabberd_http 
    request_handlers: 
     "/websocket": ejabberd_http_ws 
    web_admin: true 
    http_bind: true 
    captcha: true 









auth_method: internal 
















shaper: 
    normal: 1000 

    fast: 50000 

max_fsm_queue: 1000 

acl: 

    local: 
    user_regexp: "" 


    loopback: 
    ip: 
     - "127.0.0.0/8" 



access: 
    max_user_sessions: 
    all: 10 
    max_user_offline_messages: 
    admin: 5000 
    all: 100 
    local: 
    local: allow 
    c2s: 
    blocked: deny 
    all: allow 
    c2s_shaper: 
    admin: none 
    all: normal 
    s2s_shaper: 
    all: fast 
    announce: 
    admin: allow 
    configure: 
    admin: allow 
    muc_admin: 
    admin: allow 
    muc_create: 
    local: allow 
    muc: 
    all: allow 
    pubsub_createnode: 
    local: allow 
    register: 
    all: allow 
    trusted_network: 
    loopback: allow 




language: "en" 







modules: 
    mod_adhoc: {} 
    mod_announce: # recommends mod_adhoc 
    access: announce 
    mod_blocking: {} # requires mod_privacy 
    mod_caps: {} 
    mod_carboncopy: {} 
    mod_client_state: {} 
    mod_configure: {} # requires mod_adhoc 
    mod_disco: {} 
    mod_irc: {} 
    mod_http_bind: {} 
    mod_last: {} 
    mod_muc: 
    host: "[email protected]@" 
    access: muc 
    access_create: muc_create 
    access_persistent: muc_create 
    access_admin: muc_admin 
    mod_muc_admin: {} 
    mod_offline: 
    access_max_user_messages: max_user_offline_messages 
    mod_ping: {} 
    mod_privacy: {} 
    mod_private: {} 
    mod_pubsub: 
    access_createnode: pubsub_createnode 
    ignore_pep_from_offline: true 
    last_item_cache: false 
    plugins: 
     - "flat" 
     - "hometree" 
     - "pep" # pep requires mod_caps 
    mod_roster: {} 
    mod_shared_roster: {} 
    mod_stats: {} 
    mod_time: {} 
    mod_vcard: 
    search: false 
    mod_version: {} 



allow_contrib_modules: true 
+0

你可以檢查'EPMD -names'上兩者兼而有之?另外,使用'epmd -d'或'epmd -d -d -d'(增加調試級別)來查殺'epmd'並以調試模式啓動可能會幫助您發現問題。 – Amiramix

+0

這就是我得到的epmd -names:epmd:啓動並在端口4369上運行的數據: 名稱ejabberd在端口41198 –

+0

請同時啓用。 'epmd'是分別在每個節點上運行的守護進程,負責建立和維護節點之間的連接。它看起來像node1接受來自node2的請求,所以需要查看另一個節點上發生了什麼。 – Amiramix

回答

0

似乎你缺少CONFIGRATION在ejabberdctl.cfg更改以下行中的ejabberdctl:

[email protected]<internal IP of node1> 

node1上ejabberd.yml .cfg文件 -

#INET_DIST_INTERFACE=127.0.0.1 to 

INET_DIST_INTERFACE=104.10.120.122 (whatever your host public ip) 

和開放二郎控制檯並運行以下命令 -

net_adm:ping('[email protected]'). # your node 

如果它將返回現在的乒乓球,你可以做ejabberd節點之間的集羣。 運行以下命令來使支持羣集 ejabberdctl join_cluster「ejabberd @ ejabberd1」

1

我面臨着同樣的問題,而在EC2上設置Ejabberd集羣。這裏的解決方案供參考

確保以下端口內部/私有網絡

  • 5222開放 - XMPP客戶端連接
  • 5280 - 門戶網站
  • 4369 - EPMD
  • 5269 - S2S
  • 4200 - 4210節點通信
  • 也允許內部ping(icmp數據包)以防萬一。

接下來在ejabberdctl.cfg文件中設置FIREWALL_WINDOW選項,如下所示。這將設置Erlang使用定義的端口範圍,而不是動態的端口用於端口通信。 (參見ejabberdctl.cfg)

FIREWALL_WINDOW=4200-4210

併爲您Ejabberd節點如使用全節點名稱:[email protected]