Centos7安装elasticsearch7.5.1 kibana7.5.1和elasticsearch-head - 简书


本站和网页 https://www.jianshu.com/p/4daee62a3195 的作者无关,不对其内容负责。快照谨为网络故障时之索引,不代表被搜索网站的即时页面。

Centos7安装elasticsearch7.5.1 kibana7.5.1和elasticsearch-head - 简书登录注册写文章首页下载APP会员IT技术Centos7安装elasticsearch7.5.1 kibana7.5.1和elasticsearch-headchenzan关注赞赏支持Centos7安装elasticsearch7.5.1 kibana7.5.1和elasticsearch-head环境
1.两个节点(centos7)
192.168.6.136(master)
192.168.6.137(node1)
2.安装包
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/kibana/kibana-7.5.1-linux-x86_64.tar.gz
https://nodejs.org/dist/v13.3.0/node-v13.3.0-linux-x64.tar.xz
安装
默认已安装jdk8
1.安装elasticsearch集群
修改配置
136master
配置hosts
vim /etc/hosts
192.168.6.136 master
192.168.6.137 node1
配置es
# cd /usr/soft/es
# mkdir logs
# mkdir data
# tar -zxvf elasticsearch-7.5.1-linux-x86_64.tar.gz
# mv elasticsearch-7.5.1-linux-x86_64 elasticsearch-7.5.1
############修改配置文件
# vi /elasticsearch-7.5.1/config/elasticsearch.yml
cluster.name: my-application# 集群名称
node.name: master # 节点名
network.host: 0.0.0.0 # 设置为0.0.0.0可以让任何计算机节点访问
discovery.zen.ping.unicast.hosts: ["192.168.6.136","192.168.6.137"]#hosts列表
discovery.zen.minimum_master_nodes: ["master"]
path.data: /usr/es/data
path.logs: /usr/es/logs
cluster.initial_master_nodes:["master"]
## 如下配置是为了解决 Elasticsearch可视化工具 跨域问题
http.port: 9200
http.cors.allow-origin: "*"
http.cors.enabled: true
137node
配置hosts
vim /etc/hosts
192.168.6.136 master
192.168.6.137 node1
配置es
# cd /usr/soft/es
# mkdir logs
# mkdir data
# tar -zxvf elasticsearch-7.5.1-linux-x86_64.tar.gz
# mv elasticsearch-7.5.1-linux-x86_64 elasticsearch-7.5.1
///修改配置文件
# vi /elasticsearch-7.5.1/conf/elasticsearch.yml
cluster.name: my-application# 集群名称
node.name: node1# 节点名
network.host: 0.0.0.0 # 设置为0.0.0.0可以让任何计算机节点访问
discovery.zen.ping.unicast.hosts: ["192.168.6.136","192.168.6.137"]#hosts列表
discovery.zen.minimum_master_nodes: ["master"]
path.data: /usr/es/data
path.logs: /usr/es/logs
cluster.initial_master_nodes:["master"]
## 如下配置是为了解决 Elasticsearch可视化工具 跨域问题
http.port: 9200
http.cors.allow-origin: "*"
http.cors.enabled: true
创建用户
# groupadd esUser
# useradd esUser -g esUser
# chown -R esUser:esUser /usr/es
修改配置(如果需要修改)
vi elasticsearch-7.5.1/config/jvm.options
#修改如下配置
-Xms512m
-Xmx512m
启动
切换用户,root用户无法启动
# su esUser
# /usr/es/elasticsearch-7.5.1/bin/elasticsearch -d //加-d后台启动
#设置开机自启动
# systemctl enable elasticsearch.service
访问
192.168.6.136:9200
image.png
2.安装elasticsearch-head
需要git nodejs
安装node和git
tar
# cd /usr/soft/node
# xz -d node-v12.14.0-linux-x64.tar.xz
# tar -xvf node-v12.14.0-linux-x64.tar
# mv node-v12.14.0-linux-x64-linux-x64 node-v12.14.0-linux-x64
///配置环境变量
# vi /etc/profile
export NODE_HOME=/usr/soft/node/node-v12
export PATH=$PATH:$NODE_HOME/bin
# source /etc/profile
///或者添加软连接
ln -s /usr/node/node-v12/bin/node /usr/bin/node
ln -s /usr/node/node-v12/bin/npm /usr/bin/npm
yum
///安装git
# yum install git
///下载
# git clone https://github.com/mobz/elasticsearch-head.git
///安装nodejs环境
# yum install nodejs
查看
# node -v
# npm -v
初始化
///安装 (elasticsearch-head目录下执行)
# npm install
如果报如下错误
Phantom installation failed { Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2:无法 exec: 没有那个文件或目录
yum install -y bzip2
配置
# cd elasticsearch-head
///修改Gruntfile.js
# vi Gruntfile.js
# connect:{
server:{
options:{
hostname: "192.168.6.136",//或者”*“表示所有
port: 9100,
base: '.',
keepalive: true
///修改elasticsearch-head默认连接地址
# cd elasticsearch-head/_site/
# vi app.js
将this.base_uri = this.config.base_uri ||
this.prefs.get("app-base_uri") || "http://localhost:9200";
中的localhost修改成服务器地址:192.168.6.136:9200
启动
1种
# cd elasticsearch-head
# npm run start
2种
# cd elasticsearch-head
# node_modules/grunt/bin/grunt server
访问192.168.6.136:9100
clipboard.png
3.安装kibana
# cd /usr/soft/kibana
# tar -xvf kibana-7.5.1-linux-x86_64.tar.gz
# mv kibana-7.5.1-linux-x86_64 kibana-7.5.1
配置
# cd /usr/soft/kibana/kibana-7.5.1
# vi /config/kibana.yml
server.port: 5601
server.host: "192.168.6.136"
server.name: "kibana.com"
elasticsearch.hosts: ["http://192.168.6.136:9200"]
kibana.index: ".kibana" # kibana会将部分数据写入es,这个是ex中索引的名字
///启动警告Generating a random key for xpack.reporting.encryptionKey. 添加
xpack.reporting.encryptionKey: "a_random_string"
xpack.security.encryptionKey: "something_at_least_32_characters"
启动
# cd /usr/soft/kibana/kibana-7.5.1
# /bin/kibana
///后台启动
# /bin/kibana &
访问 http://192.168.6.136:5601
clipboard.png
推荐阅读更多精彩内容ELKB5.2.2集群环境部署配置优化终极文档本人陆陆续续接触了ELK的1.4,2.0,2.4,5.0,5.2版本,可以说前面使用当中一直没有太多感触,最近使用...三杯水Plus阅读 3,884评论 0赞 12转载(ELK配置)1、ELK平台介绍 在搜索ELK资料的时候,发现这篇文章比较好,于是摘抄一小段:以下内容来自:http://bai...螺旋上升的世界阅读 2,768评论 0赞 20ELK(elasticsearch+logstash+redis+kibana)一、环境搭建 软件版本: Linux:centos7 64bit JDK:1.8.0 elasticsearch:...lailai900201阅读 3,350评论 0赞 12Elasticsearch 2.4.1 集群和插件安装 1 准备工作 服务器信息: 192.168.91.221 (elasticsearch-node1) 192.16...浅色的嗥啸阅读 2,476评论 2赞 9安装集群es和head,kinaba以及测试1安装elasticsearch集群 1.1三台机器都统一用户为es 172.31.100.114 172.31....龟龟51阅读 989评论 0赞 02018-08-02写文章[https://www.jianshu.com/writer#/] 一张图看懂Ulord JasonAI[...平安鼎和阅读 122评论 0赞 0[Luffy][第十二周-2019]▓▓▓░░░░░░░░░░░░ 22%——By @YearPogress 行业学习 持续+1。这一周如期摸了一下主...Luffy_Zhu阅读 88评论 0赞 0健康早知道健康早知道 这四气生不得 生一次毁一次乳腺 乳腺癌的病情高发,超过一半来自情绪的负能量。因为,一生气,气就走乳腺和...05a03bc6748d阅读 121评论 0赞 1你的样子--46天的宝贝亲爱的宝贝: 看着你越来越可爱的小脸,妈妈每次都忍不住的想亲亲你,今天的你吐奶比较多,可能是受凉了,不过吐完后,看...逃家小兔Emiliy阅读 42评论 0赞 1评论0赞11赞2赞赞赏更多好文