elasticsearch下载地址:
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.1-linux-x86_64.tar.gz
Elasticsearch目录结构
启动单节点服务
[www@localhost config]$ grep -Ev "^#|^$" ./elasticsearch.yml node.name: node-1 path.data: /www/elasticsearch/data network.host: 0.0.0.0 http.port: 9200 discovery.seed_hosts: ["127.0.0.1"] cluster.initial_master_nodes: ["node-1"]
启动成功界面:
访问web界面
kibana环境
下载地址(下载对应版本的kibana):https://www.elastic.co/cn/downloads/past-releases/kibana-7-10-0
启动服务:(从版本6.0.0开始,Kibana仅支持64位操作系统。)
[www@localhost kibana-7.10.1-linux-x86_64]$ grep -Ev "^#|^$" ./config/kibana.yml server.port: 5601 server.host: "0.0.0.0" server.name: "my-kibana" elasticsearch.hosts: ["http://localhost:9200"]
验证服务启动成功:http://localhost:5601
命令行关闭kibana:
关闭窗口 ps -ef | grep 5601 或者 ps -ef | grep kibana 或者 lsof -i :5601 kill -9 pid
Head插件安装
(1) 下载node: ① 下载地址:https://nodejs.org/en/download/ ② 检查是否安装成功:Win+R CMD输入“node -v”命令检查,如果输出了版本号,则node安装成功
下载地址:
https://nodejs.org/download/release/latest-v14.x/
https://github.com/nodejs/release#release-schedule
配置环境变量
JAVA_HOME=/opt/soft/jdk1.8.0_181 JRE_HOME=/opt/soft/jdk1.8.0_181/jre NODE_HOME=/opt/soft/node-v14.21.2-linux-x64 PATH=/opt/soft/jdk1.8.0_181/bin:/opt/soft/jdk1.8.0_181/jre/bin:/application/mysql/bin/:$NODE_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME export JRE_HOME export NODE_HOME export CLASSPATH export PATH export _JAVA_OPTIONS="-Xms512m -Xmx512m -Xmn126m" ulimit -SHn 100000 export PATH=/application/mysql/bin:$PATH
[root@localhost ~]# node -v v14.21.2
[root@localhost ~]# npm install -g grunt-cli /opt/soft/node-v14.21.2-linux-x64/bin/grunt -> /opt/soft/node-v14.21.2-linux-x64/lib/node_modules/grunt-cli/bin/grunt + grunt-cli@1.4.3 added 59 packages from 71 contributors in 26.125s [root@localhost ~]# grunt -version grunt-cli v1.4.3
git clone https://github.com/mobz/elasticsearch-head.git cd elasticsearch-head/ #通过阿里巴巴源安装cnpm npm install -g cnpm --registry=https://registry.npm.taobao.org cnpm install 启动es-head插件 #必须进入es-head插件目录运行启动命令 cd elasticsearch-head/ cnpm run start
如果无法发现ES节点,尝试在ES配置文件中设置允许跨域 http.cors.enabled: true http.cors.allow-origin: "*"
集群的健康值检查
本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/p/16964327.html