1、Elasticsearch官网

https://www.elastic.co/products/elasticsearch

黑猴子的家:Elasticsearch 环境部署
黑猴子的家:Elasticsearch 环境部署

2、解压Elasticsearch到/opt/module目录下

[[email protected] software]$ tar -xzvf elasticsearch-6.2.4.tar.gz -C /opt/module/

3、在 Elasticsearch-6.2.4 路径下创建data和logs文件夹

[[email protected] ~]$ cd /opt/module/elasticsearch-6.2.4
[[email protected] elasticsearch-6.2.4]$ mkdir data
[[email protected] elasticsearch-6.2.4]$ mkdir logs

4、修改配置文件elasticsearch.yml

[[email protected] ~]$ cd /opt/module/elasticsearch-6.2.4/config/ 
[[email protected] config]$ vim elasticsearch.yml

# ---------------------------------- Cluster -------------------------------------
cluster.name: my-application
# ------------------------------------ Node --------------------------------------
node.name: es-node1
# ----------------------------------- Paths ---------------------------------------
path.conf: /opt/module/elasticsearch-6.2.4/config
path.data: /opt/module/elasticsearch-6.2.4/data
path.logs: /opt/module/elasticsearch-6.2.4/logs
# ----------------------------------- Memory -----------------------------------
bootstrap.memory_lock: true
bootstrap.system_call_filter: false 
# ---------------------------------- Network ------------------------------------
network.host: 192.168.1.102 
http.port: 9200
# --------------------------------- Discovery ------------------------------------
discovery.zen.ping.unicast.hosts: ["node1", "node2", "node3"]
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.timeout: 40s
# ---------------------------------- Various -----------------------------------
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization

Elasticsearch 之 elasticsearch.yml 配置文件详解
https://www.jianshu.com/p/fb5c2a7d1e12

5、修改limits.conf文件

[[email protected] ~]# vim /etc/security/limits.conf
* soft nofile 65535
* hard nofile 1028576
* soft nproc 65535
* hard nproc unlimited
* soft memlock unlimited
* hard memlock unlimited
尖叫提示:node1、node2 添加同样内容

6、修改20-nproc.conf

[[email protected] ~]# vim /etc/security/limits.d/20-nproc.conf
* soft nproc 4096
尖叫提示:node1、node2 添加同样内容

7、修改sysctl.conf

[[email protected] ~]# vim /etc/sysctl.conf
vm.max_map_count=262144
[[email protected] ~]# sysctl -p
尖叫提示:node1、node2 添加同样内容

8、启动elasticsearch

[[email protected] ~]$ cd /opt/module/elasticsearch-6.2.4
[[email protected] ~]$ bin/elasticsearch -d -p /opt/module/elasticsearch-6.2.4/pid
尖叫提示:elasticsearch 不能使用root用户启动

9、测试集群

[[email protected] elasticsearch-6.2.4]$ curl http://node1:9200
{
  "name" : "node-1",
  "cluster_name" : "my-application",
  "cluster_uuid" : "iLWXJ_1pRqCAFz4bgokI1w",
  "version" : {
    "number" : "6.2.4",
    "build_hash" : "667b497",
    "build_date" : "2018-09-01T19:22:05.189Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}

10、关闭elasticsearch

[[email protected] ~]$ kill `cat /opt/module/elasticsearch-6.2.4/pid `

相关文章:

  • 2021-09-14
  • 2021-09-28
  • 2022-01-15
  • 2021-07-03
  • 2021-06-09
  • 2022-01-19
  • 2021-12-07
  • 2022-01-09
猜你喜欢
  • 2021-11-26
  • 2021-08-26
  • 2021-12-30
  • 2021-04-01
  • 2021-07-26
  • 2021-09-17
  • 2022-01-06
相关资源
相似解决方案