1.环境准备

主机名  IP地址 CPU 内存 硬盘
gztxy-prd-es01 192.168.1.11   8 16 200
gztxy-prd-es01 192.168.1.12 8 16 200
gztxy-prd-es01 192.168.1.13 8 16 200

2.安装并配置

安装:

wget https://mirrors.huaweicloud.com/elasticsearch/6.8.2/elasticsearch-6.8.2.tar.gz
tar -xf elasticsearch-6.8.2.tar.gz -C /usr/local/
ln -s /usr/local/elasticsearch-6.8.2 /usr/local/elasticsearch
#安装分词插件
/usr/local/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.8.2/elasticsearch-analysis-ik-6.8.2.zip

配置:

#配置JVM参数,系统内存的一半
sed -i "s#-Xms1g#-Xms8g#g" /usr/local/elasticsearch/config/jvm.options
sed -i "s#-Xmx1g#-Xmx8g#g" /usr/local/elasticsearch/config/jvm.options #配置ES配置
mv /usr/local/elasticsearch/config/elasticsearch.yml /usr/local/elasticsearch/config/elasticsearch.yml-bak
cat >/usr/local/elasticsearch/config/elasticsearch.yml<<EOF
cluster.name: gztxy-prd-behavior
#每个节点node名称唯一
node.name: node-01
path.data: /data/es/data
path.logs: /data/es/logs
path.repo: ["/es_backup/bak"]
node.master: true
node.data: true
node.ingest: true
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.1.11:9300", "192.168.1.12:9300","192.168.1.13:9300"]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: "Authorization,X-Requested-With,Content-Length,Content-Type"
thread_pool:
write:
queue_size: 1000
search:
queue_size: 1000
EOF

创建数据目录并授权:

#创建数据目录及备份目录
mkdir -p /data/es/{data,logs,backup}
mkdir -p /es_backup/bak #目录授权
id app > /dev/null 2>&1 || useradd app
chown -R app.app /data/es/ /usr/local/elasticsearch* /es_backup

添加启动脚本:

cat >/usr/local/elasticsearch/config/elasticsearch.service <<EOF
[Unit]
Description=Elasticsearch
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target [Service]
RuntimeDirectory=elasticsearch
Environment=ES_HOME=/usr/local/elasticsearch
Environment=ES_PATH_CONF=/usr/local/elasticsearch/config
Environment=PID_DIR=/usr/local/elasticsearch
EnvironmentFile=-/etc/sysconfig/elasticsearch
WorkingDirectory=/usr/local/elasticsearch LimitMEMLOCK=infinity User=app
Group=app ExecStart=/usr/local/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet # StandardOutput is configured to redirect to journalctl since
# some error messages may be logged in standard output before
# elasticsearch logging system is initialized. Elasticsearch
# stores its logs in /var/log/elasticsearch and does not use
# journalctl by default. If you also want to enable journalctl
# logging, you can simply remove the "quiet" option from ExecStart.
StandardOutput=journal
StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536 # Specifies the maximum number of processes
LimitNPROC=4096 # Specifies the maximum size of virtual memory
LimitAS=infinity # Specifies the maximum file size
LimitFSIZE=infinity # Disable timeout logic and wait until process is stopped
TimeoutStopSec=0 # SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM # Send the signal only to the JVM rather than its control group
KillMode=process # Java process is never killed
SendSIGKILL=no # When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143 [Install]
WantedBy=multi-user.target # Built for distribution-6.3.2 (distribution)
EOF

启动:

cp /usr/local/elasticsearch/config/elasticsearch.service /usr/lib/systemd/system
chmod +x /usr/lib/systemd/system/elasticsearch.service
systemctl daemon-reload
systemctl enable elasticsearch > /dev/null 2>&1
systemctl start elasticsearch
systemctl status elasticsearch

3.测试

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

  1. es 集群部署

    下载 [root@localhost ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.1 ...

  2. 教你在Kubernetes中快速部署ES集群

    摘要:ES集群是进行大数据存储和分析,快速检索的利器,本文简述了ES的集群架构,并提供了在Kubernetes中快速部署ES集群的样例:对ES集群的监控运维工具进行了介绍,并提供了部分问题定位经验,最 ...

  3. 搭建ES集群

    服务版本选择 TEG的ctsdb当前最高版本采用的是es的6.4.3版本,为了日后与ctsdb衔接方便,部署开源版es时也采用该版本.6.4.3版本的es依赖的jdk版本要求在8u181以上,测试环境 ...

  4. docker 快速部署ES集群 spark集群

    1) 拉下来 ES集群  spark集群 两套快速部署环境, 并只用docker跑起来,并保存到私库. 2)弄清楚怎么样打包 linux镜像(或者说制作). 3)试着改一下,让它们跑在集群里面. 4) ...

  5. Docker安装部署es集群

    Docker安装部署es集群:环境准备:已安装docker的centos服务器一台1. 拉取es版本docker pull elasticsearch:5.6.82. 新建文件夹 数据挂载目录 和 配 ...

  6. 利用shell脚本[带注释的]部署单节点多实例es集群(docker版)

    文章目录 目录结构 install_docker_es.sh elasticsearch.yml.template 没事写写shell[我自己都不信,如果不是因为工作需要,我才不要写shell],努力 ...

  7. Windows下ELK环境搭建(单机多节点集群部署)

    1.背景 日志主要包括系统日志.应用程序日志和安全日志.系统运维和开发人员可以通过日志了解服务器软硬件信息.检查配置过程中的错误及错误发生的原因.经常分析日志可以了解服务器的负荷,性能安全性,从而及时 ...

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

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

  9. ElasticSearch5集群部署指南

    本文简要介绍ES5版本集群部署时的要点. 更多相关信息请参阅官网. 部分配置未在生产环境体现. 生产中2个集群20台centOS,总数据15TB,90亿条. 实时写入5000条/s, 最大7万/s. ...

随机推荐

  1. redis源码学习之工作流程初探

    目录 背景 环境准备 下载redis源码 下载Visual Studio Visual Studio打开redis源码 启动过程分析 调用关系图 事件循环分析 工作模型 代码分析 动画演示 网络模块 ...

  2. Mysql基础(三):MySQL基础数据类型、完整性约束、sql_mode模式

    目录 2.MySQL基础数据类型.完整性约束.sql_mode模式 1. MySQL常用数据类型 2. 完整性约束 3. MySQL的sql_mode模式说明以及设置 2.MySQL基础数据类型.完整 ...

  3. python数据处理(二)之处理Excel文件

    代码与资料 https://github.com/jackiekazil/data-wrangling 1.安装相关包 2.解析Excel文件 在解析Excel之前应该想办法寻找替代的格式 3.开始解 ...

  4. 如何将你写的脚本程序打包成一个exe可执行程序

    ​    编写的程序打包成一个exe文件,随时可以双击执行,想想是不是很酷.接下来我们一起看一下如何将自己编写的程序打包为一个exe的可执行程序. 将程序打包成exe的好处 除了满足自己的成就感以外, ...

  5. 上亿数据怎么玩深度分页?兼容MySQL + ES + MongoDB

    面试题 & 真实经历 面试题:在数据量很大的情况下,怎么实现深度分页? 大家在面试时,或者准备面试中可能会遇到上述的问题,大多的回答基本上是分库分表建索引,这是一种很标准的正确回答,但现实总是 ...

  6. 【原创】linux设备模型之kset/kobj/ktype分析

    背 景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本 ...

  7. IDEA命令行缩短器助你解决此问题:Command line is too long. Shorten command line...

    生命太短暂,不要去做一些根本没有人想要的东西.本文已被 https://www.yourbatman.cn 收录,里面一并有Spring技术栈.MyBatis.JVM.中间件等小而美的专栏供以免费学习 ...

  8. 题解 CF1354D 【Multiset】

    考试拿到题,一看,这不是权值线段树吗? 思路 使用线段树每个节点维护该区间内元素出现次数. 根据题目,对于加入.删除元素,我们可以单点修改(\(+1\).\(-1\)),对于输出,我们可 随便 遍历找 ...

  9. 抛出这8个问题,检验一下你到底会不会ThreadLocal,来摸个底~

    0.问题 和Synchronized的区别 存储在jvm的哪个区域 真的只是当前线程可见吗 会导致内存泄漏么 为什么用Entry数组而不是Entry对象 你学习的开源框架哪些用到了ThreadLoca ...

  10. xilinx fpga 生成3*3窗口

    在写滤波程序的时候在网上看了好几篇大佬的笔记,都有提到使用3*3窗口,由于小白一个,看到复杂的理论就惧怕的不行.但是现在不得不上,自己调用移位寄存器ip核然后做了个3*3窗口出来,自己动手作出来忽然感 ...