Carry の Blog Carry の Blog
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Carry の Blog

好记性不如烂键盘
首页
  • Nginx
  • Prometheus
  • Iptables
  • Systemd
  • Firewalld
  • Docker
  • Sshd
  • DBA工作笔记
  • MySQL
  • Redis
  • TiDB
  • Elasticsearch
  • Python
  • Shell
  • MySQL8-SOP手册
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • MySQL

  • Redis

  • Keydb

  • TiDB

  • MongoDB

  • Elasticsearch

    • 安装配置
    • 给Elasticsearch集群添加用户密码
    • Elastichsearch的分片和副本
    • 单节点分片达到默认上限解决办法
    • Elasticsearch集群节点磁盘使用分配不均解决办法
    • Elastichsearch的模板template和映射mapping
    • Elastichsearch查询-分页查询
    • Elasticsearch字符串搜索方式
    • Elastichsearch使用wildcard字段模糊匹配
    • ES数据迁移工具esm
    • Nginx Mirror 模块实现三套ES写入网关
    • ES单机多节点集群docker-compose一键安装
    • tcpdump抓包Elasticsearch语句
    • ElasticSearch 动态模板 使用方法
    • ES打开slowlog记录慢语句
    • ES加速恢复
    • Elasticsearch 常用 DSL 语句
    • Logstash迁移ES数据
  • Kafka

  • victoriametrics

  • BigData

  • Sqlserver

  • 数据库
  • Elasticsearch
Carry の Blog
2022-03-10

安装配置

 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.9-x86_64.rpm
 yum install elasticsearch-7.17.9-x86_64.rpm


[root@test-es01 carry]#  egrep -v '^#|^$'  /etc/elasticsearch/jvm.options
-Xms30g
-Xmx30g
-XX:+UnlockDiagnosticVMOptions
-Xlog:gc+heap+coops
14-:-XX:+UseG1GC
14-:-XX:G1ReservePercent=25
14-:-XX:InitiatingHeapOccupancyPercent=30
14-:-XX:MaxGCPauseMillis=50
-Djava.io.tmpdir=${ES_TMPDIR}
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/data/es
-XX:ErrorFile=/data/es/hs_err_pid%p.log
8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:/data/es/gc.log
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/data/es/gc.log:utctime,pid,tags:filecount=32,filesize=64m
[root@test-es01 carry]#  egrep -v '^#|^$'  /etc/elasticsearch/elasticsearch.yml 
cluster.name: test-es-cluster
node.name: es-master01
node.master: true
node.data: true
node.ingest: true
node.attr.rack_id: rack_es-master01
cluster.routing.allocation.awareness.attributes: rack_id
cluster.routing.allocation.same_shard.host: true
path.data: /data/es/data
path.logs: /data/es/logs
bootstrap.memory_lock: true
indices.memory.index_buffer_size: 17%
indices.recovery.max_bytes_per_sec: 1g
network.host: 0.0.0.0
network.publish_host: 10.10.10.60
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: ['10.10.10.60:9300', '10.10.10.61:9300', '10.10.10.62:9300']
cluster.initial_master_nodes: ['10.10.10.60', '10.10.10.61', '10.10.10.62']
cluster.fault_detection.leader_check.interval: 20s
discovery.cluster_formation_warning_timeout: 30s
cluster.join.timeout: 120s
cluster.publish.timeout: 90s
client.transport.ping_timeout: 60s
action.destructive_requires_name: true
xpack.ml.enabled: false
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
xpack.security.audit.enabled: true
thread_pool:
    write:
        size: 17
indices.fielddata.cache.size: 17%
indices.breaker.fielddata.limit: 30%
[root@test-es01 carry]#  egrep -v '^#|^$' /usr/lib/systemd/system/elasticsearch.service
[Unit]
Description=Elasticsearch
Documentation=https://www.elastic.co
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
RuntimeDirectory=elasticsearch
PrivateTmp=true
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_PATH_CONF=/etc/elasticsearch
Environment=PID_DIR=/var/run/elasticsearch
Environment=ES_SD_NOTIFY=true
EnvironmentFile=-/etc/sysconfig/elasticsearch
WorkingDirectory=/usr/share/elasticsearch
User=elasticsearch
Group=elasticsearch
ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet
StandardOutput=journal
StandardError=inherit
LimitNOFILE=65535
LimitMEMLOCK=infinity
LimitNPROC=65535
LimitAS=infinity
LimitFSIZE=infinity
TimeoutStopSec=0
KillSignal=SIGTERM
KillMode=process
SendSIGKILL=no
SuccessExitStatus=143
TimeoutStartSec=575
[Install]
WantedBy=multi-user.target



export PATH=$PATH:/usr/share/elasticsearch/bin:
elasticsearch-setup-passwords interactive
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
上次更新: 4/24/2025

← MongoDB 集群Config Server 复制集的工作原理 给Elasticsearch集群添加用户密码→

最近更新
01
tidb fast ddl
04-04
02
TiDB配置文件调优 原创
04-03
03
如何移除TiDB中的表分区 原创
04-03
更多文章>
Theme by Vdoing
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式