博客详情

centos中安装ES6.8、ik分词器、eshead、kibana (原创)

作者: 朝如青丝暮成雪
发布时间:2020-09-04 15:32:09  文章分类:java编程   阅读(1485)  评论(0)


一、安装ElasticSearch-6.8.10

1、解压安装

tar -zxvf elasticsearch-6.8.10tar.gz #解压
mv elasticsearch-6.8.10  elasticsearch  #重命名
mv elasticsearch /usr/local/  #移动目录

2、修改ES配置文件

cd /usr/local/elasticsearch 
cd  config 
vi elasticsearch.yml #修改配置


cluster.name: myES 
node.name: node-1
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
network.host: 0.0.0.0
http.port: 9200
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization


cd /usr/local/elasticsearch 
mkdir  data #创建data目录

3、添加一个普通用户(es不能用root用户启动)

adduser  elastic
passwd elastic 
***** [设置密码为elastic]
cd /usr/local/elasticsearch 
chown -R  elastic:elastic  . #将目录所属用户分配给elastic用户


4、适当调整jvm参数

cd config 
vi jvm.options ,适当调整内存大小

#-Xms1g
#-Xmx1g
-Xms256m
-Xmx256m
5、修改系统内核参数


vi /etc/security/limits.conf


* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
vi /etc/security/limits.d/90-nproc.conf ,将其中 
*      soft    nproc     1024
改为
*      soft    nproc     2048

增加虚拟内存
vi /etc/sysctl.conf,加上以下配置

vm.max_map_count=655360


sysctl -p #ok

注:ES的http端口:9200 ,ES的java服务端口:9300

6、启动、停止服务


(1)、启动服务
su  elastic    #切换到elastic用户
cd /usr/local/elasticsearch/bin
./elasticsearch -d  #以后台进程启动
curl  localhost:9200 #测试访问
(2)、停止服务
ps -ef | grep elasticsearch | grep -v grep 
kill -9  [PID]


二、安装ik分词插件

1、上传elasticsearch-analysis-ik-6.8.10.zip 到centos服务器
2、cd /usr/local/elasticsearch/plugins && mkdir ik
3、unzip  elasticsearch-analysis-ik-6.8.10.zip  -d /usr/local/elasticsearch/plugins/ik/

三、安装ES的head插件

git clone https://github.com/mobz/elasticsearch-head.git
mv  elasticsearch-head  /usr/local/
cd /usr/local/elasticsearch-head/
cnpm install #安装依赖
npm start #启动服务(9100端口)

注意:修改elasticsearch服务器中elasticsearch.yml 配置
新加上以下2行配置(让head插件可以访问es):
http.cors.enabled:true  
http.cors.allow-origin: "*"  

浏览器打开:http://head服务器IP:9100,即可看到页面


四、安装Kibana-6.8.10(ES图形化工具)

tar -zxvf kibana-6.8.10-linux-x86_64.tar.gz  -C /usr/local/
cd /usr/local/
mv kibana-6.8.10-linux-x86_64  kibana
cd  kibana
vi config/kibana.yml ,修改如下

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
i18n.locale: "zh-CN"
启动kibana命令:
bin/kinana 或者 nohup  bin/kinana & (以后台进程启动)
浏览器打开 http://ip:5601 即可



关键字:  elasticsearch  ik  eshead  kibana
评论信息
暂无评论
发表评论

亲,您还没有登陆,暂不能评论哦! 去 登陆 | 注册

博主信息
   
数据加载中,请稍候...
文章分类
   
数据加载中,请稍候...
阅读排行
 
数据加载中,请稍候...
评论排行
 
数据加载中,请稍候...

Copyright © 叮叮声的奶酪 版权所有
备案号:鄂ICP备17018671号-1

鄂公网安备 42011102000739号