tar -zxvf elasticsearch-2.3.2.tar.gz
bin/elasticsearch
启动日志如下
FengZhendeMacBook-Pro:bin FengZhen$ ./elasticsearch [2019-05-28 22:19:11,319][INFO ][node ] [Feng] version[2.3.2], pid[72247], build[b9e4a6a/2016-04-21T16:03:47Z] [2019-05-28 22:19:11,320][INFO ][node ] [Feng] initializing ... [2019-05-28 22:19:13,318][INFO ][plugins ] [Feng] modules [reindex, lang-expression, lang-groovy], plugins [head], sites [head] [2019-05-28 22:19:13,409][INFO ][env ] [Feng] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [165.2gb], net total_space [446.9gb], spins? [unknown], types [apfs] [2019-05-28 22:19:13,411][INFO ][env ] [Feng] heap size [990.7mb], compressed ordinary object pointers [true] [2019-05-28 22:19:13,420][WARN ][env ] [Feng] max file descriptors [10240] for elasticsearch process likely too low, consider increasing to at least [65536] [2019-05-28 22:19:18,970][INFO ][node ] [Feng] initialized [2019-05-28 22:19:18,970][INFO ][node ] [Feng] starting ... [2019-05-28 22:19:19,238][INFO ][transport ] [Feng] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300} [2019-05-28 22:19:19,249][INFO ][discovery ] [Feng] elasticsearch/iA0avp_YTP-82cuMANvK8Q [2019-05-28 22:19:22,302][INFO ][cluster.service ] [Feng] new_master {Feng}{iA0avp_YTP-82cuMANvK8Q}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received) [2019-05-28 22:19:22,324][INFO ][http ] [Feng] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200} [2019-05-28 22:19:22,325][INFO ][node ] [Feng] started [2019-05-28 22:19:22,478][INFO ][gateway ] [Feng] recovered [7] indices into cluster_state [2019-05-28 22:19:24,940][INFO ][cluster.routing.allocation] [Feng] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[blog][2], [blog][2]] ...]).
(1)第一行提供了启动节点的统计信息
[2019-05-28 22:19:11,319][INFO ][node ] [Feng] version[2.3.2], pid[72247], build[b9e4a6a/2016-04-21T16:03:47Z]
默认情况下,ES为节点随机分配一个名字,可以在配置中修改。此处我修改为[Feng],此处还可看到ES的版本号细节,还有所启动Java进程的PID。
(2)插件在初始化过程中被加载,默认情况下是没有插件的,此处插件有[head]
[2019-05-28 22:19:13,318][INFO ][plugins ] [Feng] modules [reindex, lang-expression, lang-groovy], plugins [head], sites [head]
(3)端口9300默认用于节点之间的通信,称为transport:
[2019-05-28 22:19:19,238][INFO ][transport ] [Feng] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}
如果使用本地Java API而不是REST API,需要连接这个端口。
(4)选举主节点,名为[Feng]的节点
[2019-05-28 22:19:22,302][INFO ][cluster.service ] [Feng] new_master {Feng}{iA0avp_YTP-82cuMANvK8Q}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
(5)端口9200默认用于HTTP的通信。应用程序使用REST API时连接这个端口
[2019-05-28 22:19:22,324][INFO ][http ] [Feng] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}
(6)节点启动成功标志
[2019-05-28 22:19:22,325][INFO ][node ] [Feng] started
(7)gateway是负责将数据持久化到磁盘的ES组件,这样就不会在节点宕机的时候丢失数据。
[2019-05-28 22:19:22,478][INFO ][gateway ] [Feng] recovered [7] indices into cluster_state
启动节点之后,gateway将查看磁盘来判断是否有数据在意外时保存过,这样可以恢复这些数据。
原文:https://www.cnblogs.com/EnzoDin/p/10940828.html