- Install ejabberd on two ec2 instance. for me is
> ip-11-248-167-196
> ip-11-236-190-210 - add these port to ec2 instance’s security group.
> 5222
> 5223
> 4369
> 5269
> 5280
> 40000-40010 -
modify /usr/sbin/ejabberdctl [on both tow instances]
add this at head of /usr/sbin/ejabberdctl: FIREWALL_WINDOW=40000-40010
-
modify /user/sbin/ejabberd [on both tow instances]
add admin user —> {acl, admin, {user, “yafeng”, “jabber.example.com”}}.
specify hostname —> {hosts, [“jabber.example.com”]}. -
register admin user on [ip-11-248-167-196] —> sudo ejabberdctl register yafeng jabber.example.com 123456
-
replicate mniea database from [ip-11-248-167-196] to [ip-11-236-190-210]. This operation should be done on [ip-11-236-190-210]
- open ejabberd debug erlang shell -> sudo ejabberdctl debug
- replicate table schema:
%this is erlang code.
FirstNode = ‘ejabberd@ip-11-248-167-196’,
mnesia:stop(),
mnesia:delete_schema([node()]),
mnesia:start(),
mnesia:change_config(extra_db_nodes, [FirstNode]),
mnesia:change_table_copy_type(schema, node(), disc_copies).
- replicate table contents:
% this is erlang code 2.
mnesia:add_table_copy(pubsub_node,node(),disc_copies),
mnesia:add_table_copy(muc_registered,node(),disc_copies),
mnesia:add_table_copy(pubsub_state,node(),disc_copies),
mnesia:add_table_copy(muc_room,node(),disc_copies),
mnesia:add_table_copy(motd_users,node(),disc_copies),
mnesia:add_table_copy(vcard_search,node(),disc_copies),
mnesia:add_table_copy(pubsub_index,node(),disc_copies),
mnesia:add_table_copy(acl,node(),disc_copies),
mnesia:add_table_copy(motd,node(),disc_copies),
mnesia:add_table_copy(roster_version,node(),disc_copies),
mnesia:add_table_copy(last_activity,node(),disc_copies),
mnesia:add_table_copy(roster,node(),disc_copies),
mnesia:add_table_copy(irc_custom,node(),disc_copies),
mnesia:add_table_copy(passwd,node(),disc_copies),
mnesia:add_table_copy(privacy,node(),disc_copies),
mnesia:add_table_copy(pubsub_subscription,node(),disc_copies),
mnesia:add_table_copy(config,node(),disc_copies).
mnesia:add_table_copy(pubsub_item,node(),disc_only_copies),
mnesia:add_table_copy(private_storage,node(),disc_only_copies),
mnesia:add_table_copy(offline_msg,node(),disc_only_copies),
mnesia:add_table_copy(vcard,node(),disc_only_copies).
mnesia:add_table_copy(muc_online_room,node(),ram_copies),
mnesia:add_table_copy(temporarily_blocked,node(),ram_copies),
mnesia:add_table_copy(iq_response,node(),ram_copies),
mnesia:add_table_copy(session,node(),ram_copies),
mnesia:add_table_copy(session_counter,node(),ram_copies),
mnesia:add_table_copy(captcha,node(),ram_copies),
mnesia:add_table_copy(s2s,node(),ram_copies),
mnesia:add_table_copy(route,node(),ram_copies),
mnesia:add_table_copy(pubsub_last_item,node(),ram_copies),
mnesia:add_table_copy(bytestream,node(),ram_copies),
mnesia:add_table_copy(reg_users_counter,node(),ram_copies).
- ctrl+c,ctrl+c quit erlang shell, this may take a minute.
-
check your cluster is ready or not
user xmpp client(for me is RooyeeMessenger) login to [ip-11-248-167-196],[ip-11-236-190-210], if both of them can login. congratulations, you built a ejabberd cluster succ.
-
Addtionally create a loadbalancer in ec2 dashbord, attach these two instance to it.Then transfer LB port 5222,5223,4369,5269,5280 to back-end instances.
-
Reference
Ejabberd Cluster Based on EC2 Ubuntu Instance & LoadBalancer
相關文章
- LoadBalancer for bare metal Kubernetes cluster-MetalLB
- How to Convert a Single-Instance ASM to Cluster ASM [ID 452758.1]ASM
- Debin based Linux system(Ubuntu)包管理工具LinuxUbuntu
- Linux下ejabberd安裝配置Linux
- zt_real application cluster恢復為單例項single instanceAPP單例
- LoadBalancer負載均衡負載
- day03-loadbalancer
- Linux下ejabberd開機自啟(CentOS)LinuxCentOS
- 如何完全刪載與清除oracle 10grac(rhel4) cluster_db_instanceOracle 10g
- Get Started with EC2
- 05-LoadBalancer負載均衡負載
- 開發社交應用的利器——Ejabberd一瞥
- Udemy AWS SAA - EC2
- 微服務負載均衡器 LoadBalancer微服務負載
- Akka-CQRS(2)- 安裝部署cassandra cluster,ubuntu-16.04.1-LTS and MacOS mojaveUbuntuMac
- 亞馬遜EC2如何註冊使用亞馬遜
- 獲得Azure訂閱LoadBalancer的指令碼指令碼
- instance和clientclient
- Oracle database instanceOracleDatabase
- The Instance and the Database (285)Database
- STATUS OF ORACLE INSTANCEOracle
- redis.cluster/memcached.cluster/wmware esxiRedis
- k8s loadbalancer與ingress實踐K8S
- 聊聊spring-cloud-kubernetes-client-loadbalancerSpringCloudclient
- MySQL ClusterMySql
- Cluster for MySQLMySql
- PostgreSQL Cost Based Vacuum探秘SQL
- 建立Function-Based IndexesFunctionIndex
- How to restore ASM based OCRRESTASM
- MySQL NDB Cluster,Galera Cluster和Percona XtraDB Cluster優缺點總結MySql
- AWS EC2 上安裝 Docker 的示例Docker
- LoadBalancer在kubernetes架構下的實踐架構
- 理解Database和InstanceDatabase
- Monitoring an SAP instance
- BIEE Instance OracleBIPresentat DownOracle
- Overview of Instance and Crash RecoveryView
- Oracle instance解釋Oracle
- 遊戲模擬——Position based dynamics遊戲