共计 1044 个字符,预计需要花费 3 分钟才能阅读完成。
- 下载 ES 安装包 wget https://artifacts.elastic.co/…
- 解压缩 tar -zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz
- 将解压后的文件夹复制多份(这里复制三份,分别为 node1, node2, node3)
-
分别进入 node1, node2, node3 中修改配置文件 (省略注释掉的信息)
node1:node.name: node-1 node.master: true network.host: 0.0.0.0 http.port: 9200 transport.tcp.port: 9300 discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9310", "127.0.0.1:9320"] cluster.initial_master_nodes: ["node-1"] http.cors.enabled: true http.cors.allow-origin: "*"
node2:
node.name: node-2 node.master: false network.host: 0.0.0.0 http.port: 9210 transport.tcp.port: 9310 discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9310", "127.0.0.1:9320"] http.cors.enabled: true http.cors.allow-origin: "*"
node3:
node.name: node-3 node.master: false network.host: 0.0.0.0 http.port: 9220 transport.tcp.port: 9320 discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9310", "127.0.0.1:9320"] http.cors.enabled: true http.cors.allow-origin: "*"
- 分别执行 node1 node2 node2 中 bin/elasticseach 启动三个节点, -d 为后台启动
./bin/elasticseach -d
- 访问 http://ip:9200/ 即可查看到 es 实例信息
ps: 节点内相互访问:
http.cors.enabled: true
http.cors.allow-origin: "*
配置外网访问:
network.host: 0.0.0.0
正文完
发表至: elasticsearch
2020-07-02