您好,登錄后才能下訂單哦!
1. 從Elastic官網(wǎng)下載最新版本的Elasticsearch,目前最新版本為V2.3.3。
2. 解壓
tar zxvf elasticsearch-2.3.2.tar.gz
3. 切換到Elasticsearch的bin目錄下,啟動(dòng)服務(wù)。
./elasticsearch Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
啟動(dòng)時(shí)會(huì)發(fā)現(xiàn)Elasticsearch會(huì)報(bào)如下錯(cuò)誤,因?yàn)镋lasticsearch為安全起見(jiàn)不允許使用root賬號(hào)啟動(dòng)服務(wù)。
4. 創(chuàng)建一個(gè)新賬號(hào)
[root@Server01 bin]# useradd elasticsearchuser [root@Server01 bin]# passwd elasticsearchuser Changing password for user elasticsearchuser. New password: BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully. [root@Server01 bin]# usermod -g root elasticsearchuser
5. 重新啟動(dòng)服務(wù)。
[elasticsearchuser@Server01 bin]$ ./elasticsearch [2016-05-19 16:44:41,864][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in [2016-05-19 16:44:42,190][INFO ][node ] [Genis-Vell] version[2.3.2], pid[8878], build[b9e4a6a/2016-04-21T16:03:47Z] [2016-05-19 16:44:42,191][INFO ][node ] [Genis-Vell] initializing ... [2016-05-19 16:44:42,774][INFO ][plugins ] [Genis-Vell] modules [lang-groovy, reindex, lang-expression], plugins [], sites [] [2016-05-19 16:44:42,805][INFO ][env ] [Genis-Vell] using [1] data paths, mounts [[/ (/dev/sda2)]], net usable_space [486.6gb], net total_space [533.7gb], spins? [possibly], types [ext4] [2016-05-19 16:44:42,805][INFO ][env ] [Genis-Vell] heap size [990.7mb], compressed ordinary object pointers [true] [2016-05-19 16:44:42,805][WARN ][env ] [Genis-Vell] max file descriptors [20480] for elasticsearch process likely too low, consider increasing to at least [65536] [2016-05-19 16:44:44,758][INFO ][node ] [Genis-Vell] initialized [2016-05-19 16:44:44,758][INFO ][node ] [Genis-Vell] starting ... [2016-05-19 16:44:44,858][INFO ][transport ] [Genis-Vell] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300} [2016-05-19 16:44:44,863][INFO ][discovery ] [Genis-Vell] elasticsearch/kpitDjQNTwu8Q4D4pbWXnQ [2016-05-19 16:44:47,910][INFO ][cluster.service ] [Genis-Vell] new_master {Genis-Vell}{kpitDjQNTwu8Q4D4pbWXnQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received) [2016-05-19 16:44:47,923][INFO ][http ] [Genis-Vell] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200} [2016-05-19 16:44:47,923][INFO ][node ] [Genis-Vell] started [2016-05-19 16:44:48,020][INFO ][gateway ] [Genis-Vell] recovered [0] indices into cluster_state
6. 服務(wù)也可以以守護(hù)進(jìn)程方式運(yùn)行
./elasticsearch -d
還可以在啟動(dòng)時(shí)同時(shí)指定pid
./elasticsearch -d -p pid
7. 在瀏覽器中訪(fǎng)問(wèn)一下,再次確認(rèn)服務(wù)是完好的,但前提是修改/config/elasticsearch.yml,找到 network.host在下面添加一行,然后就可以在瀏覽器中訪(fǎng)問(wèn)http://10.0.0.5:9200/。
network.host : 10.0.0.5
瀏覽器顯示內(nèi)容如下:
{ "name" : "Gargouille", "cluster_name" : "elasticsearch", "version" : { "number" : "2.3.2", "build_hash" : "b9e4a6acad4008027e4038f6abed7f7dba346f94", "build_timestamp" : "2016-04-21T16:03:47Z", "build_snapshot" : false, "lucene_version" : "5.5.0" }, "tagline" : "You Know, for Search" } |
至此,Elasticsearch安裝啟動(dòng)完畢,更詳細(xì)的操作還待后文。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。