本文部署环境

$ cat /etc/redhat-release
CentOS Linux release 7.6. (Core)

部署前系统优化

$ tail - /etc/security/limits.conf
root soft nofile
root hard nofile
* soft nofile
* hard nofile $ tail - /etc/sysctl.conf     # 添加内存参数,否则会报错
vm.max_map_count=327650 # 定义了一个进程能拥有的最多的内存区域,Centos7.6默认为65530
$ sysctl -p

配置hosts

$ tail - /etc/hosts
192.168.1.11 mall-elasticsearch-1192.168.1.12 mall-elasticsearch-2192.168.1.13 mall-elasticsearch-3

部署elasticsearch-7.4.1

$ tar xf elasticsearch-7.4.-linux-x86_64.tar.gz
$ ln -s elasticsearch-7.4. elasticsearch
$ cd elasticsearch
$ grep ^[^#] config/elasticsearch.yml
cluster.name: mall-elasticsearch
node.name: mall-elasticsearch-1 #修改为当前主机的主机名,见上一步hosts配置
network.host: 192.168.1.11       #修改为当前主机的ip地址
http.port:
discovery.seed_hosts: ["mall-elasticsearch-1", "mall-elasticsearch-2", "mall-elasticsearch-3"]
cluster.initial_master_nodes: ["mall-elasticsearch-1", "mall-elasticsearch-2", "mall-elasticsearch-3"]
http.cors.enabled: true
http.cors.allow-origin: "*"
xpack.sql.enabled: false
$ vim config/jvm.options
......
-Xms4g
-Xmx4g
......

启动

$ nohup bin/elasticsearch &

验证

$ curl mall-elasticsearch-:
{
"name" : "mall-elasticsearch-1",
"cluster_name" : "mall-elasticsearch",
"cluster_uuid" : "Fg32p9bsRAq7HjIxcSF6Dg",
"version" : {
"number" : "7.4.1",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "fc0eeb6e2c25915d63d871d344e3d0b45ea0ea1e",
"build_date" : "2019-10-22T17:16:35.176724Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

为了方便维护,编写脚本如下:

$ cat restart.sh
#!/bin/bash
cd /data/server/elasticsearch
./stop.sh
sleep
./start.sh $ cat start.sh
#!/bin/bash
ExcuteUser='skuser'
LoginUser=`whoami`
if [ $LoginUser != $ExcuteUser ];then
echo "Please change to skuser to execute this scripts!"
exit
fi
cd /data/server/elasticsearch
nohup bin/elasticsearch & $cat stop.sh
#!/bin/bash
KEYWORD="elasticsearch"
PROCESS_COUNT=`ps -aux |grep java |grep $KEYWORD |wc -l`
PID=`ps -aux |grep java |grep $KEYWORD |awk '{print $2}'`
if [ $PROCESS_COUNT -ne ];then
kill - $PID
echo "killed Process $PID"
else
echo "This process is already killed!"
fi

Elasticsearch 集群部署的更多相关文章

  1. Elasticsearch学习总结 (Centos7下Elasticsearch集群部署记录)

    一.  ElasticSearch简单介绍 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticse ...

  2. 我的ElasticSearch集群部署总结--大数据搜索引擎你不得不知

    摘要:世上有三类书籍:1.介绍知识,2.阐述理论,3.工具书:世间也存在两类知识:1.技术,2.思想.以下是我在部署ElasticSearch集群时的经验总结,它们大体属于第一类知识“techknow ...

  3. Linux中Elasticsearch集群部署

    1.下载安装包elasticsearch-6.3.1  安装包自己下载,网上很多 2.安装位置在cd /usr/local/elasticsearch/目录下 3.因为ES使用root权限运行会报错, ...

  4. elasticsearch集群部署

    启动elk: zjtest7-redis:/usr/local/elasticsearch-2.3.4/bin# ./elasticsearch -d 后台运行 访问: http://192.168. ...

  5. elasticsearch集群部署以及head插件安装

    环境准备 elasticsearch是Java程序写的因此必须装jdk,否则使用不了. [root@openstack ~]# java -versionopenjdk version "1 ...

  6. elasticsearch 集群部署,版本 5.5.0

    准备说明: 两台服务器 Ip分别为 192.168.239.78(主),192.168.239.49(从) 主服务器上配置如下:1.上传es5.5.0版本至主服务器2.解压 unzipunzip el ...

  7. 谈一谈Elasticsearch的集群部署

      Elasticsearch天生就支持分布式部署,通过集群部署可以提高系统的可用性.本文重点谈一谈Elasticsearch的集群节点相关问题,搞清楚这些是进行Elasticsearch集群部署和拓 ...

  8. Elasticsearch系列---生产集群部署(下)

    概要 本篇继续讲解Elasticsearch集群部署的细节问题 集群重启问题 如果我们的Elasticsearch集群做了一些离线的维护操作时,如扩容磁盘,升级版本等,需要对集群进行启动,节点数较多时 ...

  9. 日志分析平台ELK之搜索引擎Elasticsearch集群

    一.简介 什么是ELK?ELK是Elasticsearch.Logstash.Kibana这三个软件的首字母缩写:其中elasticsearch是用来做数据的存储和搜索的搜索引擎:logstash是数 ...

随机推荐

  1. html-css:浮动_清除浮动

    1.浮动 清除浮动之前我们首先需要了解为什么要清除浮动 1. 假设我们有一个父盒子,不设置高度,其高度有内部子盒子的大小自动撑开,这样是完全可行的,因为有时候我们并不想直接固定死父盒子的大小,而是根据 ...

  2. 常见Web安全漏洞--------CSRF

    1,CSRF (Cross Site Request Forgery, 跨站域请求伪造),也可以说是模拟请求. 2,黑客获取到了token 令牌,发送恶意模拟请求,攻击网站,防御方法可以参考api 接 ...

  3. linux部署win服务 dotnet mono jexus

    .Net Core (dotnet C#应用) dotnet 可以用在linux上运行 C#应用 适用于 SSO 统一身份认证系统 # 安装依赖 yum install libunwind yum i ...

  4. 树形dp技巧,多叉树转二叉树

    今天复习树形dp时发现一道比较古老的题,叫选课,是树形dp的一道基础题,也是多叉树转二叉树应用的模版题 多叉树转二叉树的应用非常广泛,因为如果一个节点的儿子太多,一个一个存下来不方便去查询,并且会增加 ...

  5. MATLAB——时间,日期及显示格式

    一.日期和时间 1.生成指定格式日期和时间 标准日期格式 2.获取当前时间的数值 >> datestr(now,) ans = -- :: >> datestr(now,'yy ...

  6. UITextFiled-集合目录

    键盘弹起遮挡输入输入框(UITextFiled或者UITextView)                   对于键盘弹起遮挡输入框的问题以前也想过解决办法比如:监听系统键盘弹出通知.根据每个控件所在 ...

  7. # CodeCraft-20 (Div. 2)

    CodeCraft-20 (Div. 2) A. Grade Allocation 思路 : 无脑水题 代码 #include<iostream> #include<algorith ...

  8. HTML+CSS:css定位详解之相对定位、绝对定位和固定定位

    相对定位 如果想为元素设置层模型中的相对定位,需要设置position:relative;,它还是会占用该元素在文档中初始的页面空间,通过left.right.top.bottom属性确定元素在正常文 ...

  9. 搭建单区域DNS服务器

                                                          搭建单区域DNS服务器 案例1:搭建单区域DNS服务器 案例2:特殊DNS解析 案例3:配置 ...

  10. Python爬虫系列(一):从零开始,安装环境

    在上一个系列,我们学会使用rabbitmq.本来接着是把公司的celery分享出来,但是定睛一看,celery4.0已经不再支持Windows.公司也逐步放弃了服役多年的celery项目.恰好,公司找 ...