CentOS下ElasticSearch快速安装

安装ElasticSearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0.tar.gz
tar -zxf elasticsearch-7.2.0.tar.gz -C /usr/local/
mv /usr/local/elasticsearch-7.2.0 /usr/local/elasticsearch

创建es用户

groupadd es
useradd -g es -M -s /sbin/nologin es
chown -R es:es /usr/local/elasticsearch/
cd /usr/local/elasticsearch

配置环境

修改config/jvm.options为内存的一半大小:vim config/jvm.options

-Xms512m
-Xmx512m

修改max filemax virtual memory参数,使用root或sudo用户:vim /etc/sysctl.conf,添加下面配置:

vm.max_map_count=655360

并执行命令:sysctl -p

配置文件

配置端口及跨域

vim /usr/local/elasticsearch-7.2.0/config/elasticsearch.yml
cluster.name: elasticsearch
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
node.max_local_storage_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true

安装插件

切换es用户,在Elasticsearch主目录下运行下列命令来安装插件

su - es
bin/elasticsearch-plugin install xxx

启动ES

es用户启动

/usr/local/elasticsearch-7.2.0/bin/elasticsearch -d

root用户启动

su - es -c '/usr/local/elasticsearch-7.2.0/bin/elasticsearch -d'
上一篇 使用yum安装配置ElasticSearch
下一篇 CentOS下搭建Shadowsocks服务器
目录
文章列表
1 Spring Cloud Gateway自定义过滤器进行限流
Spring Cloud Gateway自定义过滤器进行限流
2
ElasticSearch 7 搜索(12)query_string 查询
ElasticSearch 7 搜索(12)query_string 查询
3
银行卡CardBin查询相关网站
银行卡CardBin查询相关网站
4
Flutter在State类里获取Page类中的变量
Flutter在State类里获取Page类中的变量
5
Prometheus通过企业微信接收告警
Prometheus通过企业微信接收告警
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。