赞
踩
linux直接下载: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-linux-x86_64.tar.gz
或 官网下载
本地下载可用SCP上传到服务器!
tar -zxf elasticsearch-7.0.0-linux-x86_64.tar.gz -C /usr/local # 解压缩
mv elasticsearch-7.0.0 elasticsearch # 重命名
cd /usr/local/elasticsearch/bin
./elasticsearch # 启动 elasticsearch
异常:
异常①:org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
原因: elasticsearch不能以root权限来运行
解决: 创建新用户(普通)运行
第一步:liunx创建新用户 adduser admin 然后给创建的用户加密码 passwd ****** 输入两次密码
第二步:root给admin 赋予权限,chown -R admin:组名 /elasticsearch安装目录
异常②:java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
原因: 因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动:
解决:修改elasticsearch.yml 配置文件
vim /usr/local/elasticsearch/config/elasticsearch.yml
vim /usr/local/elasticsearch/config/elasticsearch.yml
添加:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
启动正常! 浏览器访问 http://10.0.164.19:9200/?pretty 无法访问!
服务器localhost访问正常,ip无法访问!修改 elasticsearch.yml文件
再次启动!异常!!!
解决:
异常④ max number of threads [1024] for user [yang*****] is too low, increase to at least [4096]
解决:切换到root用户,进入limits.d目录下修改配置文件。
vim /etc/security/limits.d/90-nproc.conf
修改如下内容:soft nproc 1024 —> soft nproc 4096
注意:root账户修改后,切换到普通账户才生效
异常⑤ max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决:切换到root用户修改配置sysctl.conf
vim /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
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
解决:修改 elasticsearch.yml 配置文件
cluster.initial_master_nodes: ["node-1"]
启动!访问 http://10.0.196.19:9200/?pretty
可以用kibana来操作elasticsearch
下载:https://artifacts.elastic.co/downloads/kibana/kibana-7.0.0-linux-x86_64.tar.gz
linux 下载: wget https://artifacts.elastic.co/downloads/kibana/kibana-7.0.0-linux-x86_64.tar.gz
(1) 安装
tar -zxf kibana-7.0.0-linux-x86_64.tar.gz -C /usr/local
(2) 配置
在kibana安装目录的config下,修改kibana.yml配置文件
server.host: "10.0.164.19" #配置本机ip
elasticsearch.hosts: ["http://10.0.164.19:9200"] # 查询的ES实例的url
(3) 启动
在kibana安装目录的bin下,执行kibana
./kibana
(4) 结果
感觉kibana 页面英语操作有点困难,汉化!
github 汉化: https://github.com/anbai-inc/Kibana_Hanization
汉化效果不是很理想,不过有胜于无(汉化kibana 7.0版本效果更差,我从新安装的6.7版本)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。