說明
https://www.elastic.co/downloads/past-releases 官網的現在下載頁面。進入以後選擇對應的產品和版本進行下載。
不要打開中文版,幾乎所有鏈接都會定位到廣告頁面,無法獲取有用信息。
截止2019-05-10,最新的java版本的ES依賴只支持到6.x,而最新版本的ES已經到7.x。要注意版本對應,否則java和ES交互的時候會報錯,版本不兼容。
下載
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gz
安裝
tar xf elasticsearch-6.4.3.tar.gz
groupadd elsearch
useradd elsearch -g elsearch
chown -R elsearch:elsearch elasticsearch-6.4.3
su elsearch
./elasticsearch -d 後臺啓動
錯誤處理
錯誤1:
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
原因:
es設置了保護機制,禁止使用root賬號進行操作,切換用戶
解決:
groupadd elsearch
useradd elsearch -g elsearch
su elsearch
錯誤2:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
原因:
如果是此錯誤,這個錯誤是因爲centos6的內核不支持SecComp,所以我們需要禁止這個功能
解決:
vim elasticsearch.yml