1. 程式人生 > >elasticsearch 6.4.2 linux 安裝以及問題

elasticsearch 6.4.2 linux 安裝以及問題

1、安裝elasticsearch

官網下載

下載得到壓縮包 解壓

#tar -zxvf elasticsearch-6.4.2.tar.gz

#mv elasticsearch-6.4.2 /usr/local/elasticsearch

#cd /usr/local/elasticsearch/

啟動elasticsearch

配置

#vi config/elasticsearch.yml 
network.host: 0.0.0.0

http.port: 9200

root 使用者啟動會報錯 安全機制

所以新建一個使用者 賦予elasticsearch許可權

#chown -R elsk elasticsearch

切換到elsk使用者 啟動

./bin/elasticsearch

報錯:

ERROR: bootstrap checks failed

#vi config/elasticsearch.yml 

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

報錯:

max number of threads [2048] for user [elsk] is too low, increase to at least [4096]

需修改

#vi /etc/security/limits.conf



* soft nofile 65536



* hard nofile 131072



* soft nproc 2048



* hard nproc 4096
#vi /etc/security/limits.d/90-nproc.conf

*          soft    nproc     4096

#sysctl -p

後臺啟動 -d

#./bin/elasticsearch -d

返回以下內容標識成功

curl "http://ip:9200/"

{

"name": "node-1",

"cluster_name": "my-application",

"cluster_uuid": "DvFQ4hoGTy-r6Ba7Mio3mA",

"version": {

"number": "6.4.2",

"build_flavor": "default",

"build_type": "tar",

"build_hash": "04711c2",

"build_date": "2018-09-26T13:34:09.098244Z",

"build_snapshot": false,

"lucene_version": "7.4.0",

"minimum_wire_compatibility_version": "5.6.0",

"minimum_index_compatibility_version": "5.0.0"

},

"tagline": "You Know, for Search"

}

2、ik安裝

#./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.2/elasticsearch-analysis-ik-6.4.2.zip

3、kibana安裝

官網下載對應版本

https://www.elastic.co/downloads/kibana

同上解壓

配置

#vim kibana/config/kibana.yml

server.port: 5601

server.host: “0.0.0.0”

server.name: "es"

elasticsearch.url: "http://ip:9200"

elasticsearch.username: "user"

elasticsearch.password: “pass”

xpack.reporting.encryptionKey: "a_random_string"

xpack.security.encryptionKey: "something_at_least_32_characters"

在kibana下執行

#./bin/kibana

後臺不輸出日誌執行

#nohup ./bin/kibana > /dev/null 2>&1 &

啟動警告

Session cookies will be transmitted over insecure connections. This is not recommended

不安全連線

瀏覽器檢視是否成功

http://ip:5601