- # 本机是否已经安装,ElasticSearch 最低支持 jdk 1.7
- yum list installed | grep java
- # 查看 yum 库中的 java 安装包
- yum list java*
- # 安装 java-1.8.0
- yum install -y java-1.8.0-openjdk
- # 安装完成后查看 java 版本
- java -version
- openjdk version "1.8.0_212"
- OpenJDK Runtime Environment (build 1.8.0_212-b04)
- OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
- # 下载并安装公共签名密钥
- rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
- # 创建 yum 源文件
- vim /etc/yum.repos.d/elasticsearch.repo
- [elasticsearch-7.x]
- name=Elasticsearch repository for 7.x packages
- baseurl=https://artifacts.elastic.co/packages/7.x/yum
- gpgcheck=1
- gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
- enabled=1
- autorefresh=1
- type=rpm-md
- # 安装
- yum install -y elasticsearch
- 安装配置elasticsearch
- cd /etc
- curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.1-linux-x86_64.tar.gz
- tar -xzvf elasticsearch-7.8.1-linux-x86_64.tar.gz
- #添加es用户
- useradd es
- chown -R es:es /etc/elasticsearch-7.8.1-linux-x86_64
- #切换用户es 来进行操作
- cd /etc/elasticsearch-7.8.1
- ./bin/elasticsearch
以上就是CentOS7 安装 ElasticSearch 的详细内容,更多关于CentOS7 安装 ElasticSearch 的资料请关注九品源码其它相关文章!