I need some little explanations about boundary

Hello guys,
im a student in computer science and i don’t understand why boundary use 3 ports 9200/9201/9202 ?
actually, i can connect to a redis service(only exposed for boundary on docker) with all these 3 ports with commands:

  • boundary connect -exec redis-cli -target-id ttcp_rt6noReMNj – -p 9200
  • boundary connect -exec redis-cli -target-id ttcp_rt6noReMNj – -p 9201
  • boundary connect -exec redis-cli -target-id ttcp_rt6noReMNj – -p 9202

so if someone know why these 3 work fine, that would be cool.
ty in advance for ur explanation

I don’t know the ins and outs of boundary but here’s some details from boundary dev:

Listener 1: tcp (addr: "", max_request_duration: "1m30s", purpose: "api")
Listener 2: tcp (addr: "", max_request_duration: "1m30s", purpose: "cluster")
Listener 3: tcp (addr: "", max_request_duration: "1m30s", purpose: "proxy")

9200 - api
9201 - cluster
9202- proxy

1 Like

ok thanks, i understand better now, i do little changes about that.
i said in my first post that i can connect to redis but it was a mistake.
So for the moment it would seem that in can authenticate to the worker (on default port → 9200)but when im on the worker i can’t reach redis

My errors maybe come from the errors that i got when i launch my boundary server but idk:

ok the connectio refused was because all my config run into docker so i need to expose 6379 port on boundary server to permit worker to have an access but now i get another error from redis:

Error: Connection reset by peer

This command is passing -p 9200 through to redis-cli, that’s not used by the boundary command. Boundary connect always uses a dynamic port allocated for the one session.

The documentation is a little dense, and every word is key. Reread it carefully and I think you’ll understand: Connect to Target | Boundary by HashiCorp

1 Like

Yeah ty for your precision but now my problem has changed, it’s little bit different:
my host redis is binded via boundary with the docker hostname redis and i can connect to a boundary session but i can’t acces to my redis service throught boundary’s worker

By default the redis-cli command will look on for a connection. At the moment, I can’t see a way to feed the port you get back from boundary into the exec argument, but I’ll ask internally and see what I can find.

What you can do is initiate your connection to the target, then run redis-cli -p <port_from_boundary> and you’ll get a successful connection.



Update: boundary connect -exec redis-cli -target-id $target_id -- -h {{boundary.ip}} -p {{boundary.port}} is going to do exactly what you’re looking for.