1. 部署图
1)原ES集群信息 |
|
|
|
|
|
|
|
IP |
集群名称 |
http端口号 |
tcp端口号 |
192.168.2.11 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.12 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.13 |
es_es11223_cluster |
11223 |
11224 |
|
|
|
|
|
|
|
|
|
|
|
|
2)新ES集群信息 |
|
|
|
|
|
|
|
IP |
集群名称 |
http端口号 |
tcp端口号 |
192.168.2.11 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.12 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.13 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.14 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.15 |
es_es11223_cluster |
11223 |
11224 |
192.168.2.16 |
es_es11223_cluster |
11223 |
11224 |
2. 关闭自动平衡
关闭自动平衡:
确认自动平衡已关闭:
3. 启动192.168.2.14:11223节点
3.1. 检查集群状态
查看检查集群状态是否为green:
{
"cluster_name" : "es_es11223_cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 120,
"active_shards" : 240,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
3.2. 启动节点
启动实例
3.3. 检查节点日志
检查节点日志,查看是否有报错:
3.4. 检查集群状态
确认新增节点未分配分片:
null
检查新增节点已添加进集群:
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.2.14 4 100 1 1.19 0.67 0.40 mdi - 192.168.2.14-11223
192.168.2.12 29 99 0 0.99 1.07 1.05 mdi * 192.168.2.12-11223
192.168.2.13 51 98 0 1.36 1.19 1.08 mdi - 192.168.2.13-11223
192.168.2.11 61 97 2 0.79 0.58 0.72 mdi - 192.168.2.11-11223
检查集群状态是否恢复为green:
{
"cluster_name" : "es_es11223_cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 4,
"number_of_data_nodes" : 4,
"active_primary_shards" : 120,
"active_shards" : 240,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
4. 启动192.168.2.15:11223节点
4.1. 检查集群状态
检查集群状态是否为green:
{
"cluster_name" : "es_es11223_cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 4,
"number_of_data_nodes" : 4,
"active_primary_shards" : 120,
"active_shards" : 240,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
4.2. 启动节点
启动实例
es 225493 1 96 23:03 ? 00:00:32 /usr/local/jdk/bin/java -Xms30g -Xmx30g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.allow_insecure_settings=true -Des.path.home=/data/PaaS/es/11223 -Des.path.conf=/data/PaaS/es/11223/config -cp /data/PaaS/es/11223/lib/* org.elasticsearch.bootstrap.Elasticsearch -d
4.3. 检查节点日志
检查节点日志,查看是否有报错:
...
[2021-05-20T23:04:16,343][INFO ][o.e.m.j.JvmGcMonitorService] [192.168.2.15-11223] [gc][3] overhead, spent [270ms] collecting in the last [1s]
[2021-05-20T23:04:17,468][INFO ][o.e.c.s.ClusterApplierService] [192.168.2.15-11223