1、下载
[root@node1 ~]# wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/2.1.1.tar.gz
--13:05:54-- https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz
Resolving download.elasticsearch.org... 184.72.233.150, 184.72.222.192, 107.22.185.174, ...
Connecting to download.elasticsearch.org|184.72.233.150|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29007342 (28M) [application/gzip]
Saving to: `elasticsearch-2.1.1.tar.gz'
100%[=======================================>] 29,007,342 124K/s in 5m 40s
13:11:47 (83.4 KB/s) - `elasticsearch-2.1.1.tar.gz' saved [29007342/29007342]
2、解压
[root@node1 ~]# tar -zxvf elasticsearch-2.1.1.tar.gz
[root@node1 ~]# cd elasticsearch-2.1.1
[root@node1 elasticsearch-2.1.1]# ls
bin config lib LICENSE.txt NOTICE.txt README.textile
[root@node1 elasticsearch-2.1.1]# cd config/
[root@node1 config]# ls
elasticsearch.yml logging.yml
[root@node1 config]# cd ../bin/
[root@node1 bin]# ls
elasticsearch elasticsearch-service-mgr.exe plugin.bat
elasticsearch.bat elasticsearch-service-x64.exe service.bat
elasticsearch.in.bat elasticsearch-service-x86.exe
elasticsearch.in.sh plugin
[root@node1 bin]#
3、启动
不能以root用户启动
[root@node1 bin]# sh elasticsearch
Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
[root@node1 ~]# mv elasticsearch-2.1.1 /opt/
[root@node1 ~]# ls
anaconda-ks.cfg influxdb-0.9.4.2-1.x86_64.rpm
apache-flume-1.6.0-bin.tar.gz install.log
apache-tomcat-7.0.67.zip install.log.syslog
collectd-5.5.0 jdk-7u67-linux-x64.rpm
collectd-5.5.0.tar.gz kafka_2.9.1-0.8.2.2.tgz
Desktop kibana-4.3.1-linux-x64.tar.gz
elasticsearch-2.1.1.rpm logstash-2.1.1.tar.gz
elasticsearch-2.1.1.tar.gz logstash-2.1.1.tar.gz.1
facette-0.3.0 tomcat7
facette-0.3.0.tar.gz wget-log
grafana-1.9.1.tar.gz
[root@node1 ~]# cd /opt/
[root@node1 opt]# ls
collectd influxdb
elasticsearch-2.1.1 nagios
flume1.6 nagios-3.4.3.tar.gz
grafana-2.5.0 nagios-plugins-1.4.13
grafana-2.5.0.linux-x64.tar.gz nagios-plugins-1.4.13.tar.gz
hadoop ORCLfmap
hadoop_data php-5.4.10
httpd-2.2.23 php-5.4.10.tar.gz
httpd-2.2.23.tar.gz
[root@node1 opt]# chown -R hadoop.hadoop elasticsearch-2.1.1/
[root@node1 opt]# cd elasticsearch-2.1.1/
[root@node1 elasticsearch-2.1.1]# cd bin/
[root@node1 bin]# su -
[root@node1 ~]# su - hadoop
[hadoop@node1 bin]$ sh elasticsearch
[2016-02-01 13:25:53,738][WARN ][bootstrap ] unable to install syscall filter: prctl(PR_GET_NO_NEW_PRIVS): Invalid argument
[2016-02-01 13:25:54,949][INFO ][node ] [Lord Pumpkin] version[2.1.1], pid[15896], build[40e2c53/2015-12-15T13:05:55Z]
[2016-02-01 13:25:54,950][INFO ][node ] [Lord Pumpkin] initializing ...
[2016-02-01 13:25:55,453][INFO ][plugins ] [Lord Pumpkin] loaded [], sites []
[2016-02-01 13:25:55,639][INFO ][env ] [Lord Pumpkin] using [1] data paths, mounts [[/ (/dev/hdc2)]], net usable_space [8.1gb], net total_space [17.1gb], spins? [possibly], types [ext3]
[2016-02-01 13:26:02,009][INFO ][node ] [Lord Pumpkin] initialized
[2016-02-01 13:26:02,009][INFO ][node ] [Lord Pumpkin] starting ...
[2016-02-01 13:26:02,148][INFO ][transport ] [Lord Pumpkin] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2016-02-01 13:26:02,189][INFO ][discovery ] [Lord Pumpkin] elasticsearch/TFLinZ5uTKq6-glWOA5j8g
[2016-02-01 13:26:05,277][INFO ][cluster.service ] [Lord Pumpkin] new_master {Lord Pumpkin}{TFLinZ5uTKq6-glWOA5j8g}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-02-01 13:26:05,349][INFO ][http ] [Lord Pumpkin] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2016-02-01 13:26:05,351][INFO ][node ] [Lord Pumpkin] started
[2016-02-01 13:26:05,391][INFO ][gateway ] [Lord Pumpkin] recovered [0] indices into cluster_state
4、验证
[root@node1 ~]# curl -X GET http://localhost:9200/
{
"name" : "Lord Pumpkin",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.1.1",
"build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71",
"build_timestamp" : "2015-12-15T13:05:55Z",
"build_snapshot" : false,
"lucene_version" : "5.3.1"
},
"tagline" : "You Know, for Search"
}
5、修改Host
[root@node1 config]# vi elasticsearch.yml
# Path to log files:
# network.host: 192.168.1.113