ES学习经历二,安装head插件

//安装ES插件head,elasticsearch head插件是一个入门级的前端插件
[BEGIN] 2018/2/1 11:43:06
[2018/2/1 11:43:06] Last login: Thu Feb  1 00:30:47 2018
[2018/2/1 11:47:00] [root@bogon /]# find / -name es
[2018/2/1 11:47:00] /var/cache/man/es
[2018/2/1 11:47:00] /usr/share/locale/es
[2018/2/1 11:47:00] /usr/share/man/es
[2018/2/1 11:47:00] /home/tomcat/apache-tomcat-8.5.27/webapps/pams-1.0/static/ckfinder/help/es
[2018/2/1 11:47:00] /home/es
[2018/2/1 11:47:19] [root@bogon /]# cd /home/es/elasticsearch-5.5.2/
[2018/2/1 11:50:12] [root@bogon elasticsearch-5.5.2]# su elastic
[2018/2/1 11:50:24] [elastic@bogon elasticsearch-5.5.2]$ ll
[2018/2/1 11:50:24] 总用量 232
[2018/2/1 11:50:24] drwxr-xr-x.  2 elastic elastic   4096 1月  31 23:51 bin
[2018/2/1 11:50:24] drwxr-xr-x.  3 elastic elastic     86 2月   1 00:14 config
[2018/2/1 11:50:24] drwxrwxr-x.  3 elastic elastic     18 2月   1 00:03 data
[2018/2/1 11:50:24] drwxr-xr-x.  2 elastic elastic   4096 1月  31 23:51 lib
[2018/2/1 11:50:24] -rw-r--r--.  1 elastic elastic  11358 1月  31 23:51 LICENSE.txt
[2018/2/1 11:50:24] drwxr-xr-x.  2 elastic elastic   4096 2月   1 00:03 logs
[2018/2/1 11:50:24] drwxr-xr-x. 13 elastic elastic   4096 1月  31 23:51 modules
[2018/2/1 11:50:24] -rw-r--r--.  1 elastic elastic 194187 1月  31 23:51 NOTICE.txt
[2018/2/1 11:50:24] drwxr-xr-x.  2 elastic elastic      6 1月  31 23:51 plugins
[2018/2/1 11:50:24] -rw-r--r--.  1 elastic elastic   9549 1月  31 23:51 README.textile
//head插件是nodejs实现的,所以必须先安装Nodejs,去官网直接下载编译好的二进制文件,文件下载在/usr/local/ 
[2018/2/1 14:36:43] [root@bogon local]# wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz
[2018/2/1 14:36:43] --2018-02-01 22:36:43--  https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz
[2018/2/1 14:36:43] 正在解析主机 nodejs.org (nodejs.org)... 104.20.23.46, 104.20.22.46, 2400:cb00:2048:1::6814:172e, ...
[2018/2/1 14:36:44] 正在连接 nodejs.org (nodejs.org)|104.20.23.46|:443... 已连接。
[2018/2/1 14:36:45] 已发出 HTTP 请求,正在等待回应... 200 OK
[2018/2/1 14:36:45] 长度:11410120 (11M) [application/x-xz]
[2018/2/1 14:36:45] 正在保存至: “node-v8.9.4-linux-x64.tar.xz”
[2018/2/1 14:36:45] 
[2018/2/1 14:50:40] 100%[==============================================================================================================>] 11,410,120  14.7KB/s 用时 13m 55s
[2018/2/1 14:50:40] 
[2018/2/1 14:50:40] 2018-02-01 22:50:40 (13.3 KB/s) - 已保存 “node-v8.9.4-linux-x64.tar.xz” [11410120/11410120])
[2018/2/1 14:50:40] 
[2018/2/1 14:52:46] [root@bogon local]# ll
[2018/2/1 14:52:46] 总用量 11148
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root       26 1月  30 23:26 bin
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 etc
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 games
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 include
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 lib
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 lib64
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 libexec
[2018/2/1 14:52:46] -rw-r--r--.  1 root root 11410120 1月   3 10:24 node-v8.9.4-linux-x64.tar.xz
[2018/2/1 14:52:46] drwxr-xr-x.  3 root root       33 1月  31 17:35 redis
[2018/2/1 14:52:46] drwxrwsr-x. 25 root rvm      4096 1月  30 23:47 rvm
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 sbin
[2018/2/1 14:52:46] drwxr-xr-x.  6 root root       57 1月  30 23:21 share
[2018/2/1 14:52:46] drwxr-xr-x.  2 root root        6 6月  10 2014 src
//这个压缩格式比较少见,解压命令是百度查到的
[2018/2/1 14:54:04] [root@bogon local]# tar -xJf node-v8.9.4-linux-x64.tar.xz 
[2018/2/1 14:54:40] [root@bogon local]# ll
[2018/2/1 14:54:40] 总用量 11148
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root       26 1月  30 23:26 bin
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 etc
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 games
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 include
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 lib
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 lib64
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 libexec
[2018/2/1 14:54:40] drwxrwxr-x.  6  500  500      101 1月   3 10:23 node-v8.9.4-linux-x64
[2018/2/1 14:54:40] -rw-r--r--.  1 root root 11410120 1月   3 10:24 node-v8.9.4-linux-x64.tar.xz
[2018/2/1 14:54:40] drwxr-xr-x.  3 root root       33 1月  31 17:35 redis
[2018/2/1 14:54:40] drwxrwsr-x. 25 root rvm      4096 1月  30 23:47 rvm
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 sbin
[2018/2/1 14:54:40] drwxr-xr-x.  6 root root       57 1月  30 23:21 share
[2018/2/1 14:54:40] drwxr-xr-x.  2 root root        6 6月  10 2014 src
//类似于jre,需要配置环境,在文件最后加上:
//export NODE_HOME=/usr/local/node-v8.9.1-linux-x64
//export PATH=$NODE_HOME/bin:$PATH
[root@bogon local]# vi /etc/profile
//重新执行配置文件
[2018/2/1 14:57:54] [root@bogon local]# source /etc/profile
//老版本的nodejs是不自带的npm工具的( NPM是随同NodeJS一起安装的包管理工具,能解决NodeJS代码部署上的很多问题),新版本带有npm 所以不用再安装
//查看版本,证明配置完成 
[2018/2/1 14:58:13] [root@bogon local]# node -v
[2018/2/1 14:58:13] v8.9.4    
[2018/2/1 14:58:23] [root@bogon local]# npm -v
[2018/2/1 14:58:29] 5.6.0
//因为head插件不是官方推出的,所以不能用yum命令直接下载,它目前挂靠在git下。所以用git方式下载head插件,这里先下载git
[2018/2/1 15:00:14] [root@bogon local]# yum install -y git
[2018/2/1 15:00:16] 已加载插件:fastestmirror
…………
[2018/2/1 15:01:01] 完毕!
//查看是否安装完成
[2018/2/1 15:02:28] [root@bogon local]# git --version
[2018/2/1 15:02:28] git version 1.8.3.1
//从git下载head插件
[2018/2/1 15:03:29] [root@bogon local]# git clone git://github.com/mobz/elasticsearch-head.git
[2018/2/1 15:03:29] 正克隆到 'elasticsearch-head'...
[2018/2/1 15:03:31] remote: Counting objects: 4224, done.
[2018/2/1 15:03:49] remote: Total 4224 (delta 0), reused 0 (delta 0), pack-reused 4224
[2018/2/1 15:03:49] 接收对象中: 100% (4224/4224), 2.16 MiB | 332.00 KiB/s, done.
[2018/2/1 15:03:49] 处理 delta 中: 100% (2329/2329), done.
[2018/2/1 15:04:57] [root@bogon local]# ll
[2018/2/1 15:04:57] 总用量 11152
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root       26 1月  30 23:26 bin
[2018/2/1 15:04:57] drwxrwxr-x.  7 root root     4096 2月   1 23:03 elasticsearch-head
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 etc
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 games
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 include
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 lib
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 lib64
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 libexec
[2018/2/1 15:04:57] drwxrwxr-x.  6  500  500      101 1月   3 10:23 node-v8.9.4-linux-x64
[2018/2/1 15:04:57] -rw-r--r--.  1 root root 11410120 1月   3 10:24 node-v8.9.4-linux-x64.tar.xz
[2018/2/1 15:04:57] drwxr-xr-x.  3 root root       33 1月  31 17:35 redis
[2018/2/1 15:04:57] drwxrwsr-x. 25 root rvm      4096 1月  30 23:47 rvm
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 sbin
[2018/2/1 15:04:57] drwxr-xr-x.  6 root root       57 1月  30 23:21 share
[2018/2/1 15:04:57] drwxr-xr-x.  2 root root        6 6月  10 2014 src
//进入head插件目录,进行安装
[2018/2/1 15:05:08] [root@bogon local]# cd elasticsearch-head
[2018/2/1 15:05:17] [root@bogon elasticsearch-head]# npm install
[2018/2/1 15:05:21] npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
[2018/2/1 15:05:23] npm WARN deprecated [email protected]: Use the built-in module in node 9.0.0 or newer, instead
[2018/2/1 15:06:25] 
[2018/2/1 15:06:25] > [email protected] install /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt
[2018/2/1 15:06:25] > node install.js
[2018/2/1 15:06:25] 
[2018/2/1 15:06:31] PhantomJS not found on PATH
[2018/2/1 15:06:31] Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
[2018/2/1 15:06:31] Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
[2018/2/1 15:06:31] Receiving...
[2018/2/1 15:15:09]   [========================================] 100%
[2018/2/1 15:15:10] Received 22866K total.
[2018/2/1 15:15:10] Extracting tar contents (via spawned process)
[2018/2/1 15:15:21] Removing /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
[2018/2/1 15:15:21] Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1517498110498/phantomjs-2.1.1-linux-x86_64 -> /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
[2018/2/1 15:15:21] Phantom installation failed { Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1517498110498/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
[2018/2/1 15:15:21]   errno: -13,
[2018/2/1 15:15:21]   code: 'EACCES',
[2018/2/1 15:15:21]   syscall: 'link',
[2018/2/1 15:15:21]   path: '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1517498110498/phantomjs-2.1.1-linux-x86_64',
[2018/2/1 15:15:21]   dest: '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1517498110498/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom'
[2018/2/1 15:15:22] npm WARN [email protected] license should be a valid SPDX license expression
[2018/2/1 15:15:22] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
[2018/2/1 15:15:22] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[2018/2/1 15:15:22] 
[2018/2/1 15:15:22] npm ERR! code ELIFECYCLE
[2018/2/1 15:15:22] npm ERR! errno 1
[2018/2/1 15:15:22] npm ERR! [email protected] install: `node install.js`
[2018/2/1 15:15:22] npm ERR! Exit status 1
[2018/2/1 15:15:22] npm ERR! 
[2018/2/1 15:15:22] npm ERR! Failed at the [email protected] install script.
[2018/2/1 15:15:22] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2018/2/1 15:15:23] 
[2018/2/1 15:15:23] npm ERR! A complete log of this run can be found in:
[2018/2/1 15:15:23] npm ERR!     /root/.npm/_logs/2018-02-01T15_15_22_780Z-debug.log
//这里发生了很不幸的事情,安装报错,更不幸的是本人对英语没有好感,依赖性的直接百度谷歌了错误,其中一种方法是通过淘宝镜像下载,但还是没有解决
[2018/2/1 15:54:57] [root@bogon elasticsearch-head]# npm install -g cnpm --registry=https://registry.npm.taobao.org
[2018/2/1 16:00:27] npm ERR! code EAI_AGAIN
[2018/2/1 16:00:27] npm ERR! errno EAI_AGAIN
[2018/2/1 16:00:27] npm ERR! request to https://cdn.npm.taobao.org/cli-spinners/-/cli-spinners-1.1.0.tgz failed, reason: getaddrinfo EAI_AGAIN cdn.npm.taobao.org:443
[2018/2/1 16:00:32] 
[2018/2/1 16:00:32] npm ERR! A complete log of this run can be found in:
[2018/2/1 16:00:32] npm ERR!     /root/.npm/_logs/2018-02-01T16_00_27_877Z-debug.log
//来来往往折腾了一个小时,最后不得不耐下心自己看报错,才发现就一个简单的权限问题,
//[2018/2/1 15:04:57] drwxrwxr-x.  6  500  500      101 1月   3 10:23 node-v8.9.4-linux-x64
//解压得到的文件所属是500(不知道什么东西),改成root即可
[2018/2/1 16:24:54] [root@bogon elasticsearch-head]# chown root:root -R /usr/local/node-v8.9.4-linux-x64
[2018/2/1 16:24:59] [root@bogon elasticsearch-head]# ll
[2018/2/1 16:24:59] 总用量 64
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   248 2月   1 23:03 Dockerfile
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   221 2月   1 23:03 Dockerfile-alpine
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   104 2月   1 23:03 elasticsearch-head.sublime-project
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root  2171 2月   1 23:03 Gruntfile.js
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root  3482 2月   1 23:03 grunt_fileSets.js
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root  1088 2月   1 23:03 index.html
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   559 2月   1 23:03 LICENCE
[2018/2/1 16:24:59] drwxr-xr-x. 260 root root 12288 2月   2 00:15 node_modules
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   886 2月   1 23:03 package.json
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root   100 2月   1 23:03 plugin-descriptor.properties
[2018/2/1 16:24:59] drwxrwxr-x.   4 root root    50 2月   1 23:03 proxy
[2018/2/1 16:24:59] -rw-rw-r--.   1 root root  6944 2月   1 23:03 README.textile
[2018/2/1 16:24:59] drwxrwxr-x.   5 root root  4096 2月   1 23:03 _site
[2018/2/1 16:24:59] drwxrwxr-x.   4 root root    29 2月   1 23:03 src
[2018/2/1 16:24:59] drwxrwxr-x.   4 root root    66 2月   1 23:03 test
//安装成功
[2018/2/1 16:25:15] [root@bogon local]# npm install
[2018/2/1 16:25:16] npm WARN saveError ENOENT: no such file or directory, open '/usr/local/package.json'
[2018/2/1 16:25:16] npm notice created a lockfile as package-lock.json. You should commit this file.
[2018/2/1 16:25:16] npm WARN enoent ENOENT: no such file or directory, open '/usr/local/package.json'
[2018/2/1 16:25:16] npm WARN local No description
[2018/2/1 16:25:16] npm WARN local No repository field.
[2018/2/1 16:25:16] npm WARN local No README data
[2018/2/1 16:25:16] npm WARN local No license field.
[2018/2/1 16:25:16] 
[2018/2/1 16:25:16] up to date in 0.1s
[2018/2/1 16:25:33] [root@bogon local]# cd elasticsearch-head/
[2018/2/1 16:25:37] [root@bogon elasticsearch-head]# npm install
[2018/2/1 16:26:20] npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/hasha failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
[2018/2/1 16:26:20] npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
[2018/2/1 16:26:31] 
[2018/2/1 16:26:31] > [email protected] install /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt
[2018/2/1 16:26:31] > node install.js
[2018/2/1 16:26:31] 
[2018/2/1 16:26:32] PhantomJS not found on PATH
[2018/2/1 16:26:32] Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
[2018/2/1 16:26:32] Verified checksum of previously downloaded file
[2018/2/1 16:26:32] Extracting tar contents (via spawned process)
[2018/2/1 16:26:37] Removing /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
[2018/2/1 16:26:37] Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1517502392369/phantomjs-2.1.1-linux-x86_64 -> /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom
[2018/2/1 16:26:40] Writing location.js file
[2018/2/1 16:26:40] Done. Phantomjs binary available at /usr/local/elasticsearch-head/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
[2018/2/1 16:26:41] npm notice created a lockfile as package-lock.json. You should commit this file.
[2018/2/1 16:26:41] npm WARN [email protected] license should be a valid SPDX license expression
[2018/2/1 16:26:41] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
[2018/2/1 16:26:41] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[2018/2/1 16:26:41] 
[2018/2/1 16:26:41] added 70 packages in 62.699s
//启动head插件
[2018/2/1 16:27:46] [root@bogon elasticsearch-head]# npm run start
[2018/2/1 16:27:47] 
[2018/2/1 16:27:47] > [email protected] start /usr/local/elasticsearch-head
[2018/2/1 16:27:47] > grunt server
[2018/2/1 16:27:47] 
[2018/2/1 16:27:49] (node:15034) ExperimentalWarning: The http2 module is an experimental API.
[2018/2/1 16:27:49] Running "connect:server" (connect) task
[2018/2/1 16:27:49] Waiting forever...
[2018/2/1 16:27:49] Started connect web server on http://localhost:9100
//在浏览器访问,ie为核心的,ie9以下无法正常显示。我这里用火狐访问,访问失败,原因是9100端口没有开放,这里处理方式是关闭整个防火墙
[2018/2/1 16:29:35] ^C[root@bogon elasticsearch-head]# systemctl stop firewalld.service
[2018/2/1 16:30:24] [root@bogon elasticsearch-head]# firewall-cmd --state 
[2018/2/1 16:30:25] not running
[2018/2/1 16:30:38] [root@bogon elasticsearch-head]# systemctl disable firewalld.service
[2018/2/1 16:30:38] Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[2018/2/1 16:30:38] Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[2018/2/1 16:30:57] [root@bogon elasticsearch-head]# npm run start
[2018/2/1 16:30:57] 
[2018/2/1 16:30:57] > [email protected] start /usr/local/elasticsearch-head
[2018/2/1 16:30:57] > grunt server
[2018/2/1 16:30:57] 
[2018/2/1 16:30:58] (node:15174) ExperimentalWarning: The http2 module is an experimental API.
[2018/2/1 16:30:58] Running "connect:server" (connect) task
[2018/2/1 16:30:58] Waiting forever...
[2018/2/1 16:30:58] Started connect web server on http://localhost:9100
//以下是可能遇到的错误
//没有在head目录下启动,报错
[2018/2/1 16:47:07] [root@bogon elasticsearch-5.5.2]# npm run start
[2018/2/1 16:47:09] npm ERR! path /home/es/elasticsearch-5.5.2/package.json
[2018/2/1 16:47:09] npm ERR! code ENOENT
[2018/2/1 16:47:09] npm ERR! errno -2
[2018/2/1 16:47:09] npm ERR! syscall open
[2018/2/1 16:47:09] npm ERR! enoent ENOENT: no such file or directory, open '/home/es/elasticsearch-5.5.2/package.json'
[2018/2/1 16:47:09] npm ERR! enoent This is related to npm not being able to find a file.
[2018/2/1 16:47:09] npm ERR! enoent  
[2018/2/1 16:47:09] npm ERR! A complete log of this run can be found in:
[2018/2/1 16:47:09] npm ERR!     /root/.npm/_logs/2018-02-01T16_47_09_382Z-debug.log


//以下是防火墙常用操作
//关闭防火墙
[2018/2/1 16:29:35] [root@bogon elasticsearch-head]# systemctl stop firewalld.service
//开机不启动防火墙
[2018/2/1 16:30:38] [root@bogon elasticsearch-head]# systemctl disable firewalld.service
//查看防火墙状态
[2018/2/1 16:51:05] [root@bogon elasticsearch-head]# firewall-cmd --state
[2018/2/1 16:51:06] not running      
//开启防火墙
[2018/2/1 16:59:16] [root@bogon elasticsearch-head]# systemctl start firewalld.service
[2018/2/1 16:59:34] [root@bogon elasticsearch-head]# firewall-cmd --state
[2018/2/1 16:59:34] running
//查看防火墙开放的端口
[2018/2/1 16:59:53] [root@bogon elasticsearch-head]# firewall-cmd --zone=public --list-ports
[2018/2/1 16:59:53] 9200/tcp 7003/tcp 7002/tcp 3306/tcp 24/tcp 7006/tcp 21/tcp 7001/tcp 80/tcp 7005/tcp 7004/tcp 22/tcp 6379/tcp 9300/tcp
//开放指定端口
[2018/2/1 17:00:09] [root@bogon elasticsearch-head]# firewall-cmd --zone=public --add-port=9100/tcp --permanent
[2018/2/1 17:00:09] success
//防火墙重启
[2018/2/1 17:00:18] [root@bogon elasticsearch-head]# firewall-cmd --reload
[2018/2/1 17:00:20] success

ES学习经历二,安装head插件_第1张图片

你可能感兴趣的:(linux,ES)