如何从静态ip访问elasticsearch?

vkc1a9a2  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(402)

我用ubuntu用hyper-v创建了一个虚拟机。我在我的ubuntu虚拟机上安装了elasticsearch。如何从静态ip运行elasticsearch
sudo apt get安装openjdk-8-jdk
sudo apt get安装nginx
sudo systemctl启用nginx
sudo apt get安装apt transport https
更新源
wget公司https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0-amd64.deb
已安装elasticsearch
sudo nano/etc/elasticsearch/elasticsearch.yml
我可以在本地机器上运行elasticsearch

-------Network-----

# 

# Set the bind address to a specific IP

network.host: localhost
http.port: 9200

当我转到浏览器并连接到localhost:9200,它成功地找到了elasticsearch
我想通过静态ip访问elasticsearch。例如:192.168.1.150:9200
我试过了

-------Network-----

# 

# Set the bind address to a specific IP

network.host: 192.168.1.150
http.port: 9200

我运行“sudo systemctl start elasticsearch.service”
我获取elasticsearch.service的错误作业失败,因为控制进程退出,错误代码为“systemctl status elasticsearch.service”和“journalctl-xe”以获取详细信息
有办法做到这一点吗?我希望能够在静态ip上运行elasticsearch、logstash和kibana
日志TL-xe

- An ExecStart= process belonging to unit elasticsearch.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Nov 20 14:22:52 ateet-Virtual-Machine systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Nov 20 14:22:52 ateet-Virtual-Machine systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit elasticsearch.service has finished with a failure.
--
-- The job identifier is 9061 and the job result is failed.
Nov 20 14:22:52 ateet-Virtual-Machine sudo[45417]: pam_unix(sudo:session): session closed for user root

ElasticSearch.log

org.elasticsearch.transport.BindTransportException: Failed to bind to 192.168.1.150:[9300-9400]; nested: BindException[Cannot assign requested address];

谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题