简体   繁体   中英

Running consul-master servers on ECS Fargate

Currently, I have 3 consul-master servers, one as the leader and the other two as the followers. All 3 consul servers are running on ec2 instances. Here is the sample architecture diagram: 在此处输入图像描述

I have already moved my core application with consul-client-agent on ECS fargate. consul client agent will run as the sidecar container in the ECS fargate task.

Now I am wondering, If I can run these consul-master EC2 servers on AWS ECS Fargate ?

If so, what might be the possible setup? will it be the same ecs cluster of core application but different ECS Service for consul server? or, will it be a completely different ecs cluster?

If I understand you correctly you want to transfer your consul master and 2 followers to ECS in Fargate tasks running in services. If that is what you meant you can either:

  1. Manually search the IP and join the followers and agents to the Consul cluster using the IP of the Fargate task with the main Consul server (must be in awsvpc mode if using private IP addresses)

  2. Using CloudFormation put a load balancer in front of the leader then you can join the agents and 2 consul followers to the cluster by using the load balancers DNS name. You need to make a load balancer listener that listens on port 8301 (SERF port) with protocol TCP_UDP and fowards traffic to a target group with the same port and with the same protocol.

See my post as a reference for option 2:

How can I join a Consul agent to a Consul cluster via a Consul server running in a different Fargate task with CloudFormation?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM