aerospike/aerospike-client-java

Aerospike Cluster Peer Invalid Node Docker

KalshuCodes opened this issue · 3 comments

I have created a Node of 3 Aerospike Server using Docker and they are internally connected.
I passed the host details of one server to Aerospike Client but while it gets initialized and calls to the Server to get Peer Nodes
The Peer Nodes are returning the Docker Host and Ports ( 172.17.0.2:3000-3002 , 172.17.0.3:3000-3002, 172.17.0.4:3000-3002 ) while the local host and ports are
127.0.0.1:3000-3002, 127.0.0.1:4000-4002, 127.0.0.1:6000-6002 respectively

Due to this I am unable to run Secondary Indexes as they are only giving Partial results as the Peer initialization response coming from Docker gave Docker hosts and ports and the node validator is giving exception and adding it to invalidHosts.

Can anyone provide support on how can I convert the Docker ports to local ports so that I can use them as my peers.

1- Host with 2 network interfaces, x.x.x.x and y.y.y.y, with x.x.x.x for clients within the same subnet/DC (private IP) and y.y.y.y for clients in a different subnet/DC (public IP). The IP address y.y.y.y is not mapped over NAT:

service {
address x.x.x.x
address y.y.y.y
access-address x.x.x.x
alternate-access-address y.y.y.y
}
@BrianNichols
I was talking about using this but I have different ports for address x.x.x.x ( Docker ) and y.y.y.y ( Localhost )
It's like x.x.x.x would be my local docker address and port 3000 which would be used by other docker applications under same subnet and y.y.y.y would be my localhost address which I would need to send it to the Java Client, now the service on localhost needs port 4000 so how do I make the configuration satisfying this.

I am not a Docker networking expert but I think (and certainly hope) that you will find answers on the following document: https://docs.aerospike.com/deploy_guides/docker/networking/index.html (which is referenced on this blog post: https://medium.com/aerospike-developer-blog/how-do-i-get-a-2-node-aerospike-cluster-running-quickly-in-docker-without-editing-a-single-file-1c2a94564a99)