Elasticsearch 1 本地集群配置

Submitted by Lizhe on Thu, 01/07/2021 - 02:12

目的是学习研究,所以这里就不用docker了

安装jdk

sudo apt install openjdk-8-jdk

安装es

详细内容可以参考 https://www.elastic.co/cn/downloads/elasticsearch

不看不看直接上命令还是 apt 省事

sudo apt-get install apt-transport-https

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list

sudo apt-get update && sudo apt-get install elasticsearch

20210107102453

内容很简单,按照下面的改就可以了

 

root@ubuntu:/etc/elasticsearch# pwd
/etc/elasticsearch
root@ubuntu:/etc/elasticsearch# cat elasticsearch.yml
cluster.name: lizhe-es
node.name: node-1
path.data: /data/es-data
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["192.168.204.132", "192.168.204.133","192.168.204.134"]
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
root@ubuntu:/etc/elasticsearch# 

20210107120555

20210107120606

20210107120616

 

Running with built in server

  • git clone git://github.com/mobz/elasticsearch-head.git
  • cd elasticsearch-head
  • npm install
  • npm run start

 

用 elasticsearch head 看一看

20210107140317