[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Pod unable to connect with service IP



The first pod (172.17.0.19) is behind the service (couchbase-cluster 172.30.16.145). I am trying to add second pod (172.17.0.20) to the cluster and executing these commands inside second pod. From the second pod, it is able to successfully access the first pod IP address.

# cluster-cli server-add --cluster=172.17.0.19:8091 --server-add=172.17.0.20
Server 172.17.0.20:8091 added.

Same case with curl, curling the pod IP address works, but not the service IP.
#curl http://172.30.16.145:8091
curl: (7) Failed to connect to 172.30.16.145 port 8091: Connection timed out

#curl http://172.17.0.19:8091
<!DOCTYPE HTML_PUBLIC ......

So connecting to the pod IP directly works fine.

Thanks
Vignesh


On Mon, Mar 6, 2017 at 9:14 AM, Marko Lukša <marko luksa gmail com> wrote:

Try connecting to the pod IP directly to see if the pod is accepting connections properly (check to make sure it's not binding only to 127.0.0.1).


On 06. 03. 2017 14:57, Vignesh M.P.N. wrote:
Thanks for the reply. There is some progress but not working yet. When I used the environment variable, it does resolve the Service IP address, but still unable to connect to host. Following is the error message I receive inside the pod.

Command executed: # cluster-cli server-add --cluster=$COUCHBASE_CLUSTER_SERVICE_HOST:8091

Unable to connect to host http://172.30.16.145:8091

Following are some relevant environment variables I saw inside the pod. The service name "couchbase-cluster"
COUCHBASE_CLUSTER_SERVICE_HOST=172.30.16.145
COUCHBASE_CLUSTER_PORT_8091_TCP_ADDR=172.30.16.145
COUCHBASE_CLUSTER_PORT_8091_TCP_PORT=8091
COUCHBASE_CLUSTER_PORT_SERVICE_PORT=8091
COUCHBASE_CLUSTER_PORT=tcp://172.30.16.145:8091
COUCHBASE_CLUSTER_SERVICE_PORT_HTTP_UI=8091
COUCHBASE_CLUSTER_PORT_8091_TCP=tcp://172.30.16.145:8091

I wonder why is it not able to connect to the service using the Service IP address. Any help is much appreciated.

Thanks
Vignesh


On Mon, Mar 6, 2017 at 6:54 AM, Marko Lukša <marko luksa gmail com> wrote:

On 06. 03. 2017 12:04, Vignesh M.P.N. wrote:
Is there any alternative approach on how I could refer to an existing service without using it Service IP?


If I understood correctly, you're connecting to "couchbase-master-service:8091". You should try connecting to the IP instead of the hostname. If your service is called "couchbase-master-service", you can obtain the IP from the COUCHBASE_MASTER_SERVICE_SERVICE_HOST environment variable (mind the double SERVICE!). The environment variable is available inside the pod.

M.

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]