- 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
- day03-loadbalancer
- LoadBalancer負載均衡負載
- vertx instance
- GPU InstanceGPU
- 05-LoadBalancer負載均衡負載
- Get Started with EC2
- 聊聊spring-cloud-kubernetes-client-loadbalancerSpringCloudclient
- 3.2.1 Mounting a Database to an InstanceDatabase
- 3.1.5.6 Forcing an Instance to Start
- Akka-CQRS(2)- 安裝部署cassandra cluster,ubuntu-16.04.1-LTS and MacOS mojaveUbuntuMac
- 微服務負載均衡器 LoadBalancer微服務負載
- Udemy AWS SAA - EC2
- C++ instance的使用C++
- RMAN Duplicate RAC to Single Instance
- Physically Based Rendering
- LoadBalancer在kubernetes架構下的實踐架構
- k8s loadbalancer與ingress實踐K8S
- 3.1.5.2 Starting an Instance, and Mounting and Opening a DatabaseDatabase
- Property [title] does not exist on this collection instance
- redis.cluster/memcached.cluster/wmware esxiRedis
- cluster meet
- MySQL ClusterMySql
- A timer based on timerfd and epoll
- Based UE_Project NotesProject
- Redis Cluster原理Redis
- cilium Cluster Mesh
- 部署Kubernetes Cluster
- Redis Cluster 3.0Redis
- redis cluster 搭建Redis
- Amazon EC2 + Tomcat + Ngnix + Godaddy 配置HTTPSTomcatGoHTTP
- akka-typed(6) - cluster:group router, cluster-load-balancing
- Ruby class_eval and instance_eval notes
- LGWR (ospid: 29534): terminating the instance due to error 4021Error
- NSCFType unrecognized selector sent to instance等問題Zed
- TypeError: The ‘compilation‘ argument must be an instance of Compilation 報錯Error
- 【Redis】redis-cluster到redis-cluster的快速複製Redis
- Redis-cluster命令 cluster info 引數資訊解釋Redis
- Network config of Openwrt based ESXI Env