elasticsearch,reverse-proxy,master,Authentication,Nginx,elasticsearch,Reverse Proxy,Master" /> elasticsearch,reverse-proxy,master,Authentication,Nginx,elasticsearch,Reverse Proxy,Master" />

Authentication 使用Nginx的ElasticSearch集群认证

Authentication 使用Nginx的ElasticSearch集群认证,authentication,nginx,elasticsearch,reverse-proxy,master,Authentication,Nginx,elasticsearch,Reverse Proxy,Master,我有一个ElasticSearch集群,服务器192.168.30.141上有一个主节点,其他一些服务器上有5个数据节点。我已经在服务器192.168.30.141上设置了一个nginx反向代理服务器,用于基本身份验证。 我的群集数据节点无法发现主节点。 我如何解决这个问题? 是否需要在数据节点上安装nginx 我的ngnix配置如下: events { worker_connections 1024; } http { upstream elasticsearch { ser

我有一个ElasticSearch集群,服务器192.168.30.141上有一个主节点,其他一些服务器上有5个数据节点。我已经在服务器192.168.30.141上设置了一个nginx反向代理服务器,用于基本身份验证。 我的群集数据节点无法发现主节点。 我如何解决这个问题? 是否需要在数据节点上安装nginx

我的ngnix配置如下:

events {
  worker_connections  1024;
}
http {
  upstream elasticsearch {
    server 127.0.0.1:9200;
  }
  server {
    listen 9200;
    auth_basic "Protected Elasticsearch";
    auth_basic_user_file passwords;
    location / {
      proxy_pass http://elasticsearch;
      proxy_redirect off;
    }
  }
}
node.master: true
node.data: false
network.host: 127.0.0.1
http.port: 9200
node.master: false
node.data: true
network.host: 192.168.30.142
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.30.141"] // master node ip
我的主节点配置如下:

events {
  worker_connections  1024;
}
http {
  upstream elasticsearch {
    server 127.0.0.1:9200;
  }
  server {
    listen 9200;
    auth_basic "Protected Elasticsearch";
    auth_basic_user_file passwords;
    location / {
      proxy_pass http://elasticsearch;
      proxy_redirect off;
    }
  }
}
node.master: true
node.data: false
network.host: 127.0.0.1
http.port: 9200
node.master: false
node.data: true
network.host: 192.168.30.142
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.30.141"] // master node ip
我的数据节点配置如下:

events {
  worker_connections  1024;
}
http {
  upstream elasticsearch {
    server 127.0.0.1:9200;
  }
  server {
    listen 9200;
    auth_basic "Protected Elasticsearch";
    auth_basic_user_file passwords;
    location / {
      proxy_pass http://elasticsearch;
      proxy_redirect off;
    }
  }
}
node.master: true
node.data: false
network.host: 127.0.0.1
http.port: 9200
node.master: false
node.data: true
network.host: 192.168.30.142
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.30.141"] // master node ip

端口9200用于HTTP API,而端口9300用于节点通信和发现

看起来您的主机网络主机设置为127.0.0.1,这意味着它将只在本地侦听。如果希望其他节点能够发现它,则需要绑定网络主机而不是本地主机


确保所有网络主机都设置为本地网络,并且节点可以在端口9300上相互通信,这将允许ES节点找到其他节点。

我想验证对主节点的所有请求,因此我将主节点的host.network config设置为127.0.0.1,以使用代理服务器(nginx)管理所有请求我理解,但您正在为所有端口绑定127.0.0.1,包括9300,这将阻止其他节点看到此节点。