Elasticsearch 6.x 下载安装
下載ES
下載ES安裝包上傳至服務器,地址為:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.0.tar.gz上傳完成后解壓
tar -zxvf elasticsearch-6.1.0.tar.gz安裝JDK
這里使用jdk8,官網下載安裝即可,這里不做講解
export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
修改Linux配置
1.編輯 /etc/security/limits.conf,追加以下內容; * soft nofile 65536 * hard nofile 655362.在/etc/sysctl.conf文件最后添加一行 vm.max_map_count=262144 sysctl -p修改ES配置文件
# ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # # 集群名稱 cluster.name: log_cluster # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # # 節點名稱 node.name: node_01 # 是否可以為主節點 node.master: true # 是否可以為數據節點 node.data: true # 允許在對文檔進行索引之前進行預處理 node.ingest: true # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # # 數據存儲目錄,默認在es目錄下data #path.data: /path/to/data # # Path to log files: # # 日志存儲目錄,默認在es目錄下logs #path.logs: /path/to/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # # 鎖定物理內存地址,防止es內存被交換出去,也就是避免es使用swap交換分區,頻繁的交換,會導致IOPS變高 bootstrap.memory_lock: true # 禁止檢測SecComp bootstrap.system_call_filter: false # 當前機器ip地址,0.0.0.0 代表當前 network.host: 10.10.0.1 # 是否使用http協議對外提供服務,默認為true,開啟 http.enabled: true # 設置對外服務的http端口,默認為9200 http.port: 9200 # 設置節點間交互的tcp端口,默認是9300 transport.tcp.port: 9300 # 設置是否壓縮tcp傳輸時的數據,默認為false,不壓縮 transport.tcp.compress: true # # For more information, consult the network module documentation. http.cors.enabled: true http.cors.allow-origin: "*" # # --------------------------------- Discovery ---------------------------------- # # 設置集群中master節點的初始列表,可以通過這些節點來自動發現新加入集群的節點 discovery.zen.ping.unicast.hosts: ["10.10.0.1:9300","10.10.0.2:9300","10.10.0.3:9300"] # # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): # # 設置這個參數來保證集群中的節點可以知道其它N個有master資格的節點。默認為1,(total number of master-eligible nodes / 2 + 1) discovery.zen.minimum_master_nodes: 1 # # For more information, consult the zen discovery module documentation. # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # #gateway.recover_after_nodes: 3 # # For more information, consult the gateway module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true # ---------------------------------- Cache -----------------------------------# 啟用腳本 默認painless cluster.routing.allocation.same_shard.host: true # # TODO 集群搭建好后配置 # # # #超時時間 discovery.zen.ping_timeout: 5s discovery.zen.fd.ping_timeout: 5s # # #禁止自動創建索引 action.auto_create_index: true # # # 一個集群中的N個節點啟動后,才允許進行恢復處理 gateway.recover_after_nodes: 1 # # # # 設置初始化恢復過程的超時時間,超時時間從上一個配置中配置的N個節點啟動后算起 gateway.recover_after_time: 5m # # # # 設置這個集群中期望有多少個節點.一旦這N個節點啟動(并且recover_after_nodes也符合), # # 立即開始恢復過程(不等待recover_after_time超時) gateway.expected_nodes: 2 # # 線程池 thread_pool.search.size: 100 thread_pool.search.queue_size: 1000啟動es
./elasticsearch -d -p pid瀏覽器訪問端口
啟動成功
安裝head插件
安裝npm
yum install -y npm下載插件上傳到服務器:GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster
執行 npm install 安裝
安裝過程中提示如下warn
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
修改 package.json ,中license 如下圖所示即可
?后臺啟動 head 插件
nohup npm run start > run.log &訪問 ip:9100 ,顯示如下,安裝成功
Kibana 安裝
下載?https://artifacts.elastic.co/downloads/kibana/kibana-6.1.0-linux-x86_64.tar.gz?并上傳到服務器,解壓
在kibana conf目錄下修改kibana.yml文件
server.host: "10.10.0.1" elasticsearch.url: "http://10.10.0.1:9200"啟動kibana
nohup bin/kibana > kibana.log &頁面訪問 10.10.0.1:5601
安裝成功
異常1:
kibana啟動報錯:
{"type":"error","@timestamp":"2019-08-30T05:47:57Z","tags":["fatal"],"pid":3026,"level":"fatal","error":{"message":"listen EADDRNOTAVAIL 192.169.1.111:5606","name":"Error","stack":"Error: listen EADDRNOTAVAIL 192.169.1.111:5606\n at Object.exports._errnoException (util.js:1020:11)\n at exports._exceptionWithHostPort (util.js:1043:20)\n at Server._listen2 (net.js:1249:19)\n at listen (net.js:1298:10)\n at net.js:1408:9\n at _combinedTickCallback (internal/process/next_tick.js:83:11)\n at process._tickCallback (internal/process/next_tick.js:104:9)","code":"EADDRNOTAVAIL"},"message":"listen EADDRNOTAVAIL 192.169.1.111:5606"} FATAL { Error: listen EADDRNOTAVAIL 192.169.1.111:5606at Object.exports._errnoException (util.js:1020:11)at exports._exceptionWithHostPort (util.js:1043:20)at Server._listen2 (net.js:1249:19)at listen (net.js:1298:10)at net.js:1408:9at _combinedTickCallback (internal/process/next_tick.js:83:11)at process._tickCallback (internal/process/next_tick.js:104:9)cause: { Error: listen EADDRNOTAVAIL 192.169.1.111:5606at Object.exports._errnoException (util.js:1020:11)at exports._exceptionWithHostPort (util.js:1043:20)at Server._listen2 (net.js:1249:19)at listen (net.js:1298:10)at net.js:1408:9at _combinedTickCallback (internal/process/next_tick.js:83:11)at process._tickCallback (internal/process/next_tick.js:104:9)code: 'EADDRNOTAVAIL',errno: 'EADDRNOTAVAIL',syscall: 'listen',address: '192.169.1.111',port: 5606 },isOperational: true,code: 'EADDRNOTAVAIL',errno: 'EADDRNOTAVAIL',syscall: 'listen',address: '192.169.1.111',port: 5606 }將server.host 修改為 0.0.0.0 ,再次啟動恢復
server.host: "0.0.0.0" elasticsearch.url: "http://192.168.1.111:9200"總結
以上是生活随笔為你收集整理的Elasticsearch 6.x 下载安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LPTSTR、LPCSTR、LPCTST
- 下一篇: MTU最大传输单元