`curl: (7) Failed connect to 187.48.456.45:9200; Connection refused`

Hi,
I installed ES 2.3.3. on my server(centos 7). I want to work on server not localhost. So I changed my elasticsearch.yml file with my ip number:187.48.456.45:

network.host: 187.48.456.45

After restart ES and I tried to connection.

[root@elasticsearch ~]# service elasticsearch restart
Restarting elasticsearch (via systemctl):                  [  OK  ]

However It didn't work true.

[root@elasticsearch ~]# curl http://187.48.456.45:9200
my error:
curl: (7) Failed connect to 187.48.456.45:9200; Connection refused

Also my firewall close. What is the problem?

Yeah this is a network issue. I probably know how to solve it:
On a Windows machine: Google for 'paping' and download it, put it in C:/
Open up a command prompt and perform:

 C:/paping 176.56.236.46 -p 9200 

I'm guessing it will tell you it is closed.
You say 'my firewall close'. This is not how firewalls work. When you 'shutdown' a firewall, it doesn't mean all the ports are open!
CentOS 7 works with firewallcmd. You can either disable firewallcmd and use iptables to open a port.
Or use these commands:

firewall-cmd --zone=dmz --add-port=9200/tcp --permanent systemctl restart firewall-cmd

And I'm not quite sure what it is you're trying. Because which machine is IP number: 187.48.456.45?
And you're trying to curl @ 176.56.236.46:9200 (A different IP adres)

Ok I did but it isn't.

I installed centos 6 instead of centos 7. After I installed ES. 2.3.3.

I configured elasticsearch.yml for network.host: 187.48.456.45.
After I installed vesta web panel for apache, mysql and php.

service elasticsearch restart.

error: permission denied on key 'vm.max_map_count'
Starting elasticsearch: log4j:WARN No appenders could be found for logger (common).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

I tried to connect on my server:

curl 'http://187.48.456.45:9200'
...

{
  "name" : "Rogue",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.3.3",
    "build_hash" : "218bdf10790eef486ff2c41a3df5cfa32dadcfde",
    "build_timestamp" : "2016-05-17T15:40:04Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  },
  "tagline" : "You Know, for Search"
}

It work true .:+1:

However I tried to connection on my browser:

http://187.48.456.45:9200

Result:

This site can not be reached
187.48.456.45 took too long to respond to the main machine.
Make a search on Google on 187 48 9200
ERR_CONNECTION_TIMED_OUT

What can I do?

my ip tables:

...
-A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT 
-A INPUT -p tcp -m udp --dport 9200 -j ACCEPT 
....

and

[root@elasticsearch ~]# netstat -plnt

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      3294/dovecot
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      3294/dovecot
tcp        0      0 176.56.236.46:80            0.0.0.0:*                   LISTEN      4837/nginx
tcp        0      0 176.56.236.46:8080          0.0.0.0:*                   LISTEN      2583/httpd
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      3263/exim
tcp        0      0 127.0.0.1:8081              0.0.0.0:*                   LISTEN      2583/httpd
tcp        0      0 0.0.0.0:8083                0.0.0.0:*                   LISTEN      6092/nginx
tcp        0      0 127.0.0.1:8084              0.0.0.0:*                   LISTEN      4837/nginx
tcp        0      0 176.56.236.46:53            0.0.0.0:*                   LISTEN      3177/named
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      3177/named
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      2622/vsftpd
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1285/sshd
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      3263/exim
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      3177/named
tcp        0      0 176.56.236.46:8443          0.0.0.0:*                   LISTEN      2583/httpd
tcp        0      0 0.0.0.0:2525                0.0.0.0:*                   LISTEN      3263/exim
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      3294/dovecot
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      3294/dovecot
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      3093/mysqld
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN      3263/exim
tcp        0      0 ::ffff:176.56.236.46:9200   :::*                        LISTEN      8121/java
tcp        0      0 :::465                      :::*                        LISTEN      3263/exim
tcp        0      0 ::ffff:176.56.236.46:9300   :::*                        LISTEN      8121/java
tcp        0      0 :::22                       :::*                        LISTEN      1285/sshd
tcp        0      0 :::25                       :::*                        LISTEN      3263/exim
tcp        0      0 ::1:953                     :::*                        LISTEN      3177/named
tcp        0      0 :::2525                     :::*                        LISTEN      3263/exim
tcp        0      0 :::587                      :::*                        LISTEN      3263/exim

It was solved.

on server cmd:

/etc/init.d/elasticsearch start

after:

http://176.56.236.46:9200

{
  "name" : "Bi-Beast",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.3.3",
    "build_hash" : "218bdf10790eef486ff2c41a3df5cfa32dadcfde",
    "build_timestamp" : "2016-05-17T15:40:04Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  },
  "tagline" : "You Know, for Search"
}