前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >elasticsearch-1:es&kibana的7.13.4单节点集群部署与初探

elasticsearch-1:es&kibana的7.13.4单节点集群部署与初探

作者头像
千里行走
发布2022-04-28 16:22:57
8300
发布2022-04-28 16:22:57
举报
文章被收录于专栏:千里行走千里行走

最近由于es暴了一个漏洞,打算升级到最新的es7.13.4,漏洞描述如下:

Elasticsearch 推出 7.13.4 版本发布:解决内存泄漏问题

近日,在 Elasticsearch 的错误报告中发现了一个内存泄露漏洞。能够向 Elasticsearch 提交任意查询的用户可能会提交格式错误的查询,这将导致返回包含先前使用的数据缓冲区部分的错误消息。由于问题没有具体的解决方案,且7.13.4 之前的所有 Elasticsearch 版本都受此缺陷影响。用户必须升级到 Elasticsearch 版本 7.13.4 才能获得修复。

而且es7和es6差别挺多,故从安装开始先做简单了解。

目录:

(1).部署es7.13.4单节点集群

(2).部署kibana7.13.4

(3).es6与es7差异举例

(1).部署es7.13.4单节点集群

下载页面:

https://www.elastic.co/cn/downloads/elasticsearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.4-linux-x86_64.tar.gz

修改系统参数:

vi /etc/sysctl.conf

添加一行: vm.max_map_count=655360

加载参数: sysctl -p

否则启动会报错:

bootstrap check failure [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

修改配置文件:

config/elasticsearch.yml

红色是必须修改的:

cluster.name: es-test-cluster

path.data: /app/data/elasticsearch-7.13.4

path.logs: /app/logs/elasticsearch-7.13.4

network.host: 0.0.0.0 (配置其他网段也可以访问)

node.name: stress-test001 (和你的主机名一样,hostname查看)

cluster.initial_master_nodes: ["stress-test001"]

config/jvm.options

8:-Xloggc:/app/logs/elasticsearch-7.13.4/gc.log

9-:-Xlog:gc*,gc+age=trace,safepoint:file=/app/logs/elasticsearch-7.13.4/gc.log:utctime,pid,tags:filecount=32,filesize=64m

如果不配置cluster.initial_master_nodes会报错:

bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

node.name和cluster.initial_master_nodes的值必须和hostname一致,否则会报错:

master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [node-1] to bootstrap a cluster: ......

启动es:

/app/3rd/elasticsearch-7.13.4/bin/elasticsearch -d

(2).部署kibana7.13.4

下载页面:

https://www.elastic.co/cn/downloads/kibana

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.13.4-linux-x86_64.tar.gz

修改配置:config/kibana.yml

server.host: "0.0.0.0"

启动kibana:

nohup /app/3rd/kibana-7.13.4-linux-x86_64/bin/kibana > /app/logs/kibana-7.13.4-linux-x86_64/nohup.out &

(3).es6与es7差异举例

建索引的格式发生变化:

es6:

curl -X PUT "localhost:9200/test?pretty" -H'Content-Type: application/json' -d'

{

"settings": {

"number_of_shards": 5,

"number_of_replicas": 1

},

"mappings": {

"test": {

"properties": {

"amount":{

"type":"double"

}

}

}

}

}'

在es7上执行会包错误:

在es7上需要改为:把mappings下的index name子项删除

curl -X PUT "localhost:9200/test?pretty" -H'Content-Type: application/json' -d'

{

"settings": {

"number_of_shards": 5,

"number_of_replicas": 1

},

"mappings": {

"properties": {

"amount":{

"type":"double"

}

}

}

}'

OK:

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2021-11-27,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 千里行走 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档