问题
I've just created a elasticsearch cluster in GCE using "Click to Deploy", but I can only access it by using a tunnel. This is not a choice in my case, since there are other developers that I don't want to give gcloud access to. I would like to open port 9200 for elasticsearch so they could just connect to it by IP address and not with tunnel.
How can I achieve this?
回答1:
Open port 9200 in your GCE firewall for the elasticsearch instances. elasticsearch instances created by "Click to Deploy" have the "elasticsearch" tag defined, so, you can use the following command:
gcloud compute --project PROJECT firewall-rules create allow-elasticsearch \
--allow TCP:9200 \
--target-tags elasticsearch
Check this answer for additional information on GCE firewall configuration.
--edit to correct misspelling of elasticsearch
来源:https://stackoverflow.com/questions/29561826/opening-open-gce-firewall-on-elasticsearch-instances-for-external-connection