I find the consul catalog command to be lacking for my needs, and I’m wondering if its possible to add columns to get extra data like actual instance name or tags? Perhaps can the instance register itself as multiple names or aliases? Not sure, so I’d love to know if there’s a way to do more with this.
[ec2-user@ip-10-1-0-78 ~]$ consul catalog nodes
Node ID Address DC
i-00190d5040e703f9b 5b3f8270 10.1.128.12 ap-southeast-2
i-025362e0cdd0b7131 3057bcf6 10.1.0.133 ap-southeast-2
i-03e23243b90a6fe29 d8b46ec5 10.1.0.138 ap-southeast-2
i-05447c172cd3378f7 9f8da777 10.1.0.139 ap-southeast-2
i-089bf3f2b302d137d 865645ed 10.1.0.140 ap-southeast-2
Hi @queglay you can get more information if you use the flag -detailed
. But to gather the most information we recommend using the API, more specifically the catalog node endpoint.
Below is an example of using the -detailed
flag.
consul catalog nodes -detailed
Node ID Address DC TaggedAddresses Meta
consul_server_0 0008b15f-c876-3ac3-8da1-6250da4aec96 10.5.0.2 dc1
consul_server_1 cd8bd8f6-2312-68c8-693c-a2863bf043c4 10.5.0.3 dc1
consul_server_2 d4ab9981-11e1-7f2e-0bbc-9261cc5df178 10.5.0.4 dc1
frontend-0 f47691d5-078a-5df0-bdee-ecc84350b8c0 10.5.0.5 dc1 lan=10.5.0.5, lan_ipv4=10.5.0.5, wan=10.5.0.5, wan_ipv4=10.5.0.5 consul-network-segment=
payments0 c704691e-ac94-facd-4e34-481391eecb33 10.5.0.9 dc1 lan=10.5.0.9, lan_ipv4=10.5.0.9, wan=10.5.0.9, wan_ipv4=10.5.0.9 consul-network-segment=
product-api0 014c843f-8e7d-4b18-78f6-46b11927e542 10.5.0.7 dc1 lan=10.5.0.7, lan_ipv4=10.5.0.7, wan=10.5.0.7, wan_ipv4=10.5.0.7 consul-network-segment=
product-db-0 e52aad0c-f4b8-add9-5037-babb7db987c7 10.5.0.8 dc1 lan=10.5.0.8, lan_ipv4=10.5.0.8, wan=10.5.0.8, wan_ipv4=10.5.0.8 consul-network-segment=
public-api-0 97ee69d9-91d1-6004-4143-b38b5f863656 10.5.0.6 dc1 lan=10.5.0.6, lan_ipv4=10.5.0.6, wan=10.5.0.6, wan_ipv4=10.5.0.6 consul-network-segment=
1 Like
Interesting. My nodes register “Node” as the instance id, which is probably with the bundled implementation of consul in the old vault reference architecture on github. Still -detailed doesn’t quite get me there. Maybe If I could customise the “Meta” column then that might get me there.
[ec2-user@ip-10-1-0-69 server]$ consul catalog nodes -detailed
Node ID Address DC TaggedAddresses Meta
i-010434e6fb7e79e6c 5c81e5fb-4f1c-24fc-a56e-87467190926b 10.1.0.142 ap-southeast-2 lan=10.1.0.142, lan_ipv4=10.1.0.142, wan=10.1.0.142, wan_ipv4=10.1.0.142 consul-network-segment=
i-047a6584f8eb6dba2 4949b91b-2683-334e-2480-4fabf03352ba 10.1.0.135 ap-southeast-2 lan=10.1.0.135, lan_ipv4=10.1.0.135, wan=10.1.0.135, wan_ipv4=10.1.0.135 consul-network-segment=
i-048a0a9f6e2453eac e1e4e142-0c34-ed4a-9fc3-ccab6c9dc720 10.1.0.136 ap-southeast-2 lan=10.1.0.136, lan_ipv4=10.1.0.136, wan=10.1.0.136, wan_ipv4=10.1.0.136 consul-network-segment=
i-090bfb55341f531ac 4104925c-faa9-10fd-8a98-4dbabe692bbb 10.1.0.138 ap-southeast-2 lan=10.1.0.138, lan_ipv4=10.1.0.138, wan=10.1.0.138, wan_ipv4=10.1.0.138 consul-network-segment=
i-09f0dd3a0344b4c5e 3d463592-aa4c-05a4-5fc3-d908c96ee841 10.1.0.133 ap-southeast-2 lan=10.1.0.133, lan_ipv4=10.1.0.133, wan=10.1.0.133, wan_ipv4=10.1.0.133 consul-network-segment=
i-0e80090279bda4af1 3c563c33-5881-6562-3f8d-5a742485063e 10.1.0.69 ap-southeast-2 lan=10.1.0.69, lan_ipv4=10.1.0.69, wan=10.1.0.69, wan_ipv4=10.1.0.69 consul-network-segment=
i-0edf346ef9a77538f c123451c-86fd-9913-4b2e-944720972f64 10.1.0.132 ap-southeast-2 lan=10.1.0.132, lan_ipv4=10.1.0.132, wan=10.1.0.132, wan_ipv4=10.1.0.132 consul-network-segment=