黑猴子的家:Elasticsearch 环境部署

1、Elasticsearch官网

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

9193428-7783d7da234e9ed1.png

9193428-fd3f65326f4f6323.png

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

[victor@node1 software]$ tar -xzvf elasticsearch-6.2.4.tar.gz -C /opt/module/

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

[victor@node1 ~]$ cd /opt/module/elasticsearch-6.2.4
[victor@node1 elasticsearch-6.2.4]$ mkdir data
[victor@node1 elasticsearch-6.2.4]$ mkdir logs

4、修改配置文件elasticsearch.yml

[victor@node1 ~]$ cd /opt/module/elasticsearch-6.2.4/config/ 
[victor@node1 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文件

[root@node1 ~]# 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

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

7、修改sysctl.conf

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

8、启动elasticsearch

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

9、测试集群

[victor@node1 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

[victor@node1 ~]$ kill `cat /opt/module/elasticsearch-6.2.4/pid `
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值