目录
本次测试环境服务器系统:Red Hat Enterprise Linux Server release 7.3 (Maipo),其他版本系统在服务器初始化环节可能存在差异,请自行查找对应命令
服务器规划
| 服务器ip | jdk | 节点 | 端口 |
|---|---|---|---|
| 192.168.54.131 | jdk1.8 | node131 | 9200 |
| 192.168.54.132 | jdk1.8 | node132 | 9200 |
| 192.168.54.133 | jdk1.8 | node133 | 9200 |
部署包下载
官网下载地址Elasticsearch 6.5.4 | Elastic 下载对应系统的部署包
服务器初始化(所有节点都要操作)
内核参数修改
/etc/security/limits.conf修改
修改/etc/security/limits.conf文件,末尾追加如下内容(需退出重新登录用户或直接重启系统才会生效)
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
否则es启动会报错::bootstrap checks failed [1]: max file descriptors [65535] for elasticsearch
/etc/sysctl.conf文件修改
编辑 /etc/sysctl.conf,追加以下内容:
vm.max_map_count=655360
保存后,执行:sysctl -p生效
否则es启动报错:: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
禁用selinux
查看状态:getenforce
临时关闭:setenforce 0
永久关闭:修改/etc/sysconfig/selinux文件 修改SELINUX的值为disabled
[root@localhost ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
关闭防火墙
依次执行以下三条命令 关闭防火墙、禁用防火墙、查看防火墙状态,最后的状态应该如下箭头所示为“dead”
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@localhost ~]# ^C
[root@localhost ~]#

创建es用户
因为安全问题 es库不允许直接root启动,所以需要创建一个用户,所以一般就创建名为“es”的用户,修改密码时候提示无效密码不用管,重新输入密码验证即可
[root@localhost ~]# useradd es
[root@localhost ~]# passwd es
更改用户 es 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@localhost ~]#
安装jdk
es需要依赖JDK,如果没有需要安装,请自行安装(es6.5.4推荐安装1.8的jdk)
es部署
单节点(节点1)部署
部署包上传解压
1.登录131服务器进入/opt目录并创建es目录,
[root@localhost es]#cd /opt
[root@localhost es]#mkdir es
2.上传部署包到当前目录下并解压
[root@localhost es]#cd es
[root@localhost es]# tar -xvzf elasticsearch-6.5.4.tar.gz
[root@localhost es]# ll
总用量 110668
-rw-r--r-- 1 root root 113322649 1月 18 11:54 elasticsearch-6.5.4.tar.gz
drwxr-xr-x 9 es es 145 1月 18 10:43 elasticsearch-6.5.4
3.进入es解压目录(/opt/es/elastticsearch-6.5.4)创建数据存储目录及日志目录(如果没有就创建 有就忽略这一步)
[root@localh
458



被折叠的 条评论
为什么被折叠?



