hi all
I have 2 nics on my ubuntu server, eth0 for private ip and eth1 for
public ip, and a loopback nic which is localhost, according to the guide
below:
there are mainly three settings for networking:
network.bind_host for bind
network.publish_host for communicate
network.host for above all
default binds itself to the 0.0.0.0 address, and I start the es without
changing the net config using wrappers:
root@es:~# /etc/init.d/elasticsearch start
Starting Elasticsearch...
Waiting for Elasticsearch......
running: PID:2967
root@es:~# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 127.0.0.1:32000 0.0.0.0:*
LISTEN 2969/java
tcp 0 0 0.0.0.0:9200 0.0.0.0:*
LISTEN 2969/java
tcp 0 0 0.0.0.0:9300 0.0.0.0:*
LISTEN 2969/java
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN 419/sshd
udp 0 0 0.0.0.0:54328
0.0.0.0:* 2969/java
and as the netstat shows, it really listens on 0.0.0.0:9200
then I uss curl to have a test, only works for public ip, not localhost nor
my private ip:
# curl -XGET 'http://122.x.x.x:9200/_cluster/health?pretty=true'
{
"cluster_name" : "graylog2orlogstash",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
curl localhost, and return the below error:
# curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'
http-equiv="Content-Type" CONTENT="text/html; charset=utf-8"> ERROR:
The requested URL could not be retrieved
ERROR
The requested URL could not be
retrieved
The following error was
encountered while trying to retrieve the URL: http://localhost:9200/_cluster/health?
Connection to 127.0.0.1 failed.
The system returned: (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is webmaster.
Generated Thu, 27 Sep 2012 08:03:40 GMT by xxx (squid/2.7.STABLE7)
curl my private ip, it hungs here, and I have to Crtl+c to stop it:
# curl -XGET 'http://192.168.1.234:9200/_cluster/health?pretty=true'
then, I make a change, I set the network.host to my private ip
192.168.1.234, and restart again. the netstat shows as expect:
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 127.0.0.1:32000 0.0.0.0:*
LISTEN 3253/java
tcp 0 0 192.168.1.234:9200 0.0.0.0:*
LISTEN 3253/java
tcp 0 0 192.168.1.234:9300 0.0.0.0:*
LISTEN 3253/java
udp 0 0 0.0.0.0:54328
0.0.0.0:* 3253/java
then I use curl to test, this time, the localhost and the private still
have the problems as shows above, and curl my public ip, result like my cur
localhost:
# curl -XGET 'http://122.x.x.x:9200/_cluster/health?pretty=true'
http-equiv="Content-Type" CONTENT="text/html; charset=utf-8"> ERROR:
The requested URL could not be retrieved
ERROR
The requested URL could not be
retrieved
The following error was
encountered while trying to retrieve the URL: http://122.11.52.234:9200/_cluster/health?
Connection to 122.11.52.234 failed.
The system returned: (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is webmaster.
Generated Thu, 27 Sep 2012 08:10:14 GMT by xxx (squid/2.7.STABLE7)
I think, it may be my config error, but I don't know where it is, plz have
a look
thanks.
--