Ubuntu16.04安裝ElasticSearch2.4.6
阿新 • • 發佈:2020-12-30
技術標籤:Ubuntulinuxelasticsearches
1、下載ES
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.6/elasticsearch-2.4.6.tar.gz
2、解壓並將其放到/usr/local目錄下
tar -xzvf elasticsearch-2.4.6.tar.gz -C /usr/local/
3、修改配置
cd /usr/local/elasticsearch-2.4.6/config/ vi elasticsearch.yml 新增如下內容: cluster.name: my-application node.name: node-1 bootstrap.memory_lock: true index.cache.field.max_size: 50000 index.cache.field.expire: 30m index.cache.field.type: soft network.host: 0.0.0.0 action.disable_delete_all_indices : true
4、安裝JDK(忽略)
5、配置JAVA環境變數
vi /etc/profile
新增如下內容
#set Java environment
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
6、新增使用者
adduser elastic
7、修改所屬使用者
chown -R elastic /usr/local/elasticsearch-2.4.6
8、啟動
su elastic
source /etc/profile
cd /usr/local/elasticsearch-2.4.6/bin
./elasticsearch
#後臺執行
./elasticsearch -d
9、瀏覽器檢視
http://localhost:9200/