Open hanoisteve opened 5 years ago
This was on my side. I had not started the ServerMain.
After doing ./gradlew idea User needs to reopen the project using the generated .ipr file.
This is clear for those who have used this command before but many of us have not.
After checking that Server is running. I am still seeing connection refused. I have tried various different ports without luck. Is this and Envoy issue or a docker issue. In either case, from a practical perspective this is stopping me from running the demo.
Update: On a Mac running envoy with host network mode docker discards the published port numbers so that was causing the problem connecting, plus the ports were not published so not visible at all on a Mac. I am at least able to get envoy up and running with the following change to start-envoy.sh
sudo docker run -it --rm --name envoy -p 9901:9901 -p 10000:10000 \ -v "$(pwd)/reservation_service_definition.pb:/data/reservation_service_definition.pb:ro" \ -v "$(pwd)/envoy-config.yml:/etc/envoy/envoy.yaml:ro" \ envoyproxy/envoy
However, I am not seeing that the RPC service is reached. Listing the reservations is now empty. Could you please comment on how I can get this demo running on a Mac with current envoy version?
I was able to get it working reservation creation working on the MAC with the following command:
sudo docker run -it --rm --name envoy -p 15000:15000 -p 10000:10000 -v "$(pwd)/reservation_service_definition.pb:/data/reservation_service_definition.pb:ro" -v "$(pwd)/envoy-config.yml:/etc/envoy/envoy.yaml:ro" envoyproxy/envoy
This publishes the port admin and port number but not the host port number 530000 where the Java server is running. I also removed the hosts network mode because this prevents publishing of the port. Here is the updated yaml: Note that I had to use host.docker.internal for the backend cluster rather than 127.0.0.1 due to visibility of the cluster.
access_log_path: /tmp/admin_access.log address: socket_address: { address: 0.0.0.0, port_value: 15000 }
static_resources: listeners:
name: main-listener address: socket_address: { address: 0.0.0.0, port_value: 10000 } #2 filter_chains:
config: proto_descriptor: "/data/reservation_service_definition.pb" #4 services: ["reservations.v1.ReservationService"] #5 print_options: add_whitespace: true always_print_primitive_fields: true always_print_enums_as_ints: false preserve_proto_field_names: false #6
clusters:
I am able to add reservations ok, but reservation list is returning empty. coffee:Downloads Steven$ curl -v -X GET http://localhost:10000/v1/reservations Note: Unnecessary use of -X or --request, GET is already inferred.
GET /v1/reservations HTTP/1.1 Host: localhost:10000 User-Agent: curl/7.54.0 Accept: /
< HTTP/1.1 200 OK < content-type: application/grpc < grpc-status: 0 < x-envoy-upstream-service-time: 30 < date: Thu, 16 May 2019 11:28:20 GMT < server: envoy < transfer-encoding: chunked <
Hi, sorry for the late response, I'll look into this later!
could you issue a PR with the changes you made, I don't have a MAC but I can ask colleagues to test it on theirs. I would like to get it working on MAC, Linux and maybe windows as well :).
Hello. What version did you use to run envoy? I'm trying "envoyproxy/envoy:v1.21.0" docker image and get an error below.
Protobuf message (type envoy.config.bootstrap.v3.Bootstrap reason INVALID_ARGUMENT:(static_resources.clusters[0]) hosts: Cannot find field.) has unknown fields
Can you help me? Thanks.
Hello @klebersouza87 the command I used appeared to be:
docker run -it --rm --name envoy --network="host" \
-v "$(pwd)/envoy-config.yml:/etc/envoy/envoy.yaml:ro" \
envoyproxy/envoy
This was done at 2018-11-04, so if possible, I would look for an envoy image around that time.
https://hub.docker.com/r/envoyproxy/envoy/tags?ordering=-last_updated
random old image: docker pull envoyproxy/envoy:0cb60a38150212c1c64cc3f75b8f814e918d4c47
With this image I can run envoy container, but ports is not mapped. Did you have this problem? I'm using your project without any changes.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 02c35de95c78 envoyproxy/envoy:0cb60a38150212c1c64cc3f75b8f814e918d4c47 "/bin/bash" 35 seconds ago Up 34 seconds envoy
Hi, sorry for the slow response. I was busy this weekend.
The ports are indeed not mapped that way I guess. In this file I see that I use --network="host" which means it does not get a separate network but just runs on the host net, so it would be accessible on localhost without port mapping. Not sure if this is still supported due to security, but you could try that.
https://github.com/toefel18/transcoding-grpc-to-http-json/blob/master/start-envoy.sh
# check if sudo is required to run docker
if [ "$(groups | grep -c docker)" -gt "0" ]; then
echo "Envoy will run at port 51051 (see envoy-config.yml)"
docker run -it --rm --name envoy --network="host" \
-v "$(pwd)/reservation_service_definition.pb:/data/reservation_service_definition.pb:ro" \
-v "$(pwd)/envoy-config.yml:/etc/envoy/envoy.yaml:ro" \
envoyproxy/envoy
else
echo "you are not in the docker group, running with sudo"
echo "Envoy will run at port 51051 (see envoy-config.yml)"
sudo docker run -it --rm --name envoy --network="host"\
-v "$(pwd)/reservation_service_definition.pb:/data/reservation_service_definition.pb:ro" \
-v "$(pwd)/envoy-config.yml:/etc/envoy/envoy.yaml:ro" \
envoyproxy/envoy
fi
Im on Mac OS 10.13.6 and I get connection refused when I do any request against the services. I have tried changing the listener port number but still get error.
curl: (7) Failed to connect to localhost port 51051: Connection refused.
I still get this error after checking port etc. Im guessing this might be a docker thing or changes in the way envoy handles GRPC but not sure. Can someone clarify how connection refused occurs and how I can troubleshoot this?