您好,登錄后才能下訂單哦!
Linux 安裝
java -version
echo $JAVA_HOME
木有返回,環(huán)境沒有設(shè)置好。。。
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_162
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
刷新下
source /etc/profile
有了
下載
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.tar.gz
tar -zxvf elasticsearch-6.2.3.tar.gz
cd elasticsearch-6.2.3/bin
./elasticsearch
容我修個(gè)錯(cuò)誤
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
這個(gè)錯(cuò)誤,是因?yàn)槭褂胷oot用戶啟動(dòng)elasticsearch,elasticsearch是不允許使用root用戶啟動(dòng)的,所以我們需要添加用戶,或者加一個(gè)參數(shù)。
cp -r elasticsearch-6.2.3 /usr/
su pactera
./elasticsearch
Exception in thread "main" java.nio.file.AccessDeniedException: /usr/elasticsearch-6.2.3/config/jvm.options
容我再修個(gè)錯(cuò)誤
感覺目錄沒權(quán)限,加一個(gè)
chown pactera /usr/elasticsearch-6.2.3/ -R
chown -R 文件夾名 用戶名
內(nèi)存設(shè)置小了,不過可以忽略
ES5之前可以用這個(gè),6就不行了
vi bin/elasticsearch
ES_JAVA_OPTS="-Des.insecure.allow.root=true"
或者啟動(dòng)加參數(shù)
./elasticsearch -Des.insecure.allow.root=true
以后臺(tái)服務(wù)運(yùn)行
./elasticsearch -d
curl -i localhost:9200
本地訪問有數(shù)據(jù),但是遠(yuǎn)程訪問無法,容我修個(gè)錯(cuò)誤
vi config/elasticsearch.yml
network.host: 0.0.0.0
改成IP后無法公開ip
bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
又出現(xiàn)3個(gè)錯(cuò)誤,繼續(xù)踩坑
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: memory locking requested for elasticsearch process but memory is not locked
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
錯(cuò)誤2
vi elasticsearch.yml
加入2行
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
錯(cuò)誤3
max virtual memory增加10倍總歸沒錯(cuò)了吧
臨時(shí)增加
sysctl -w vm.max_map_count=655360
sysctl -a | grep "vm.max_map_count"
或者永久解決
vi /etc/sysctl.conf
vm.max_map_count=655360
sysctl -p
剩下錯(cuò)誤1,最大文件描述
[2018-04-16T10:43:04,079][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
然后需要重啟下
192.168.209.160:9200 可以從外網(wǎng)訪問了
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.msi
這組件十分的傻瓜。。。。
免責(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)容。