ES

在CentOS 6.x 中安装 ES 6.x

Posted by JustDoDT on July 23, 2019

安装ES

下载地址:https://www.elastic.co/downloads/past-releases/elasticsearch-6-6-2

修改配置文件  $ELASTICSEARCH_HOME/config/elasticsearch.yml 

修改或者添加如下内容
cluster.name: ruozedata-es-cluster
node.name: justdodt-node1
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"

CentOS 6.X 遇到的问题

https://blog.csdn.net/KingBoyWorld/article/details/77814528
下载ES的插件:https://github.com/mobz/elasticsearch-head
git clone https://github.com/mobz/elasticsearch-head.git
npm run start

启动elasticsearch-head

# 方法一:
[hadoop@hadoop001 bin]$ pwd
/home/hadoop/software/ELK/elasticsearch-head/node_modules/grunt/bin

[hadoop@hadoop001 bin]$ ./grunt server
# 方法二:
[hadoop@hadoop001 elasticsearch-head]$ node_modules/grunt/bin/grunt server &

在 elasticsearch.yml添加如下内容

http.cors.enabled: true
http.cors.allow-origin: "*"

注意:启动elasticsearch-head后,可能看不见健康状态,需要用具体的IP地址或者主机名,不要用http://localhost:9200/

也可以配置环境变量

export ELASTICSEARCH_HOME=/home/hadoop/app/elasticsearch-6.6.2
export PATH=${ELASTICSEARCH_HOME}/bin:$PATH

安装Kiban

下载地址:https://www.elastic.co/downloads/past-releases/kibana-6-6-2
参考 https://www.jianshu.com/p/d5fd38bfb0bb

启动

直接启动,进入bin目录后
./kibana

后台启动,进入bin目录后
nohup ./kibana &

也可以配置环境变量

export KIBANA_HOME=/home/hadoop/app/kibana-6.6.2-linux-x86_64
export PATH=${KIBANA_HOME}/bin:$PATH

安装 ES-SQL

# github上对应的版本地址
https://github.com/NLPchina/elasticsearch-sql/

# 下载和ES版本相同的ES-SQL插件
https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

离线安装es-sql

[hadoop@hadoop001 bin]$ elasticsearch-plugin install file:/home/hadoop/software/ELK/elasticsearch-sql-6.6.2.0.zip 

也可以在线安装es-sql

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.6.2.0/elasticsearch-sql-6.6.2.0.zip

并且还要安装es-sql-site-standalone.zip

# 插件下载地址:https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip

# 解压
unzip es-sql-site-standalone.zip -d ~/app/elasticsearch-6.6.2

# 安装
[hadoop@hadoop001 elasticsearch-6.6.2]$ cd site-server/
[hadoop@hadoop001 site-server]$ npm install express --save
[hadoop@hadoop001 site-server]$ node node-server.js

# 启动
[hadoop@hadoop001 site-server]$ node node-server.js   //默认端口是8080  

es-sql简单的使用

https://juejin.im/post/5c122057518825353624bdb2#heading-0