centos中安装ES6.8、ik分词器、eshead、kibana

一、安装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、启动、停止ES服务

(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 即可

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值