Elasticsearch7.x安装与配置

下载

1.下载地址:https://www.elastic.co/cn/start
复制下载链接

# 下载资源
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.0-linux-x86_64.tar.gz
# 解压资源
tar -xf elasticsearch-7.3.0-linux-x86_64.tar.gz

运行

cd elasticsearch-7.3.0-linux-x86_64
# 显示启动elk
./bin/elasticsearch
# 后台启动
./bin/elasticsearch -d

其它配置

跨域配置

当使用elasticsearch-head插件访问elk时,需要设置允许跨域访问

vim config/elasticsearch.yml
# 新增如下内容
http.cors.enabled: true
http.cors.allow-origin: "*"

允许外部网络(非本地)访问9200端口

默认情况下,启动elk服务后,其它服务器是无法访问elk服务的(telnet不通),只允许本地访问。

需要做如下配置:

vim config/elasticsearch.yml
# 新增如下内容
network.host: 0.0.0.0
http.port: 9200

此时,启动会报如下两个错误:

ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

对于第一个配置,root用户权限下,增加如下配置:

vi /etc/sysctl.conf
# 新增如下内容
vm.max_map_count=262144
sysctl -p

对于第二个错误,增加如下配置:

vim config/elasticsearch.yml
# 新增如下内容
cluster.initial_master_nodes: [“node-1”]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值