es 集群部署
下载
[root@localhost ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.1.rpm
jdk 安装
[root@localhost ~]# yum -y install jdk-8u171-linux-x64.rpm
安装es
[root@localhost ~]# yum -y install elasticsearch-6.5.1.rpm
创建data与logs目录
[root@localhost ~]# mkdir -pv /es/{data,logs}
mkdir: 已创建目录 "/es"
mkdir: 已创建目录 "/es/data"
mkdir: 已创建目录 "/es/logs"
修改目录属主属组
[root@localhost ~]# chown elasticsearch:elasticsearch /es -R
备份修改配置文件
[root@localhost ~]# cp -a /etc/elasticsearch/elasticsearch.yml{,.bak}
1节点配置
[root@localhost ~]# egrep -v "^#|^$" /etc/elasticsearch/elasticsearch.yml
cluster.name: es
node.name: es-1
path.data: /es/data
path.logs: /es/logs
network.host: 192.168.10.31
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.10.31", "192.168.10.60"]
2节点配置
[root@localhost ~]# egrep -v "^#|^$" /etc/elasticsearch/elasticsearch.yml
cluster.name: es
node.name: es-2
path.data: /data/es
path.logs: /data/logs
network.host: 192.168.10.60
discovery.zen.ping.unicast.hosts: ["192.168.10.31", "192.168.10.60"]
启动服务
[root@localhost ~]# systemctl start elasticsearch.service
[root@localhost ~]# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: active (running) since 三 2018-12-05 16:30:08 CST; 25s ago
Docs: http://www.elastic.co
Main PID: 3926 (java)
CGroup: /system.slice/elasticsearch.service
└─3926 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=tr... 12月 05 16:30:08 localhost.localdomain systemd[1]: Started Elasticsearch.
12月 05 16:30:08 localhost.localdomain systemd[1]: Starting Elasticsearch... [root@localhost ~]# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: active (running) since 三 2018-12-05 16:29:50 CST; 1min 8s ago
Docs: http://www.elastic.co
Main PID: 3883 (java)
CGroup: /system.slice/elasticsearch.service
├─3883 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=tr...
└─3947 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller 12月 05 16:29:50 localhost.localdomain systemd[1]: Started Elasticsearch.
12月 05 16:29:50 localhost.localdomain systemd[1]: Starting Elasticsearch...
安装node环境
mkdir /opt/es/node -pv
cd /opt/es/node/
wget https://npm.taobao.org/mirrors/node/v8.1.4/node-v8.1.4-linux-x64.tar.gz
tar xf node-v8.1.4-linux-x64.tar.gz
vim /etc/profile.d/node.sh
export NODE_HOME=/opt/es/node/node-v8.1.4-linux-x64
export PATH=$NODE_HOME/bin:$PATH
. /etc/profile.d/node.sh
安装haed插件
cd
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
yum -y install unzip
unzip master.zip
cd elasticsearch-head-master/
[root@localhost elasticsearch-head-master]# vim Gruntfile.js 79 files: ['src/**/*', 'test/spec/*' ],
80 tasks: ['default'],
81 options: {
82 spawn: false
83 }
84 },
85 "grunt": {
86 files: [ 'Gruntfile.js' ]
87 }
88 },
89
90 connect: {
91 server: {
92 options: {
93 port: 9100,
94 hostname: '0.0.0.0', 添加此行
95 base: '.',
96 keepalive: true
97 }
98 }
99 }
100
101 });
[root@localhost elasticsearch-head-master]# cd _site/
[root@localhost _site]# vim app.js 4339
4340 })( this.jQuery, this.app, this.i18n );
4341
4342 (function( app, i18n ) {
4343
4344 var ui = app.ns("ui");
4345 var services = app.ns("services");
4346
4347 app.App = ui.AbstractWidget.extend({
4348 defaults: {
4349 base_uri: null
4350 },
4351 init: function(parent) {
4352 this._super();
4353 this.prefs = services.Preferences.instance();
4354 this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.10.31:9200"; 设置1节点IP
4355 if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
4356 // XHR request fails if the URL is not ending with a "/"
4357 this.base_uri += "/";
4358 }
4359 if( this.config.auth_user ) {
4360 var credentials = window.btoa( this.config.auth_user + ":" + this.config.auth_password );
4361 $.ajaxSetup({
4362 headers: {
4363 "Authorization": "Basic " + credentials
4364 }
4365 });
4366 }
4367 this.cluster = new services.Cluster({ base_uri: this.base_uri });
4368 this._clusterState = new services.ClusterState({
4369 cluster: this.cluster
[root@localhost _site]# cd ../../
[root@localhost ~]# cd elasticsearch-head-master/
[root@localhost elasticsearch-head-master]# npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + phantomjs-prebuilt@2.1.16
added 81 packages in 32.987s
[root@localhost elasticsearch-head-master]# npm install
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=3.10.1 - Run `npm i npm@latest -g`
to upgrade your npm version, and then `npm audit` to get more info.npm WARN deprecated coffee-script@1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=2.4.2 - Run `npm i npm@latest -g`
to upgrade your npm version, and then `npm audit` to get more info.npm WARN deprecated http2@3.3.7: Use the built-in module in node 9.0.0 or newer, instead
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=4.3.0 - Run `npm i npm@latest -g`
to upgrade your npm version, and then `npm audit` to get more info.npm WARN notice [SECURITY] ws has the following vulnerabilities: 2 high. Go here for more details: https://nodesecurity.io/advisories?search=ws&version=1.0.1 - Run `npm i npm@latest -g` to up
grade your npm version, and then `npm audit` to get more info.npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.2.0 - Run `npm i npm@latest -g` to
upgrade your npm version, and then `npm audit` to get more info.npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=0.7.4 - Run `npm i npm@latest -g` to
upgrade your npm version, and then `npm audit` to get more info.npm WARN notice [SECURITY] parsejson has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=parsejson&version=0.0.1 - Run `npm i npm@late
st -g` to upgrade your npm version, and then `npm audit` to get more info.npm WARN notice [SECURITY] negotiator has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=negotiator&version=0.4.9 - Run `npm i npm@la
test -g` to upgrade your npm version, and then `npm audit` to get more info.npm WARN prefer global coffee-script@1.10.0 should be installed with -g > fsevents@1.2.4 install /root/elasticsearch-head-master/node_modules/fsevents
> node install npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression added 495 packages in 115.929s
[root@localhost elasticsearch-head-master]# npm install grunt-cli
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression + grunt-cli@1.3.2
added 63 packages in 36.052s
[root@localhost elasticsearch-head-master]# vim /root/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i' # Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/root/elasticsearch-head-master/node_modules/grunt-cli/bin:$PATH
[root@localhost elasticsearch-head-master]# . /root/.bashrc
[root@localhost elasticsearch-head-master]# grunt server &
[1] 6210
[root@localhost elasticsearch-head-master]# Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100 [root@localhost elasticsearch-head-master]# ss -lntp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:9100 *:*
users:(("grunt",pid=6210,fd=12))LISTEN 0 128 *:22 *:*
users:(("sshd",pid=998,fd=3))LISTEN 0 100 127.0.0.1:25 *:*
users:(("master",pid=1134,fd=13))LISTEN 0 128 ::ffff:192.168.10.31:9200 :::*
users:(("java",pid=3926,fd=211))LISTEN 0 128 ::ffff:192.168.10.31:9300 :::*
users:(("java",pid=3926,fd=190))LISTEN 0 128 :::22 :::*
users:(("sshd",pid=998,fd=4))LISTEN 0 100 ::1:25 :::*
users:(("master",pid=1134,fd=14))
浏览器访问

es 集群部署的更多相关文章
- ES集群部署
1.环境准备 主机名 IP地址 CPU 内存 硬盘 gztxy-prd-es01 192.168.1.11 8 16 200 gztxy-prd-es01 192.168.1.12 8 16 200 ...
- 教你在Kubernetes中快速部署ES集群
摘要:ES集群是进行大数据存储和分析,快速检索的利器,本文简述了ES的集群架构,并提供了在Kubernetes中快速部署ES集群的样例:对ES集群的监控运维工具进行了介绍,并提供了部分问题定位经验,最 ...
- 搭建ES集群
服务版本选择 TEG的ctsdb当前最高版本采用的是es的6.4.3版本,为了日后与ctsdb衔接方便,部署开源版es时也采用该版本.6.4.3版本的es依赖的jdk版本要求在8u181以上,测试环境 ...
- docker 快速部署ES集群 spark集群
1) 拉下来 ES集群 spark集群 两套快速部署环境, 并只用docker跑起来,并保存到私库. 2)弄清楚怎么样打包 linux镜像(或者说制作). 3)试着改一下,让它们跑在集群里面. 4) ...
- Docker安装部署es集群
Docker安装部署es集群:环境准备:已安装docker的centos服务器一台1. 拉取es版本docker pull elasticsearch:5.6.82. 新建文件夹 数据挂载目录 和 配 ...
- 利用shell脚本[带注释的]部署单节点多实例es集群(docker版)
文章目录 目录结构 install_docker_es.sh elasticsearch.yml.template 没事写写shell[我自己都不信,如果不是因为工作需要,我才不要写shell],努力 ...
- Windows下ELK环境搭建(单机多节点集群部署)
1.背景 日志主要包括系统日志.应用程序日志和安全日志.系统运维和开发人员可以通过日志了解服务器软硬件信息.检查配置过程中的错误及错误发生的原因.经常分析日志可以了解服务器的负荷,性能安全性,从而及时 ...
- 我的ElasticSearch集群部署总结--大数据搜索引擎你不得不知
摘要:世上有三类书籍:1.介绍知识,2.阐述理论,3.工具书:世间也存在两类知识:1.技术,2.思想.以下是我在部署ElasticSearch集群时的经验总结,它们大体属于第一类知识“techknow ...
- ElasticSearch5集群部署指南
本文简要介绍ES5版本集群部署时的要点. 更多相关信息请参阅官网. 部分配置未在生产环境体现. 生产中2个集群20台centOS,总数据15TB,90亿条. 实时写入5000条/s, 最大7万/s. ...
随机推荐
- JavaScript-Tool:wdtree
ylbtech-JavaScript-Tool:wdtree 1.返回顶部 1. 插件描述:wdTree是一个轻量级jQuery插件用于创建一个带有嵌套Check Boxe的树形控件. wdTree是 ...
- UVa 1611 Crane (构造+贪心)
题意:给定一个序列,让你经过不超过9的6次方次操作,变成一个有序的,操作只有在一个连续区间,交换前一半和后一半. 析:这是一个构造题,我们可以对第 i 个位置找 i 在哪,假设 i 在pos 位置, ...
- 如何用GO实现一个tail -f功能以及相应的思维发散
此文已由作者杨望暑授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 背景 在服务端查看log会经常使用到tail -f命令实时跟踪文件变化. 那么问题来了, 如果自己写一个同样 ...
- 机器学习--DIY笔记与感悟--②决策树(1)
在完成了K临近之后,今天我们开始下一个算法--->决策树算法. 一.决策树基础知识 如果突然问你"有一个陌生人叫X,Ta今天需要带伞吗?", 你一定会觉得这个问题就像告诉你& ...
- Codeforces Round #324 (Div. 2)C. Marina and Vasya
A的万般无奈...后来跑了大牛的这份代码发现, 题意是求一个序列与给定的两个序列有t个不同. 只要保证...对应位置就行了.. 所以处理起来非常方便.............. 可是没有感觉是对应位置 ...
- Log2Net组件代码详解(附开源代码)
上一篇,我们介绍了Log2Net的需求和整体框架,我们接下来介绍我们是如何用代码实现Log2Net组件的功能的. 一.整体介绍 Log2Net组件本身是一个Dll,供其他系统调用. 本部分由以下几部分 ...
- CDH版本大数据集群下搭建的Hue详细启动步骤(图文详解)
关于安装请见 CDH版本大数据集群下搭建Hue(hadoop-2.6.0-cdh5.5.4.gz + hue-3.9.0-cdh5.5.4.tar.gz)(博主推荐) Hue的启动 也就是说,你Hue ...
- Android Studio无法预览xml布局之解决方法(两种)
学习安卓程序开发,用的Android Studio,发现怎么更改xml代码都没有想要的效果.如图 代码如下: <?xml version="1.0" encoding=&qu ...
- h5-18-文件上传
参考博客地址:https://developer.mozilla.org/zh-CN/docs/Web/API/FormData/Using_FormData_Objects 参考博客地址:http: ...
- 【solr filter 介绍--转】http://blog.csdn.net/jiangchao858/article/details/54989025
Solr的Analyzer分析器.Tokenizer分词器.Filter过滤器的区别/联系 Analyzer负责把文本字段转成token stream,然后自己处理.或调用Tokenzier和Filt ...