ElasticSearch安裝
一、部署环境
| 配置名称 | 配置详情 |
|---|---|
| 系统 | CentOS Linux release 7.7.1908 (Core) |
| 软件名称 | ElasticSearch |
| 软件版本 | 6.8.6 |
| 用户角色 | root |
二、安装
1)安装目录
[root@hadoop-node1 elasticsearch-6.8.6]# cd /home/pqtel-bigdata/elasticsearch-6.8.6
2)创建用户
创建用户:
[root@hadoop-node1 elasticsearch-6.8.6]# adduser es
授权:
[root@hadoop-node1 elasticsearch-6.8.6]# chown -R es:es /home/pqtel-bigdata/elasticsearch-6.8.6
3)修改配置
修改命令:
[root@hadoop-node1 elasticsearch-6.8.6]# vi config/elasticsearch.yml
修改参数:
network.host: 0.0.0.0http.port: 9200
4)修改环境配置
修改limits.conf
修改命令:
[root@hadoop-node1 elasticsearch-6.8.6]# vi /etc/security/limits.conf
在文件结尾增加以下配置:
* soft nofile 65536* hard nofile 65536* soft nproc 4096* hard nproc 4096
修改sysctl.conf
修改命令:
[root@hadoop-node1 elasticsearch-6.8.6]# vi /etc/sysctl.conf
文件结尾增加内容:
vm.max_map_count=262144
5)测试运行
切换用户:
[root@hadoop-node1 elasticsearch-6.8.6]# su es
运行:
[es@hadoop-node1 elasticsearch-6.8.6]# bash bin/elasticsearch
运行检测:
浏览器访问:http://192.168.0.218:9200/
访问内容:
{name: "Aw5jl-M",cluster_name: "elasticsearch",cluster_uuid: "eodMLgqvT2qmHwmY11dYSw",version: {number: "6.8.6",build_flavor: "default",build_type: "tar",build_hash: "3d9f765",build_date: "2019-12-13T17:11:52.013738Z",build_snapshot: false,lucene_version: "7.7.2",minimum_wire_compatibility_version: "5.6.0",minimum_index_compatibility_version: "5.0.0"},tagline: "You Know, for Search"}
6)后台运行
如若测试运行没有问题就切换后台运行:
[root@hadoop-node1 elasticsearch-6.8.6]# bash bin/elasticsearch -d
7)初始化
- 初始化
[root@hadoop-node1 pqtel-bigdata]# bash init/es-init.sh
- 检验表是否创建成功
访问 http://192.168.0.218:9200/_cat/indices
创建成功内容如下:
green open motor_vehicle 8ZVS3iYTSiC876t6LzZefA 1 0 0 0 230b 230bgreen open video_slice 4-TYzmvZRhaUl-LEP2fz4g 1 0 0 0 230b 230bgreen open video_label P6P1gDPvSZmvDOWeMOi17g 1 0 0 0 230b 230bgreen open thing xxiKENxaSEu89CPG7wnN-Q 1 0 0 0 230b 230bgreen open image LhTXzvojQK23TKn_dDIkvQ 1 0 0 0 230b 230bgreen open t_case 8q6BEFToRSalHgx5rVq7DA 1 0 0 0 230b 230bgreen open face A52jmop1RcSW3utJhY2VIA 1 0 0 0 230b 230bgreen open file EkrisC-3Q7m6aiGs_oV3hA 1 0 0 0 230b 230bgreen open non_motor_vehicle bMpvEtMnR7K-u8gzlfaImQ 1 0 0 0 230b 230bgreen open scene ObSyvmoTQsOZvsVp_uXnOA 1 0 0 0 230b 230bgreen open disposition_notification ou4YaB8CTaeoitbcQi6bgQ 1 0 0 0 230b 230bgreen open person eLt9BvrmTWKrubIDRogXOw 1 0 0 0 230b 230bgreen open subscribe_notification wmkrmyM6QLyHg2vKb7p32g 1 0 0 0 230b 230b
