文章目录
- 1. 概述
- 2. start方法
-
- 2.1 启动生命周期相关的组件
- 2.2 启动IndicesService
- 2.3 IndicesClusterStateService启动
- 2.4 SnapshotsService启动
- 2.5 SnapshotShardsService启动
- 2.6 RepositoriesService启动
- 2.7 SearchService启动
- 2.8 MonitorService启动
- 2.9 NodeConnectionsService启动
- 2.10 TransportService启动
- 2.11 PeerRecoverySourceService启动
- 2.12 GatewayMetaState启动
- 2.13 校验
- 2.14 Discovery启动
- 2.15 ClusterService启动
- 2.17 HttpServerTransport启动
- 2.18 写入文件
- 2.19 启动插件相关方法
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/6f6748149938c82b93334a118d2f27ba.png)
1. 概述
在博客 【ElasticSearch】Es 启动流程 初始化流程 源码分析 中我们对集群的初始化进行了一次分析,下面开始对启动方法进行分析。
2. start方法
在一系列检测完成之后,实例化Node并start。由于ES采用了模块化的架构思路,因此Node的start出乎意料的简洁:
public Node start() throws NodeValidationException {
// 判断服务是不是已经启动了
if (!lifecycle