2016-11-04 83 views
2

我有elasticsearch安装代码流浪汉,我想颠沛流离了后运行elasticsearch,但我得到描述如下错误elasticsearch-5.0.0和无业游民

错误,我得到的,当流浪汉运行elasticsearch -5.0.0

default: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] 
它安装

install.sh文件弹性

# ELASTICSEARCH 

# install openjdk-8 
apt-get purge openjdk* 
add-apt-repository ppa:webupd8team/java -y 
apt-get update -y 
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections 
apt-get install oracle-java8-installer -y 

# install ES 
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz 

tar -xvf elasticsearch-5.0.0.tar.gz 

sudo sysctl -w vm.max_map_count=262144 
echo "vagrant soft  nofile   65536" | sudo tee --append /etc/security/limits.conf 
echo "vagrant hard  nofile   65536" | sudo tee --append /etc/security/limits.conf 
echo "session required pam_limits.so" | sudo tee --append /etc/pam.d/common-session 
sudo -H -u vagrant bash -c 'ulimit -n' 

# either of the next two lines is needed to be able to access "localhost:9200" from the host os 
echo "network.bind_host: 0" >> elasticsearch-5.0.0/config/elasticsearch.yml 
echo "network.host: 0.0.0.0" >> elasticsearch-5.0.0/config/elasticsearch.yml 
# enable dynamic scripting 
echo "script.inline: on" >> elasticsearch-5.0.0/config/elasticsearch.yml 
# enable cors (to be able to use Sense) 
echo "http.cors.enabled: true" >> elasticsearch-5.0.0/config/elasticsearch.yml 
echo "http.cors.allow-origin: /https?:\/\/.*/" >> elasticsearch-5.0.0/config/elasticsearch.yml 

sudo chown -R vagrant:vagrant elasticsearch-5.0.0 

startup.sh是无业游民供应方来看: “总是”

# elasticsearch settings and run 
sudo sysctl -w vm.max_mapy_count=262144 
su vagrant --shell /bin/bash --command "ulimit -n 65536" 
sudo -H -u vagrant bash -c 'elasticsearch-5.0.0/bin/elasticsearch' 

回答

1

我赶紧使用ubuntu16.04箱尝试,并没有面对这个问题。

我改了一下你的启动脚本,因为与vm.max_mapy_count

一个错字从Vagrantfile

config.vm.provision :shell, :path => "startup.sh", :run => 'always', :privileged => false 

startup.sh

# elasticsearch settings and run 
sudo sysctl -w vm.max_map_count=262144 
ulimit -n 65536 
nohup elasticsearch-5.0.0/bin/elasticsearch &> /home/vagrant/nohup.es.out& 

Elasticsearch正确启动和输出内捕获nohup文件。