1.Elasticsearch 5.3.2下载:
(1)官网下载:https://www.elastic.co/downloads
(2)或curl -L-O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.2.tar.gz
2.解压:
tar -xvf elasticsearch-5.3.2.tar.gz
3.启动:
cd elasticsearch-5.3.2/bin
./elasticsearch -d
[2017-04-29T17:13:37,746][INFO ][o.e.n.Node ] initialized
[2017-04-29T17:13:37,746][INFO ][o.e.n.Node ] [Q0g23gd] starting ...
[2017-04-29T17:13:37,921][INFO ][o.e.t.TransportService ] [Q0g23gd] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2017-04-29T17:13:37,929][WARN ][o.e.b.BootstrapChecks ] [Q0g23gd] max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2017-04-29T17:13:37,930][WARN ][o.e.b.BootstrapChecks ] [Q0g23gd] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2017-04-29T17:13:37,930][WARN ][o.e.b.BootstrapChecks ] [Q0g23gd] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2017-04-29T17:13:41,007][INFO ][o.e.c.s.ClusterService ] [Q0g23gd] new_master {Q0g23gd}{Q0g23gdXTXOQ_YAVeMDT6Q}{HsVeCKMtRmWD3buzqUDmpA}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-04-29T17:13:41,042][INFO ][o.e.g.GatewayService ] [Q0g23gd] recovered [0] indices into cluster_state
[2017-04-29T17:13:41,042][INFO ][o.e.h.n.Netty4HttpServerTransport] [Q0g23gd] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2017-04-29T17:13:41,045][INFO ][o.e.n.Node ] [Q0g23gd] started
或启动时自定义集群及节点名称:
./elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name
4.验证:
$ ps -ef | grep elasticsearch
supdev 606 31099 3 17:25 pts/0 00:00:13 /home/wy/java/default/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/export/opt/elasticsearch-5.3.2 -cp /export/opt/elasticsearch-5.3.2/lib/elasticsearch-5.3.2.jar:/export/opt/elasticsearch-5.3.2/lib/* org.elasticsearch.bootstrap.Elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name
supdev 1141 31099 0 17:32 pts/0 00:00:00 grep elasticsearch
端口:
$ netstat -apn | grep 9200
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 ::ffff:127.0.0.1:9200 :::* LISTEN 606/java
tcp 0 0 ::1:9200 :::* LISTEN 606/java
$ netstat -apn | grep 9300
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 ::ffff:127.0.0.1:9300 :::* LISTEN 606/java
tcp 0 0 ::1:9300 :::* LISTEN 606/java