圣凤凌霜 发表于 2019-1-28 14:27:50

ELK 实验(七)Elasticsearch 集群管理

  Head 插件
  head插件是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序。
  Github:
  https://github.com/mobz/elasticsearch-head
  git clone https://github.com/mobz/elasticsearch-head.git
  安装
  ./elasticsearch plugin -install /usr/elasticsearch-head
http://i2.运维网.com/images/blog/201804/20/0b83f4493e5024bf78458d251641b3d7.jpg
  新版本不支持plugin 直接安装
  安装nodejs
  yum install nodejs -y
  居然还没有nodejs
  去官网下一个
  https://nodejs.org/en/download/package-manager/
  curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
http://i2.运维网.com/images/blog/201804/20/86be0e0cf5bb8c5017d9338b216f3800.jpg
  再来
  yum install -y nodejs
  yum install -y gcc-c++ make
  就有了,17M
http://i2.运维网.com/images/blog/201804/20/2a37bf350661220d43b8a021889d120d.jpg
http://i2.运维网.com/images/blog/201804/20/1462f63f9356dd73ce6a63ee20fe4802.jpg
  验证下安装
  node -v
  npm -v
http://i2.运维网.com/images/blog/201804/20/04e213cae3bcc2b838aa9f7000e956fa.jpg
  使用国内淘宝源安装grunt
  cd elasticsearch-head/
  npm install -g grunt --registry=https://registry.npm.taobao.org
http://i2.运维网.com/images/blog/201804/20/b25ffa5093a64e7f00a0cd0029772a57.jpg
http://i2.运维网.com/images/blog/201804/20/a7c382ad4f307abe66e50e45b1fc9c82.jpg
  npm install grunt --save
  看看安装好了么
  ls -d node_modules/grunt
http://i2.运维网.com/images/blog/201804/20/5d6493e3f5ec47802644515214069f19.jpg
  npm install -g grunt-cli --registry=https://registry.npm.taobao.org
http://i2.运维网.com/images/blog/201804/20/2d24fb113c6310917cc98eac2784300e.jpg
  npm install --registry=https://registry.npm.taobao.org
http://i2.运维网.com/images/blog/201804/20/443b2e66e879bc229af8a0d5f784681a.jpg
  出错鸟,连接被拒绝了,容我修个错误
  PhantomJS not found on PATH 目录下没找到,去下载的时候在github被拒绝了,伟大的墙。习主席说什么来着,智者造桥,愚者造墙。
  代码分支了
  https://www.npmjs.com/package/phantomjs-prebuilt
  npm install phantomjs-prebuilt
  node ./install.js
http://i2.运维网.com/images/blog/201804/20/65d84ce7dc05f2780707d030d8f6a181.jpg
  /usr/elasticsearch-6.2.3/plugins/elasticsearch-head
  vi Gruntfile.js
  hostname: '*', #增加此行
http://i2.运维网.com/images/blog/201804/20/9e81bfea9f574de2a4496ffaa3fb4eb8.jpg
  vi _site/app.js
  更新这句
  this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.209.168:9200";
  启动服务
  # grunt server
http://i2.运维网.com/images/blog/201804/20/7359e8c17fce87f3000c38d6673000d2.jpg
  有文件头
  curl -i localhost:9100
http://i2.运维网.com/images/blog/201804/20/ac4249b0c9963a2d32b2c9df76fb9f8b.jpg
  http://192.168.209.168:9100/
http://i2.运维网.com/images/blog/201804/20/d2ffdbde93ba53fa5eb81df533fcaa49.jpg
  但是集群显示未连接
  vi /usr/elasticsearch-6.2.3/config/elasticsearch.yml
  http.cors.enabled: true
  http.cors.allow-origin: "*"
  加两句在启动下就好了
http://i2.运维网.com/images/blog/201804/20/145a0f0fff5705594d1637c54fdc4e9f.jpg



页: [1]
查看完整版本: ELK 实验(七)Elasticsearch 集群管理