Elastic Search Not able to connect Remotely even after specifying HOST - elasticsearch

I have specified the Network.host in elasticsearch.yml.
network.host: 192.168.x.x
Added host entry in the remote server C:\Windows\System32\drivers\etc
192.168.x.x domainname.com
I am not able to connect from remote server by accessing the below URL
http://domainname.com:9200/
Please suggest what else I should look into

Related

Kibana is not accessible from external browser

I am trying to install Elasticsearch and Kibana on Debian 10. they both work and active in the current machine. I want to access Kibana through different machine's browser, but it cannot be reached.
I have changed Kibana.yml configuration,
server.port: 5601
server.host: "IP" - my IP address
elasticsearch.hosts: ["http://IP:9200"]
Also, I have enabled 5601 and 9200 ports through he firewall by using UFW commands.
even though, still not working. Any idea how to fix that??
Thanks,
almo

elasticsearch setup on Gcloud VM fails

I wish to run my elasticsearch remotely on gcloud VM, this is configured to run at 127.0.0.1 at a specific port 9200. How to access this from a website outside this vm? If I change the network host to 0.0.0.0 on the yml file, even 9200 port becomes inaccessible. How do I overcome this problem?
Changed network.host: [_site_ , _local_ , _global_ ]
_site_ = internal ip given by google cloud vm,
_local_ = 127.0.0.1,
_global_ = found using curl ifconfig.me,
Opened a specific port (9200) and tried to connect with global IP address.
curl to the global ip gives
>Output: Failed to connect to (_global_ ip) port 9200: connection refused.
So put network.host:0.0.0.0 and then try to allow 9200 and 9201 port and restart the elasticsearch service.If you are using ubuntu then sudo service elasticsearch restart then check by doing curl -XGET 'http://localhost:9200?pretty'.Let me know if you are still facing any issues.
Use following configurations for elasticsearch.yml
network.host: 0.0.0.0
action.auto_create_index: false
index.mapper.dynamic: false
Solved this problem by going through the logs and found out that the public ip address is re-mapped to the internal ip address, hence network.host can't be set to external ip directly. Elasticsearch yml config is as follows:
'network.host: xx.xx.xxx.xx' is set to the internal ip (given by google),
'http.cors.enabled: true',
'http.cors.allow-origin:"*", (Do not use * in production, its a security issue)
'discovery.type: single-node' in my case to make it work independently and not in a cluster
Now this sandboxed version can be accessed from outside the VM using the external IP address given by Google.

On iMac, access elasticsearch and neo4j ports on local ip address?

ifconfig shows
inet 192.168.10.1
I can access
http://localhost/
http://127.0.0.1/
http://192.168.10.1
They are all the same.
I also can access neo4j and elasticsearch ports on the following urls
Elasticsearch
http://127.0.0.1:9200/
http://localhost:9200/
Neo4j
http://127.0.0.1:7474/browser/
http://localhost:7474/browser/
But port 9200 and 7474 are not working for 192.168.10.1
http://192.168.10.1:9200
http://192.168.10.1:7474
Something I need to do make the port 7474 (neo4j) and 9200 (elasticsearch) working for 192.168.10.1, but I don't know how.
Please advise, thanks!
I figured it out.
Neo4j
Set up neo4j on the ip (except localhost), in my case
http://192.168.10.1:7474
In the neo4j.conf file
uncomment the following line.
# With default configuration Neo4j only accepts local connections.
# To accept non-local connections, uncomment this line:
dbms.connectors.default_listen_address=0.0.0.0
Elasticsearch
Modify elasticsearch.yml
add the following line
network.host: 0.0.0.0
Then start elasticsearch.

Accessing kibana on local network

I want to access kibana running on my local system to be accessed by local_ip:5601 on other systems in my local network. I tried adding these two lines in elastic search:
http.cors.allow-origin: "*"
http.cors.enabled: true
But, it didn't work either.
On your kibana.yml look for the line #server.host: "0.0.0.0". It will probably be commented (#). You must remove the "#" from the line and restart your kibana service. It should allow you to access kibana from your local network ip e.g. "192.168.10.20" and make it discoverable by your other systems.
On that same file kibana.yml you will find an url that points to "http://localhost:9200" by default. If your elasticsearch instance is hosted in any different url than that, you must specify to kibana config file.
You can find more information about it here
See this related question:
vagrants-port-forwarding-not-working
I was working with Kibana in a Centos 7 Vagrant VM.
I was not able to access the Kibana webui from the Host computer.
Stopping firewalld and disabling SELinux did not do the trick.
My VM ip address was 192.168.2.2, so I tested with curl http://92.168.2.2:5601/ and it would work from within the VM, but not from the Host CLI.
I tested that port forwarding was working by installing Apache in the VM and could access it from the Host browser with http://localhost:80, so port forwarding was not the problem.
My problem was the server.host parameter in the kibana.yml configuration file, which I had set to the ip address of the VM.
I changed it from this:
server.host: "192.168.2.2"
to this:
server.host: "0.0.0.0"
restarted kibana and could access the webui from the Host.
This is how I got it to work:
Vagrantfile:
config.vm.network "forwarded_port", guest: 5601, host: 5602
httpd.conf:
Listen 5602
<VirtualHost *:5602>
ProxyPreserveHost On
ProxyRequests Off
ServerName kibana.mydomain.dev
ProxyPass / http://127.0.0.1:5601/
ProxyPassReverse / http://127.0.0.1:5601/
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>

Windows mongodb server bind_ip configuration

I would like to ask help on the allowing remote connections from my Mongodb server.
I have here my configuration but not working, i see "connect failed" on my remote machine.
C:\mongodb\bin\mongod --bind_ip 0.0.0.0
Did I made a mistake?
your command should be :
C:\mongodb\bin\mongod --bind_ip 127.0.0.1,xxx.xxx.xxx.xxx
the IP xxx.xxx.xxx.xxx is the IP of the Remote Machine (where mongo DB is there)

Resources