本篇內容主要講解“Linux下安裝Elasticsearch的步驟”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Linux下安裝Elasticsearch的步驟”吧!
下載地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
步驟一:上傳Linux、解壓
上傳Linux服務器: rz Elasticsearch 6.7.2 解壓Es: sudo tar xvf Elasticsearch 6.7.2
步驟二:修改配置文件
步驟三:啟動Es
[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ ./bin/elasticsearch 備注:后臺啟動 sh elasticsearch.sh & nohup sh elasticsearch & nohup sh elasticsearch.sh &
問題1:java.nio.file.AccessDeniedException:Exception in thread "main" java.nio.file.AccessDeniedException: /home/elasticsearch/elasticsearch-6.7.2/config/jvm.options
原因:當前用戶沒有執行權限
權限不足:[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ chown -R dev:dev elasticsearch-6.7.2
問題2: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
原因:用戶擁有的內存權限太小,至少需要262144。
解決方案:方案一
切換到root用戶
執行命令:sysctl -w vm.max_map_count=262144
查看結果:sysctl -a|grep vm.max_map_count
顯示:vm.max_map_count = 262144
解決方案:方案二
[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ sudo vim /etc/sysctl.conf vm.max_map_count=655360 [dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ sudo sysctl -p
問題3:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
原因: 這是在因為Centos6不支持SecComp,而ES5.2.0默認bootstrap.system_call_filter為true進行檢測,所以導致檢測失敗,失敗后直接導致ES不能啟動。
解決方案: 在elasticsearch.yml中配置bootstrap.system_call_filter為false,
注意要在Memory下面:
bootstrap.memory_lock: false bootstrap.system_call_filter: false
問題4: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
解決方案:修改/etc/security/limits.conf文件
# End of file * soft nofile 65536 * hard nofile 65536 * soft nproc 6552 "/etc/security/limits.conf" [converted] 53L, 1883C使用 ulimit -Hn 查看當前值
[dev@lihuan1-dev.bj1.haodf.net bin]$ sudo vim /etc/profile [dev@lihuan1-dev.bj1.haodf.net bin]$ ulimit -Hn 65535注意:修改完后要退出用戶重啟,再ulimit -Hn 查看當前值,已發生變化。
步驟一:官網下載
步驟二:解壓文件
步驟三:終端切換到bin目錄下
/Documents/opt/elasticsearch-cluster/elasticsearch-7.2.1/elasticsearch-7.2.1/bin
步驟四:啟動es
sh elasticsearch
步驟五:驗證結果
http://localhost:9200/
{
"name":"node-0",
"cluster_name":"es-cluster-7.2.1",
"cluster_uuid":"Fv0qn48ET1W7xvReE6QfcA",
"version":{
"number":"7.2.1",
"build_flavor":"default",
"build_type":"tar",
"build_hash":"fe6cb20",
"build_date":"2019-07-24T17:58:29.979462Z",
"build_snapshot":false,
"lucene_version":"8.0.0",
"minimum_wire_compatibility_version":"6.8.0",
"minimum_index_compatibility_version":"6.0.0-beta1"
},
"tagline":"You Know, for Search"
}到此,相信大家對“Linux下安裝Elasticsearch的步驟”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。