I have 2 different HashiCorp Consul clusters (lets call them cluster A and cluster B) running on different hosts.
My Python app is running on a host which I already installed on 1 client agent configured to cluster A and I want my app will be able to send requests to cluster B also (somehow distinguish between the 2 agents)
Is it possible to install a second client agent (configured to cluster B) on that same host? and if so, how it can be done? Will I just need to change to a different port? Can't find documentation for that use case.
Any possible solutions will be helpful, Thanks!
Consul allows you to configure the ports for your agents so they don't conflict on a single host. I was able to do so in a file named:
With contents:
I then started the agent with the following command:
I then had two agents on the same machine seen via command line tool
ps x(output abbreviated):Lastly I used the
--http-addr=option specied here to speak to the non-default port agent and clustered them together on the same host just to see if it was possible, sure was:Therefore, I'm fairly confident you can run two agents on the same hosts with the proper settings in a configuration file for each agegnt (or use defaults on one and a configuration file on the other).