ELK之elasticsearch5.6的安裝和head插件的安裝

這里選擇的elasticsearch為5.6的新版本,根據官方文檔有幾種暗裝方式:

https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

這里選擇rpm包安裝https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html

1、wget?https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.rpm

2、查看有哪些配置文件

[root@node1 ~]# cd /etc/elasticsearch/
[root@node1 elasticsearch]# ll
總用量 20
-rw-rw----. 1 root elasticsearch 3024 9月  19 14:00 elasticsearch.yml
-rw-rw----. 1 root elasticsearch 3123 9月  18 10:38 jvm.options
-rw-rw----. 1 root elasticsearch 4456 9月   7 11:12 log4j2.properties
drwxr-x---. 2 root elasticsearch 4096 9月   7 11:12 scripts

 elasticsearch常用配置在elasticsearch.yml文件中,關于jvm的一些配置在jvm.options文件中,日志的配置在log4j2.properties文件中

[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml 
cluster.name: my-elastic
node.name: node1
network.host: 0.0.0.0
http.port: 9200

 簡單配置之后然后啟動服務:/etc/init.d/elasticsearch start

默認日志文件為/var/log/elasticsearch/目錄下,啟動有報錯都可以根據報錯解決

這里將一些遇到的報錯及解決方法列一些出來:

1、max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
解決:
[root@node1 elasticsearch]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.*          soft    nproc     2048
root       soft    nproc     unlimited
2、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf配置文件,
cat /etc/sysctl.conf | grep vm.max_map_count
vm.max_map_count=262144
如果不存在則添加
echo "vm.max_map_count=262144" >>/etc/sysctl.conf
3、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
ulimit -n?65536
4、啟動異常: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,而ES默認bootstrap.system_call_filter為true進行檢測,所以導致檢測失敗,失敗后直接導致ES不能啟動
解決方法:在elasticsearch.yml中配置bootstrap.system_call_filter為false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false 添加此行
現在整個elasticsearch.yml配置如下:
[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml 
cluster.name: my-elastic
node.name: node1
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.port: 9200

 重新啟動elasticsearch服務,查看日志是否報錯,如沒有報錯,瀏覽器進行訪問是否有效:

現在為elasticsearch安裝上插件head,利用github找到head插件:

https://github.com/mobz/elasticsearch-head,根據文中說明:

There are multiple ways of running elasticsearch-head.

Running with built in server

  • git clone git://github.com/mobz/elasticsearch-head.git
  • cd elasticsearch-head
  • npm install
  • npm run start
  • open?http://localhost:9100/

This will start a local webserver running on port 9100 serving elasticsearch-head

Running as a plugin of Elasticsearch (deprecated)

  • for Elasticsearch 5.x: site plugins are not supported. Run?as a standalone server

?elasticsearch5.x以上需要安裝head插件需要作為一個單獨的服務,步驟如上,于是開始安裝:

如果沒有npm命令需要首先安裝上:  

安裝npm:
yum install npm ? ? ? ? ? ? ? ? ? ? ? epel源提供的
添加npm源:
npm install -g cnpm --registry=https://registry.npm.taobao.org
直接將本地的npm倉庫指向淘寶的鏡像地址
npm config set registry https://registry.npm.taobao.org
開始安裝head插件:
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start

 默認監聽在0.0.0.0,不需要修改監聽地址

這里有兩種啟動方式:

  1、npm run start(倉庫拉取下來的elasticsearch-head目錄下執行)

? ? ? ?2、[root@node1 elasticsearch-head]# ./node_modules/grunt/bin/grunt server

啟動后都是如下效果:

[root@node1 elasticsearch-head]# ./node_modules/grunt/bin/grunt server
Loading "watch.js" tasks...ERROR
>> Error: Cannot find module 'http-parser-js'Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

 查看日志:

[2017-09-19T13:50:36,288][INFO ][o.e.p.PluginsService ] [node1] no plugins loaded
[2017-09-19T13:50:38,401][INFO ][o.e.d.DiscoveryModule ] [node1] using discovery type [zen]
[2017-09-19T13:50:39,079][INFO ][o.e.n.Node ] [node1] initialized
[2017-09-19T13:50:39,079][INFO ][o.e.n.Node ] [node1] starting ...
[2017-09-19T13:50:39,239][INFO ][o.e.t.TransportService ] [node1] publish_address {192.168.44.134:9300}, bound_addresses {[::]:9300}

9100端口已經監聽了,訪問瀏覽器http://192.168.44.134:9100卻依然連接不到集群,然后谷歌到需要進行設置:

check?http.cors.enabled?and?http.cors.allow-origin?are set in?config/elasticsearch.yml?in order to enable cors.
Reference :?https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html

然后配置elastic,具體配置如下:

[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml 
cluster.name: my-elastic
node.name: node1
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
http.port: 9200

 重啟服務之后,瀏覽器訪問

至此elasticsearch5.6版本安裝head插件成功!!!

?

插件head的一些配置,如果node1不是監聽在0.0.0.0而是ip:

還有一個配置文件:(我這里沒有hostname這個選項)

?

轉載于:https://www.cnblogs.com/jsonhc/p/7551802.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/282378.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/282378.shtml
英文地址,請注明出處:http://en.pswp.cn/news/282378.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Nginx 基礎(一)

一 、Nginx簡述 Nginx是一個開源、高性能、可靠的HTTP中間件、代理服務。二 、常見的HTTP服務 1. HTTPD-Apache基金會 2. IIS-微軟 3. GWS-Google 4. Nginx三、為什么選擇Nginx 原因一:IO多路復用epoll (主要解決了并發性的問題) 注1&#xf…

Ajax基本案例詳解之load的實現

Ajax的load實現: 看這篇之前建議大家去看看前面兩篇文章: 1.Ajax基本案例詳解之$.ajax的實現 2.Ajax基本案例詳解之$.get的實現 現在寫一下$.load()里面的主要內容: $("#semail").load("doindex.jsp","email1&q…

ASP.NET Core高性能服務器HTTP.SYS

如果我們只需要將ASP.NET CORE應用部署到Windows環境下,并且希望獲得更好的性能,那么我們選擇的服務器類型應該是HTTP.SYS。Windows環境下任何針對HTTP的網絡監聽器/服務器在性能上都無法與HTTP.SYS比肩。[本文節選《ASP.NET Core 6框架揭秘》第18章]一、…

神經網絡- receptive field

記錄一下感受野的理解: 在神經網絡中,感受野的定義是: 神經網絡的每一層輸出的特征圖(Feature ap)上的像素點在原圖像上映射的區域大小。 1. 神經網絡中,第一個卷積層的 感受野大小,就等于filt…

734. [網絡流24題] 方格取數問題 二分圖點權最大獨立集/最小割/最大流

問題描述:在一個有m*n 個方格的棋盤中,每個方格中有一個正整數。現要從方格中取數,使任意2 個數所在方格沒有公共邊,且取出的數的總和最大。試設計一個滿足要求的取數算法。編程任務:對于給定的方格棋盤,按…

Nginx 基礎 ( 二)

一、HTTP請求 http請求包括客戶端請求服務端 以及 服務端響應數據回客戶端,如下 請求:包括請求行、請求頭部、請求數據 響應:包括狀態行、消息報頭、響應正文 比如在Linux中curl請求網站獲取請求信息和響應信息 curl -v http://www.kugou.com…

《金融行業應用解決方案白皮書》發布,金融自主創新未來可期!

日前,以“聚勢賦能 行業共創”為主題的金融行業解決方案發布會在線上舉行。麒麟軟件發布《金融行業應用解決方案白皮書》,并發起成立“金融機具生態圈俱樂部”,助力金融行業用戶高質量發展。金融信息系統曾經被國外廠商壟斷金融信息系統作為國…

leetcode53 Maximum Subarray 最大連續子數組

題目要求 Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has the largest sum 6.即:尋找數列中的一個子…

黑馬程序員-WEB前端與移動開發就業班

Web前端 — IT互聯網的“門面”有人的地方就有江湖,有網站的地方就有Web前端,無所不用,互聯網大勢所在。課程循序漸進,技術小白課快速上手課程結構由淺入深,基礎課程講解充分,了解網頁的結構組成、分析頁面…

詳解go語言的array和slice 【二】

上一篇 詳解go語言的array和slice 【一】已經講解過,array和slice的一些基本用法,使用array和slice時需要注意的地方,特別是slice需要注意的地方比較多。上一篇的最后講解到創建新的slice時使用第三個索引來限制slice的容量,在操作新slice時…

詳解Objective-C的meta-class

2019獨角獸企業重金招聘Python工程師標準>>> 比較簡單的一篇英文,重點是講解meta-class。翻譯下,加深理解。 原文標題:What is a meta-class in Objective-C? 原文地址:http://www.cocoawithlove.com/2010/01/what-is…

Nginx 模塊的使用

Nginx模塊的使用,就是在Nginx配置文件中的http、server、location中添加參數,進行多一項或幾項處理一、 實現響應內容替換 1、sub_module二、Nginx的請求限制 1、連接頻率限制 limit_conn_module 2、請求頻率限制 limit_req_module 注: HTTP請求建立在一次…

Question | 網站被黑客掃描撞庫該怎么應對防范?

本文來自網易云社區在安全領域向來是先知道如何攻,其次才是防。針對題主的問題,在介紹如何防范網站被黑客掃描撞庫之前,先簡單介紹一下什么是撞庫。撞庫是黑客通過收集互聯網已泄露的用戶和密碼信息,生成對于的字典表,…

十倍程序員 | 使用 Source Generator 將 JSON 轉換成 C# 類

前言有時候,我們需要將通過 WebAPI 接收 JSON 字符串轉換成 C# 代碼。Visual Studio 提供了一個功能菜單可以輕松實現:執行完成后,它會將生成的代碼放在打開的的代碼窗口中。但是,如果有多個 JSON 字符串需要轉換,這個…

Delphi對話框初始地址InitialDir

我的電腦:SaveDialog1.InitialDir : ::{20D04FE0-3AEA-1069-A2D8-08002B30309D};// My Computer {20D04FE0-3AEA-1069-A2D8-08002B30309D}// Network Neighborhood {208D2C60-3AEA-1069-A2D7-08002B30309D}// Recycled {645FF040-5081-101B-9F08-00AA002F954E} 另外…

[python] 解決pip install download速度過慢問題 更換豆瓣源

""" python建立pip.ini.py 2016年4月30日 03:35:11 codegay """import osini"""[global] index-url https://pypi.doubanio.com/simple/ [install] trusted-hostpypi.doubanio.com """ pippathos.environ["…

Maven組件通過命令上傳本地和私有倉庫

安裝本地包到本地倉庫:mvn install:install-file -DgroupIdcom.xxx -DartifactIdmqtt-server-client -Dversion1.0.1 -Dpackagingjar -DfileE:\__vdt\MVVP\mqtt-server-client-1.0.1.jar -DpomFileE:\__vdt\MVVP\pom.xml安裝本地包到私有倉庫:mvn deploy…

Nginx -靜態資源Web服務

一、靜態資源類型 注:非服務器動態生成的文件 1、瀏覽器端渲染 HTML、css、js 2、圖片 jpeg、gif、png 3、視頻 flv、MPEG 4、文件 TXT、等任意下載文件二、靜態資源服務配置1、配置語法-文件讀取 syntax:sendfile on|off default:sendfi…

微軟Microsoft Azure 機器學習工作室的案例之Image Classification using DenseNet

點擊上方藍字關注我們(本文閱讀時間:10分鐘)Microsoft Azure Machine Learning Studio是微軟強大的機器學習平臺,在設計器中,微軟內置了15個場景案例,但網上似乎沒有對這15個案例深度刨析的分析資料,所以我…

java小基礎之instanceof運算符

instanceof主要用來判斷一個類是否實現了某個接口,或者判斷一個實例對象是否屬于一個類。 1. 判斷一個對象是否屬于一個類 boolean result p instanceof Student; 2. 對象類型強制轉換前的判斷 Person p new Student(); //判斷對象p是否為Student類的實例 if(p in…