有时候我们本地搭建ElasticSearch后需要远程连接,比如docker内访问或推送数据到ES中。

我的系统是Ubuntu,apt安装的ES7.5。

打开配置文件vim /etc/elasticsearch/elasticsearch.yml

除了需要把network.host改为0.0.0.0

还需要把设置为单机环境 discovery.type: single-node


#network.host: 192.168.0.1
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
discovery.type: single-node
#

results matching ""

    No results matching ""

    results matching ""

      No results matching ""