ELK(一)--Centos7.X安装最新版elasticsearch-7.0.0

3 篇文章 0 订阅

下载最新版

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-linux-x86_64.tar.gz

解压

tar -zxvf elasticsearch-7.0.0-linux-x86_64.tar.gz

移动目录

cd /usr/local/
mkdir elasticsearch
mv /data/elk/elasticsearch-7.0.0 /usr/local/elasticsearch/

修改配置

vim config/elasticsearch.yml
network.host: 0.0.0.0  //设置所有IP都能访问
http.port: 9200  //设置端口
#增加该配置,允许跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
#不配置会出现 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
cluster.initial_master_nodes: ["node-1"]


创建用户es,并赋权

useradd es
passwd es
chown -R es:es /usr/local/elasticsearch/elasticsearch-7.0.0/

切换用户,并启动elasticsearch

su es
cd /usr/local/elasticsearch/elasticsearch-7.0.0/
 ./bin/elasticsearch //前台启动
 ./bin/elasticsearch -d //后台启动

会出现以下错误

错误:

 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:

echo "vm.max_map_count=262144" > /etc/sysctl.conf
sysctl -p

错误:

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

解决方法:

在上面配置文件的配置中已经说了,需要修改配置文件设置cluster.initial_master_nodes: ["node-1"]

访问IP:9200,出现下面内容启动成功

{
  "name" : "clark-app2",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ASWWjZi3RzqbMqXgZf9yEw",
  "version" : {
    "number" : "7.0.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "b7e28a7",
    "build_date" : "2019-04-05T22:55:32.697037Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.7.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值