centos7 +
java 8 +
elastic 6.2.4+
wget http://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.1.tar.gz
1. rpm -ivh jdk-8u181-linux-x64.rpm
/*注意:默认安装位置 /usr/java/jdk1.8.0_171-amd64*/
2. 配置环境变量
vim /etc/profile
在文件末尾加入:
export JAVA_HOME=/usr/java/jdk1.8.0_171-amd64
export PATH=$PATH:$JAVA_HOME/bin
3. 重载系统配置
source /etc/profile
tar -zxvf elasticsearch-6.4.1.tar.gz
bin 可执行的二进制文件的目录
config 配置文件的目录
lib 运行时依赖的库
logs modules 运行时日志文件
plugins es中提供的插件
在bin目录中执行 ./elasticsearch
在linux系统中创建新的用户
useradd es
修改es用户密码
passwd es
将root用户解压的文件移动到es用户目录中
chmod -R es:es /user/local/es/
登录es用户启动ES
./elasticsearch 启动ES
在命令终端中执行: curl http://localhost:9200 出现以下信息:
{
"name" : "xQK1cwT",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "t7IYk7LKQ0mXcyyrdFWpLg",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
vim elasticsearch.yml 将原来network修改为以下配置:
network.host: 0.0.0.0
外部浏览器访问即可
http://es的主机名:9200 出现如下信息说明安装成功:
{
"name" : "xQK1cwT",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "t7IYk7LKQ0mXcyyrdFWpLg",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
ERROR: bootstrap checks failed[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决方案:
切换到root用户修改
vim /etc/security/limits.conf
在最后面追加下面内容
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
退出重新登录检测配置是否生效:
ulimit -Hn
ulimit -Sn
ulimit -Hu
ulimit -Su
ERROR: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方案:
vim /etc/sysctl.conf
vm.max_map_count=655360
#执行以下命令生效:
sysctl -p
参考文章:https://blog.csdn.net/he19970408/article/details/107359861/