mac启动elasticsearch
在Mac上启动Elasticsearch,你需要遵循以下步骤:
- 确保你已经安装了Java Development Kit (JDK)。Elasticsearch 7.x及以上版本需要Java 11或更高版本。可以使用
java -version
命令来检查Java版本。 - 下载并解压Elasticsearch。你可以从Elasticsearch官方网站下载相应的版本。
- 打开终端(Terminal)。
导航到Elasticsearch的根目录。例如,如果Elasticsearch解压在
~/Downloads/elasticsearch-7.10.0
,你应该执行以下命令:cd ~/Downloads/elasticsearch-7.10.0
运行Elasticsearch。在Elasticsearch根目录下,执行以下命令:
./bin/elasticsearch
如果Elasticsearch正常启动,你将看到类似以下的输出:
[2023-04-01T12:34:56,000Z][INFO ][o.e.n.Node ] [] initializing ...
[2023-04-01T12:34:56,000Z][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [41.5gb], net total_space [118.9gb], types [rootfs]
...
[2023-04-01T12:35:00,000Z][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller] [Main] [INFO] [controller.cpp:477]: Controller pinged with [1], pong: [1]
[2023-04-01T12:35:00,000Z][INFO ][o.e.n.Node ] [node-1] initialized
[2023-04-01T12:35:00,000Z][INFO ][o.e.n.Node ] [node-1] starting ...
[2023-04-01T12:35:00,000Z][INFO ][o.e.t.TransportService ] [node-1] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
...
[2023-04-01T12:35:05,000Z][INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices into cluster_state
...
[2023-04-01T12:35:05,000Z][INFO ][o.e.h.HttpServer ] [node-1] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
...
[2023-04-01T12:35:05,000Z][INFO ][o.e.n.Node ] [node-1] started
Elasticsearch现在应该正在运行。你可以通过访问http://localhost:9200
来验证它是否正常工作。如果你看到一个JSON响应,表明Elasticsearch正在正常运行。
评论已关闭