elasticsearch集群部署以及head插件安装
环境准备
elasticsearch是Java程序写的因此必须装jdk,否则使用不了。
[root@openstack ~]# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
| IP地址 | 主机名 | 系统 | 软件版本 |
| 192.168.209.6 | CFCA | rhel7.4 | elasticsearch-6.0.0/elasticsearch-head |
| 192.168.209.7 | openstack | rhel7.4 | elasticsearch-6.0.0/elasticsearch-head |
[root@openstack ~]# cd /usr/local/
[root@openstack local]# tar zxvf elasticsearch-6.0.0.tar.gz
[root@openstack local]# cd elasticsearch-6.0.0/
[root@openstack elasticsearch-6.0.0]# ll
总用量 224
drwxr-xr-x. 2 elasticsearch elasticsearch 4096 4月 1 21:56 bin #脚本
drwxr-xr-x. 2 elasticsearch elasticsearch 75 4月 2 13:48 config #配置文件
drwxr-xr-x. 2 elasticsearch elasticsearch 4096 11月 11 2017 lib
-rw-r--r--. 1 elasticsearch elasticsearch 11358 11月 11 2017 LICENSE.txt
drwxr-xr-x. 14 elasticsearch elasticsearch 251 11月 11 2017 modules
-rw-r--r--. 1 elasticsearch elasticsearch 193097 11月 11 2017 NOTICE.txt
drwxr-xr-x. 2 elasticsearch elasticsearch 6 11月 11 2017 plugins
-rw-r--r--. 1 elasticsearch elasticsearch 9326 11月 11 2017 README.textile
[root@openstack elasticsearch-6.0.0]# cd config/
[root@openstack config]# grep '^[a-z]' elasticsearch.yml 修改后的配置文件
cluster.name: my-application 集群名称
node.name: node-1 节点名称
path.data: /elk/data 数据存放路径
path.logs: /elk/logs 日志路径
bootstrap.memory_lock: true 内存锁定
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.209.6", "192.168.209.7"] 若是单节点的话此项配置注释掉
[root@openstack ~]# mkdir -p /elk/data/ /elk/logs/
[root@openstack ~]# useradd elasticsearch
[root@openstack ~]# chown -R elasticsearch:elasticsearch /elk/
[root@openstack ~]# chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-6.0.0
[root@openstack ~]# su - elasticsearch
[elasticsearch@openstack ~]$ cd /usr/local/elasticsearch-6.0.0/
[elasticsearch@openstack bin]$ ./elasticsearch -d 后台启动,此时启动不了,需要修改一下配置
[root@openstack ~]# vim /etc/security/limits.conf 重启参数才能生效
* hard nofile 65536
* soft nofile 65536
* soft memlock unlimited
* hard memlock unlimited
[root@openstack ~]# vim /etc/sysctl.conf
vm.max_map_count=262144
[root@openstack ~]# sysctl -p 参数生效
切换用户之后重新启动,查看进程和监听端口
[root@openstack ~]# ps -ef|grep java 查看进程
elastic+ 6750 1 1 12:29 pts/2 00:02:30 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/local/elasticsearch-6.0.0 -Des.path.conf=/usr/local/elasticsearch-6.0.0/config -cp /usr/local/elasticsearch-6.0.0/lib/* org.elasticsearch.bootstrap.Elasticsearch -d
[root@openstack ~]# netstat -tlunp|grep java 查看端口
tcp6 0 0 :::9200 :::* LISTEN 6750/java
tcp6 0 0 :::9300 :::* LISTEN 6750/java
[root@openstack ~]# curl 192.168.209.7:9200 查看信息
{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "Z3TOUu0jTUiCSHsuFJsv_g",
"version" : {
"number" : "6.0.0",
"build_hash" : "8f0685b",
"build_date" : "2017-11-10T18:41:22.859Z",
"build_snapshot" : false,
"lucene_version" : "7.0.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
另外一台机器也一样的配置,只是节点的名称的不一样。
安装head插件:
GitHub地址:https://github.com/mobz/elasticsearch-head
[root@openstack ~]# cd /usr/local/src/
[root@openstack src]# git clone git://github.com/mobz/elasticsearch-head.git
[root@openstack src]# ll
总用量 4
drwxr-xr-x. 7 root root 4096 4月 1 22:58 elasticsearch-head
[root@openstack src]# cd elasticsearch-head/
[root@openstack elasticsearch-head]# yum -y install npm
[root@openstack elasticsearch-head]# npm install grunt -save
[root@openstack elasticsearch-head]# ll -d node_modules/grunt #必须确认生成该文件
drwxr-xr-x. 5 root root 117 4月 1 23:28 node_modules/grunt
[root@openstack elasticsearch-head]# npm install #执行安装
[root@openstack elasticsearch-head]# npm run start & #后台启动
[root@openstack src]# vim /usr/local/elasticsearch-6.0.0/config/elasticsearch.yml 修改如下elasticsearch配置文件,并且重启该服务
http.cors.enabled: true
http.cors.allow-origin: "*"
查看一下进程和端口:
[root@openstack src]# netstat -tlunp|grep grunt
tcp 0 0 0.0.0.0:9100 0.0.0.0:* LISTEN 8911/grunt
[root@openstack src]# ps -ef|grep npm
root 8901 8749 0 15:42 pts/1 00:00:03 npm
可以在页面访问:
输入地址后就可以查看集群的信息了,带星号的是master

至此集群搭建完成,head插件也安装成功了。
elasticsearch集群部署以及head插件安装的更多相关文章
- Elasticsearch集群管理工具head插件安装
Elasticsearch-head是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序,你可以通过插件把它集成到es.或直接下载源码,在本地打开index.html ...
- Elasticsearch学习总结 (Centos7下Elasticsearch集群部署记录)
一. ElasticSearch简单介绍 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticse ...
- 我的ElasticSearch集群部署总结--大数据搜索引擎你不得不知
摘要:世上有三类书籍:1.介绍知识,2.阐述理论,3.工具书:世间也存在两类知识:1.技术,2.思想.以下是我在部署ElasticSearch集群时的经验总结,它们大体属于第一类知识“techknow ...
- Linux中Elasticsearch集群部署
1.下载安装包elasticsearch-6.3.1 安装包自己下载,网上很多 2.安装位置在cd /usr/local/elasticsearch/目录下 3.因为ES使用root权限运行会报错, ...
- elasticsearch集群部署
启动elk: zjtest7-redis:/usr/local/elasticsearch-2.3.4/bin# ./elasticsearch -d 后台运行 访问: http://192.168. ...
- elasticsearch集群管理工具head插件(转)
elasticsearch-head是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序,你可以通过插件把它集成到es 插件安装方法1: 1.elasticsearc ...
- elasticsearch 集群部署,版本 5.5.0
准备说明: 两台服务器 Ip分别为 192.168.239.78(主),192.168.239.49(从) 主服务器上配置如下:1.上传es5.5.0版本至主服务器2.解压 unzipunzip el ...
- Elasticsearch 集群部署
本文部署环境 $ cat /etc/redhat-release CentOS Linux release (Core) 部署前系统优化 $ /etc/security/limits.conf roo ...
- 谈一谈Elasticsearch的集群部署
Elasticsearch天生就支持分布式部署,通过集群部署可以提高系统的可用性.本文重点谈一谈Elasticsearch的集群节点相关问题,搞清楚这些是进行Elasticsearch集群部署和拓 ...
随机推荐
- hdu 6069 Counting divisors 公式+区间筛
比赛的时候把公式扣出来了,,但是没有想到用筛法算公因子,,默默学习一下.. 题解:设n=p1^(c1)p2^{c2}...pm^{cm},n=p1^c1*p2^c2...p ...
- django+uwsgi+nginx: websock 报502/400
耽搁了近2个月,终于解决了,主要是nginx/uwsgi/django相关的配置: 一.django工程settings.py,添加 WEBSOCKET_FACTORY_CLASS = "d ...
- linux 下使用opengl的glut库显示和旋转BMP图片
效果图: 这里显示的图和原图有明显的色差,目前猜测是opengl渲染时的颜色表顺序跟BMP文件里的颜色表顺序相反导致. BMP里应该是BGRBGRBRG... ,而opengl渲染时应该是按照RGBR ...
- PHP 多维数组将下标从0开始
点击链接加入群[php/web 学习课堂]:https://jq.qq.com/?_wv=1027&k=5645xiw 欢迎大家加入,一起讨论学习 模拟一个: public function ...
- Vector、HashTable线程不安全示例
下面这样写法是Vector线程不安全的写法: import java.util.Vector; public class Test { private static Vector<Integer ...
- 多进程编程——理论讲解与 multiprocessing 模块
多进程编程 import os pid = os .fork() 功能 :创建新的进程 参数: 无 返回值 :失败返回一个负数 成功:在原有进程中返回新的进程的PID号 在新进程中返回为0* 子进程会 ...
- Linux ppp 数据收发流程
转:http://blog.csdn.net/yangzheng_yz/article/details/11526671 PPP (Point-to-Point)提供了一种标准的方法在点对点的连接上传 ...
- 6.Tray Monitor服务(监控服务)
1. Tray Monitor服务(监控服务) 该服务需要运行在gui环境下,用于查看baclua client.存储等状态.下面以windows下安装为例. 1.1. Tray Monito ...
- HLS manifest standard 翻译: HTTP Live Streaming draft-pantos-http-live-streaming-23
我为什么要干这种事 Introduction to HTTP Live Streaming 1 OVerview Multimedia presentation : specified by a Un ...
- 一篇关于ajax跨域问题的解决方案
这几天没事,我有一个好友,让我帮他做一个机器人对话demo, 我说 看看有没有时间(其实自己一脸懵逼) 然后百度了一下,发现了一个机器人 -(连接就不弄出来了,可以私底下交流) ,,我是用这个的 好 ...