elasticsearch
环境配置(elasticsearch版本7.2 JDK11以上)
当前使用的版本elasticsearch 7.2、JDK 12.0.1
下载elasticsearch
可以降下载好的elasticsearch传到虚拟机中,也可以直接在虚拟机中下载
本次演示从虚拟机中下载
- curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0.tar.gz
或者 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0.tar.zip - 解压 tar -xvf elasticsearch-7.2.0.tar.gz
- cd elasticsearch-5.6.11 / bin
- ./elasticsearch
- 如果一切顺利安装,你应该看到一堆如下所示的消息:
[2017-09-16T14:17:51,251][INFO ][o.e.n.Node ] [] initializing …
[2017-09-16T14:17:51,329][INFO ][o.e.e.NodeEnvironment ] [6-bjhwl] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [317.7gb], net total_space [453.6gb], spins? [no], types [ext4]
[2017-09-16T14:17:51,330][INFO ][o.e.e.NodeEnvironment ] [6-bjhwl] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-09-16T14:17:51,333][INFO ][o.e.n.Node ] [6-bjhwl] node name [6-bjhwl] derived from node ID; set [node.name] to override
[2017-09-16T14:17:51,334][INFO ][o.e.n.Node ] [6-bjhwl] version[5.6.11], pid[21261], build[f5daa16/2017-09-16T09:12:24.346Z], OS[Linux/4.4.0-36-generic/amd64], JVM[Oracle Corporation/Java HotSpot™ 64-Bit Server VM/1.8.0_60/25.60-b23]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [aggs-matrix-stats]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [ingest-common]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [lang-expression]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [lang-groovy]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [lang-mustache]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [lang-painless]
[2017-09-16T14:17:51,967][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [percolator]
[2017-09-16T14:17:51,968][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [reindex]
[2017-09-16T14:17:51,968][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [transport-netty3]
[2017-09-16T14:17:51,968][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded module [transport-netty4]
[2017-09-16T14:17:51,968][INFO ][o.e.p.PluginsService ] [6-bjhwl] loaded plugin [mapper-murmur3]
[2017-09-16T14:17:53,521][INFO ][o.e.n.Node ] [6-bjhwl] initialized
[2017-09-16T14:17:53,521][INFO ][o.e.n.Node ] [6-bjhwl] starting …
[2017-09-16T14:17:53,671][INFO ][o.e.t.TransportService ] [6-bjhwl] publish_address {192.168.8.112:9300}, bound_addresses {{192.168.8.112:9300}
[2017-09-16T14:17:53,676][WARN ][o.e.b.BootstrapCheck ] [6-bjhwl] max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
[2017-09-16T14:17:56,731][INFO ][o.e.h.HttpServer ] [6-bjhwl] publish_address {192.168.8.112:9200}, bound_addresses {[::1]:9200}, {192.168.8.112:9200}
[2017-09-16T14:17:56,732][INFO ][o.e.g.GatewayService ] [6-bjhwl] recovered [0] indices into cluster_state
[2017-09-16T14:17:56,748][INFO ][o.e.n.Node ] [6-bjhwl] started
测试 Elasticsearch
是否启动成功,可以打开另一个终端,执行以下操作:
curl ‘http://localhost:9200/?pretty’
你应该得到和下面类似的响应(response):
{
“name” : “node-1”,
“cluster_name” : “test”,
“cluster_uuid” : “jJeyEE7aRLW_E1CgFXrSZA”,
“version” : {
“number” : “***",
“build_hash” : “10b1edd”,
“build_date” : “2017-09-16T19:01:30.685723Z”,
“build_snapshot” : false,
“lucene_version” : “*****”,
“minimum_wire_compatibility_version” : "”,
“minimum_index_compatibility_version” : “*****”
},
“tagline” : “You Know, for Search”
}
这就意味着你现在已经启动并运行一个 Elasticsearch 节点了,你可以用它做实验了。 单个 节点 可以作为一个运行中的 Elasticsearch 的实例。 而一个 集群 是一组拥有相同 cluster.name 的节点, 他们能一起工作并共享数据,还提供容错与可伸缩性。(当然,一个单独的节点也可以组成一个集群) 你可以在 elasticsearch.yml 配置文件中修改 cluster.name ,该文件会在节点启动时加载
转载https://www.cnblogs.com/BlogNetSpace/p/9628507.html