ElasticSearch | centos7 上安装ES
0 参考博客文章(感谢!!!)
1.安装jdk
1.1 执行命令下面命令查看可安装java版本
yum -y list java*
1.2 选择一个java版本进行安装,
yum install -y java-1.8.0-openjdk-devel.x86_64
这里有个地方要注意,要选择 要带有-devel的安装,因为这个安装的是jdk,而那个不带-devel的安装完了其实是jre。
1.3 输入java -version查看已安装的jdk版本,当出现如下输出表示安装成功。
1.4 jdk 的安装目录
/usr/lib/jvm
1.5 配置环境变量,编辑/etc/profile文件:
vi /etc/profile
1.6 在文件尾部添加如下配置:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el6_10.x86_64
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

1.7 :wq退出vim编辑器,然后使用命令更新配置
source /etc/profile
2. 安装ES
2.1 依次执行命令
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.zip
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.zip.sha512
shasum -a 512 -c elasticsearch-6.3.2.zip.sha512
unzip elasticsearch-6.3.2.zip
cd elasticsearch-6.3.2/
遇到错误1
-bash: shasum: command not found
解决方案:在CentOS上,“shasum”被称为“sha1sum”,运行下面命令修复此问题
ln -s /usr/bin/sha1sum /usr/bin/shasum
遇到错误2
sha1sum: invalid option -- 'a'
解决方案:
yum install -y perl-Digest-SHA
遇到报错3
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
解决方案:调小启动内存,如果512m还是不行的话,就得要再往下调了
[root@iZwz9ahuk6xeihs1n3gqy5Z elasticsearch-6.3.2]# vi config/jvm.options
#-Xms2g
#-Xmx2g
-Xms512m
-Xmx512m
遇到报错4:无法以root权限启动
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
解决方案:创建一个非root用户并赋予目录该用户权限,再启动
#root身份
groupadd es
useradd es -g es -p es
chown es:es ${elasticsearch_HOME}/ #存放elasticsearch的目录
su - es #切换到es用户下
${elasticsearch_HOME}/bin/elasticsearch #启动elasticsearch
遇到报错5
ERROR: [4] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [e] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解决方案:
【5.1】【5.2】
#root身份
vi /etc/security/limits.conf
#文件末尾添加内容(*也是要加上去)
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096
【5.3】
#root身份
sysctl -w vm.max_map_count=262144
vim /etc/sysctl.conf #让配置永久生效
#文件末尾添加内容
vm.max_map_count=262144
【5.4】
Centos6不支持SecComp,而ES6默认bootstrap.system_call_filter为true
vim config/elasticsearch.yml
禁用:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面: 取消bootstrap.memory_lock的注释,添加bootstrap.system_call_filter 配置
#注意在":"后面需要空格
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
ElasticSearch | centos7 上安装ES的更多相关文章
- ElasticSearch | windows 上安装ES
Elastatic需要java JAVA8 环境,确保安装好环境 在windows上安装ES还是比较简单的, 1.首先在官网上下载zip,地址 https://www.elastic.co/downl ...
- 在centos7上安装Jenkins
在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...
- 在 CentOS7 上安装 zookeeper-3.4.9 服务
在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...
- 在 CentOS7 上安装 MongoDB
在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...
- 在 CentOS7 上安装 MySQL5.7
在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...
- 在 CentOS7 上安装 Tomcat9
在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...
- 在CentOS7上安装JDK1.8
在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...
- 在Centos7上安装漏洞扫描软件Nessus
本文摘要:简单叙述了在Centos7上安装Nessus扫描器的过程 Nessus 是目前全世界最多人使用的系统漏洞扫描与分析软件,Nessus的用户界面是基于Web界面来访问Nessus漏洞扫描器 ...
- 如何在centos7上安装源码包
在我们使用linux的过程中,有很多程序是通过红帽官网给的系统中安装的,但是一般来说,系统更新的速度比较慢,如果这个时候我们又想用最新版的该怎么办呢?总不能一直等系统升级吧╮(╯﹏╰)╭所以,我们可以 ...
随机推荐
- 石家庄地铁查询PSP0级
一.需求 :地铁(石家庄地铁)线路查询 二. 学生:洪鼎淇 合作对象:宋子健 时间记录日志: 日期 开始时间 结束时间 中断时间 净时间 活动 2019/3/30 10:00 14:0 ...
- How To Configure a Redis Cluster on Ubuntu 14.04
原文:https://www.digitalocean.com/community/tutorials/how-to-configure-a-redis-cluster-on-ubuntu-14-04 ...
- ThoughtWorks技术雷达
ThoughtWorks技术雷达 技术成熟方案的一个推荐网站.
- linux core文件设置
http://blog.csdn.net/ctthuangcheng/article/details/8963551 linux core文件设置 分类: Linux OS Debugging Te ...
- 设计模式之解释器模式(Interpreter)摘录
23种GOF设计模式一般分为三大类:创建型模式.结构型模式.行为模式. 创建型模式抽象了实例化过程,它们帮助一个系统独立于怎样创建.组合和表示它的那些对象.一个类创建型模式使用继承改变被实例化的类,而 ...
- easyui使用心得
一.搭建easyui运行环境 1.下载easyui压缩文件 2.将降压后的文件添加至webapp目录下 3.引用5个必须的js和css文件 <!--引入easyui样式文件--> < ...
- leetcode:122. Best Time to Buy and Sell Stock II(java)解答
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Best Time to Buy and Sell Stock II Say you have an array for which th ...
- C++问题记录
问题idx: 1) 怎么在VS2010下新建一个像VC6.0 中那样的控制台C++程序. cdate: 2014-4-24 A1: VC6.0 对标准C++集的支持不是太好, VS2010也有一些吧, ...
- 2016/05/17 thinkphp3.2.2 ① Ajax 使用 ②前端验证
显示效果: ①Ajax使用: 注意传值的所有过程用的是小写,及时数据库列的名称中有大写字母 控制器部分: AjaxController.class.php <?php namespace H ...
- jquery loop on Json data using $.each
Hi I have the following JSON returned in a variable called data. THIS IS THE JSON THAT GETS RETURNED ...