1. 程式人生 > >linux上安裝啟動elasticsearch-5.5.1完整步驟

linux上安裝啟動elasticsearch-5.5.1完整步驟

1、獲取ES安裝包
#cd /var/www/
#wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
或者通過xshell rz命令從windows上傳elasticsearch-5.5.1.zip到linux伺服器
2、解壓
#unzip elasticsearch-5.5.1.zip
3、新建一個使用者用來配置、啟動es,es無法從root啟動
#adduser esuser
#chown -R esuser /var/www/elasticsearch-5.5.1/


4、切換為esuser:
#su esuser
#chmod 777 /var/www/elasticsearch-5.5.1/


5、修改配置檔案,提供外網訪問:
#vim /var/www/elasticsearch-5.5.1/config/elasticsearch.yml
新增
network.host: <本機ip,儘量使用內網IP>
http.host: 0.0.0.0


節點之間通訊,每個節點都需要的配置
discovery.zen.ping.unicast.hosts: ["Node1_IP:9300", "Node2_IP:9300", "Node3_IP:9300"]


參考:http://www.jianshu.com/p/fa31f38d241e


6、啟動
elasticsearch-5.5.1執行需要java8


若系統java環境預設不是java8,安裝了java8後,啟動前可以設定:
#export JAVA_HOME=<jdk1.8安裝目錄>


啟動為後臺
#cd /var/www/elasticsearch-5.5.1/bin
#./elasticsearch -d


完成


幾乎每一次裝都會遇到的坑,這些坑只有5.x.x版本有,2.x.x版本的幾乎沒有遇到過:
1、機器內剩餘記憶體較少,會啟動失敗,並且有類似如下報錯:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x000000008a660000, 1973026816, 0) failed; error='Cannot allocate memory' (errno=12)
這是因為es的jvm引數-Xmx和-Xms預設都為2G
修改config下的jvm.option檔案
# vim elasticsearch/elasticsearch-5.5.1/config/jvm.opstions

-Xms2g
-Xmx2g 
改為
-Xms1g
-Xmx1g
或更小
-Xms512M
-Xmx512M
再次啟動即可


2、啟動的時候出現:


1、
ERROR: bootstrap checks failed
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.x.x預設bootstrap.system_call_filter為true進行檢測,所以導致檢測失敗,失敗後直接導致ES不能啟動。詳見 :https://github.com/elastic/elasticsearch/issues/22899


解決方法:在elasticsearch.yml中配置bootstrap.system_call_filter為false,注意要在Memory下面: 
bootstrap.memory_lock: false 
bootstrap.system_call_filter: false




2、
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] 
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]


解決方法:切換到root使用者,編輯limits.conf 新增類似如下內容


#vim /etc/security/limits.conf


新增如下內容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096


3、
max number of threads [1024] for user [lish] likely too low, increase to at least [2048]


解決方法:切換到root使用者,進入limits.d目錄下修改配置檔案。
#vim /etc/security/limits.d/90-nproc.conf


修改如下內容:

* soft nproc 1024
修改為
* soft nproc 2048


4、
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]


解決方法:切換到root使用者修改配置sysctl.conf


#vim /etc/sysctl.conf


新增下面配置:
vm.max_map_count=655360
並執行命令:
#sysctl -p
然後,再啟動elasticsearch,即可啟動成功。




參考:
http://blog.csdn.net/liagliang/article/details/62423100?utm_source=itdadao&utm_medium=referral




如何關閉:
得到es的pid
#lsof -i:9200
#kill -9 <es的pid>

相關推薦

linux安裝啟動elasticsearch-5.5.1完整步驟

1、獲取ES安裝包#cd /var/www/#wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip或者通過xshell rz命令從windows上傳elastics

Linux 安裝Docker 並部署netcor2.1

述 容器,顧名思義是用來存放並容納東西的器皿; 而容器技術伴著Docker的興起也漸漸的映入大家的眼簾,它是一個抽象的概念,同時也是默默存在世上多年的技術,不僅能使應用程式間完全的隔離,而且還能在共享底層系統資源的同時發揮它最大的優勢。相比於虛擬機器來說,同一伺服器它可以創建出兩倍的例項,這樣一來,不僅節

linux安裝es(elasticsearch)及一些常見命令

/usr/src/es   下載es的安裝包儲存到當前目錄下(.tar)    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz    刪除檔案:    

在CentOS6.5安裝/啟動PostgreSQL

CentOS install PostgreSQL yum install postgresql-server Start PostgreSQL service postgresql initdb # 初始化資料庫 service postgressql start L

Linux安裝設定mysql 5.7.24

一,準備 1,先檢視Linux是32位還是64位 getconf LONG_BIT 如果返回的是32,那麼就是32位 如果返回的是64,那麼就是64位 2,如果伺服器不能聯網,就先去官網下載好壓縮包,然後上傳到伺服器 下載地址:https://dev.mysql.com/downloads/mys

Linux安裝mysql-5.6版本(命令安裝和解壓安裝)

Linux命令安裝mysql-5.6版本 1.更新apt-get sudo apt-get update 2.安裝 mysql-server-5.6 sudo apt-get install mysql-server-core-5.6 sudo apt

linux安裝 elasticsearch-php

api 其他 sea 文章 article aid 執行 我們 cnblogs 一、在Linux上安裝es的好文章:(完全按照安裝下來,沒出現一點問題) http://jingyan.baidu.com/article/a65957f4d23de824e77f9b70.

Linux安裝Elasticsearch Kibaba.md

得到 user ads sea gpo ide 密碼 如果 執行 在Linux上安裝Elasticsearch Kibaba Kibana是一個開源為elasticsearch 引擎提供數據和數據分析 1、下載安裝 切換到root賬戶,按順序依次執行以下命令 rpm包安裝

安裝dcm4chee-arc-light-5.4.1-mysql步驟

listen 其它 是否一致 oot fly 應用 刪除 rc.d user 一.進入網址: https://github.com/dcm4che/dcm4chee-arc-light/wiki/Installation這個是GitHub上面給的步驟,可能會比較難理解,

Linux安裝MySQL資料庫mysql-5.7.11

Linux下安裝MySQL資料庫(壓縮包方式安裝) https://www.cnblogs.com/xiaotao726/p/6562265.html PS:9、建立In ln -s /usr/local/mysql/ /usr/bin/ 連線資料庫時會顯示:[[email protecte

Centos 7安裝及配置MySQL 5.6.26

1、解除安裝系統自帶Mariadb Centos7 已經不自帶MySQL,自帶內部集成了Mariadb,而安裝MySQL的話會和Mariadb的檔案衝突,所以需要先解除安裝掉Mariadb,再安裝MySQL。 [[email protected] ~]

Linux安裝Qt Creator 2.5

下載版本:qt-creator-linux-x86_64-opensource-2.5.2.bin 1、安裝過程 使用終端cd到你剛剛存放Qt Creator的臨時目錄,修改bin檔案的許可權使其具有可執行的許可權: chmod a+x qt-creator-linux-x86_64-o

[Zephyr] 1、在linux安裝Zephyr-OS並跑DEMO

星期五, 14. 九月 2018 02:18上午 - BEAUTIFULZZZZ 1)下載、克隆到本地 將zephyr克隆到本地home目錄下: cd ~ git clone [email protected]:zephyrproject-rtos/zephyr.git 2) Zephyr Bu

ElasticSearchLinux安裝

在Linux安裝elasticsearch,這裡使用的是版本是elasticsearch-6.3.2.tar.gz 安裝之前首先要保證已經安裝了jdk,並且版本是1.8或者以上 1.用下載好的壓縮包上傳到linux的/usr/local目錄下,進行解壓 tar -x

linux安裝zookeeper 啟動/關閉

1.zookeeper執行需要java環境所以必須先裝JDK 2.下載,解壓 #wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.12/zookeeper-3.4.12.tar.gz #tar

Linux安裝elasticsearch遇到的坑

Failed to find a usable hardware address from the network interfaces; using random bytes: 17:1b:ec:c4:bd:20:1c:62 [2018-07-25T21:04:22,630][WARN ][o.

linux安裝啟動redis(原始碼安裝

最近從阿里租了臺雲伺服器玩玩,隨手記錄下在linux伺服器上原始碼安裝redis的過程安裝前準備:由於redis底層用c語言編寫的,安裝redis需要先將官網下載的原始碼進行編譯,編譯依賴gcc環境,如果沒有gcc環境,需要安裝gcc:yum install gcc-c++安

一步一步在Linux安裝Oracle 11gR2 RAC (1)

接下來,完全參照上述建立虛擬機器步驟,建立第2個節點,虛擬機器命名為11gnode2,在配置網路步驟中,需要注意,將其eth0配置為172.16.0.192,eth1配置為192.168.94.12,主機名為node2.localdomain。

阿里雲Linux安裝MySql5.6、5.7、8.0版本和解除安裝以及遠端連線

在安裝的時候參考了很多部落格,但是發現還是 MySql的官網給的步驟最有效,最權威。 適合: Debian 7,8,9 Ubuntu 14.04,16.04,17.10,18.04 下面記錄下我安裝的步驟: 1,新增 MySQL APT儲存庫 首先我們需要

Mac安裝 apache-maven-3.5.3 步驟(詳細)

首先下載: 點選這個可以找到你想要的版本號 vi ~/.bash_profile  插入: export M2_HOME=/Users/heai/code/wondertek-code