cescoffier / vertx-microservices-examples

Vert.x Microservices examples
29 stars 7 forks source link

Discovering working but not the example #6

Closed davidaparicio closed 7 years ago

davidaparicio commented 8 years ago

Hi @cescoffier !

The example is working well in my local machine. Before to test to Kubernetes (Google Compute Engine), I made containers and I launched, locally, them with docker-compose. The logs and the discovery page seem everything is working well but the main application doesn't work.... Do you have a idea, why is it not working ? Because unfortunately, I have any clue..

screen shot 2016-09-08 at 3 08 37 pm

The discovery page: screen shot 2016-09-08 at 3 08 20 pm

The docker-compose log, and Hazelcast discovery: screen shot 2016-09-08 at 3 08 54 pm

Finally the circuit-breaker: screen shot 2016-09-08 at 3 14 31 pm

Best regards, David

davidaparicio commented 8 years ago

You can find the code in my repository: https://github.com/davidaparicio/vertx-microservices-examples

cescoffier commented 8 years ago

Hi, yes, I think I have an idea.

The service are exposed on localhost:808x, which in your environment may be an issue because they are not deployed on the same machine.

davidaparicio commented 8 years ago

So true, I have not even seen this ineptitude -_-'

Now, I have a question about the same system under Kubernetes.. I think this system of Discover is the best way to communicate between containers/hosts on the cloud (like Google Compute Engine). It is the same like Openshift ? (:

Because, my last step will be to use Kubernetes Cluster Federation ^^

cescoffier commented 8 years ago

We provide an extension to the discovery service to use Kubernetes services and import them "automatically" - check http://vertx.io/docs/vertx-service-discovery-bridge-kubernetes/java/

With this bridge, you don't have to publish your services as you need to declare them into Kubernetes. The bridge will then retrieve the services from Kubernetes.

davidaparicio commented 7 years ago

Hi @cescoffier !

I followed the "Run the demos in Openshift Origin (v3)" chapter

Instead of

docker rm origin
sudo docker run -d --name "origin" \
        --privileged --pid=host --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
        openshift/origin start
docker logs -f origin

I used jimmidyson/minishift

I run mvn clean package docker:build fabric8:json fabric8:apply -Popenshift without problem.

The dashboard is in the same as yours (I grouped A and B only for the screenshot)

screen shot 2016-10-10 at 4 24 07 pm

But the discovery isn't working (bug with Kubernetes)

screen shot 2016-10-10 at 4 26 09 pm

Oct 10, 2016 2:13:13 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes discovery configured for namespace: vertx-microservice-example-aggregation-http
Oct 10, 2016 2:13:13 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes url: https://172.30.0.1:443
Oct 10, 2016 2:13:13 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes discovery: Bearer Token { eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJ2ZXJ0eC1taWNyb3NlcnZpY2UtZXhhbXBsZS1hZ2dyZWdhdGlvbi1odHRwIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tejNsam4iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjkyNDYxMDdjLThlZjMtMTFlNi04MWJiLTYyZDM5MWNkMTNkZSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDp2ZXJ0eC1taWNyb3NlcnZpY2UtZXhhbXBsZS1hZ2dyZWdhdGlvbi1odHRwOmRlZmF1bHQifQ.M-oLdMaBNKxvPpdzDOov5l-0ob49FajvEFnuzXhmFe3Tlv59qnN8bDPjfIUNDvmvQlbVMHGsRx9HwHj9RrFswe-gjGpIy1uRaynQgYOyH1OJXc8uKvAgEgrZ6dRfVJ2o9qevat0J8M3Pfu_bClBmmEpoFOBfSyXgH9_z7Iuw6YeGsvh2JVP-obwyT1JwJq-n6n0zCD43oUvrMRlaEmS3R9lG5kaGZN2azcHwAHNrkn3SOzX32KOqYsmlosZDRvip4MBbGDg8dkqxYSHEVWQkKgnHOMfyoZXHkbqF_qvlyYveL5XnifRKGj7oUaUw4wDXRaYQNs-ZAkvll27Mf6hQZA }
Oct 10, 2016 2:13:13 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
SEVERE: Error while interacting with kubernetes

What I have to do to resolve this?

Annexe: I tested the service (like, http://c-vertx-microservice-example-aggregation-http.192.168.99.102.xip.io/?name=test it's working).

screen shot 2016-10-10 at 4 26 32 pm

screen shot 2016-10-10 at 4 26 41 pm

cescoffier commented 7 years ago

You need to add slf4j-api as a dependency to all projects.

davidaparicio commented 7 years ago

Okay, thanks a lot @cescoffier !!