ES集群部署
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集群部署的更多相关文章
- es 集群部署
下载 [root@localhost ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.1 ...
- 教你在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. ...
随机推荐
- 数据可视化之powerBI基础(二)PowerBI动态图表技巧:钻取交互
https://zhuanlan.zhihu.com/p/64406366 查看可视化图表的时候,我们可能想深入了解某个视觉对象的更详细信息,或者进行更细粒度的分析,比如看到2017年的总体数据,同时 ...
- 数据可视化之 图表篇(三)体验Power BI最新发布的AI图表:分解树
在刚刚发布的11月更新中,PowerBI界面全新改版,采用和Office套件相似的Ribbon风格,除了这个重大变化,还发布了一个AI黑科技图表:分解树(Decomposition Tree). 无论 ...
- 使用OpenCV对图片进行特征点检测和匹配(C++)
背景 最近从不同网站下载了非常多的动漫壁纸,其中有一些内容相同,但是大小.背景颜色.色调.主人公的位置不同(例子如下).正因为如此,基础的均方误差.直方图检测等方法很难识别出这些相似的图片. 思路 O ...
- bzoj3858Number Transformation*
bzoj3858Number Transformation 题意: 给一个数n,对其进行k次变换,第i次变换是将当前的n变成大于等于n的最小的i的倍数.求k次变换后n为多少.n≤10^10,k≤10^ ...
- T3 成绩单 题解
这个题本来不归我讲,但我A完之后觉得太坑了,还是讲一下吧. 首先这个题有个重要的地方:(字典顺序,学号全为小写字母,从小到大排列) 字典序和字典顺序是不一样的!!! 我以为是字典序……,wa了,字典顺 ...
- 浏览器如何执行JS
作为JS系列的第一篇,内容当然是浏览器如何执行一段JS啦. 首先通过浏览器篇我们可以得知,JS是在渲染进程里的JS引擎线程执行的.在此之后还要了解几个概念,编译器(Compiler).解释器(Inte ...
- ciscn_2019_c_1
0x01 检查文件,64位 检查开启的保护情况 开启了NX保护 0x02 IDA静态分析 在主函数这里并没有常见的gets栈溢出,尝试再这里面的子函数找找,发现了encrypt函数,进去查看 发现这个 ...
- CMD运行JAVA出现“错误:编码GBK的不可映射字符”
问题: 原因: 字符编码问题.由于java文件中有中文字符,而cmd在编译时解码默认使用GBK,所以导致无法解码出正确的中文字符. 解决办法: 使用-encoding指令指定运行编码为UTF-8.
- python学习之路------你想要的都在这里了
python学习之路------你想要的都在这里了 (根据自己的学习进度后期不断更新哟!!!) 一.python基础 1.python基础--python基本知识.七大数据类型等 2.python基础 ...
- IO—》打印流&commons-IO
打印流 打印流添加输出数据的功能,使它们能够方便地打印各种数据值表示形式. 打印流根据流的分类: 字节打印流 PrintStream 字符打印流 PrintWriter 方法: void print( ...