elk部署(實(shí)操二)

續(xù)上篇

安裝logstash?

下載地址:wgethttps://artifacts.elastic.co/downloads/logstash/logstash-6.1.0.rpm?

#安裝rpm -ivh logstash-6.1.0.rpm?

啟動服務(wù)

systemctl? restart logstash.service?

systemctl? status logstash.service?

systemctl? enable logstash.service?

測試基本輸入輸出

[root@elk2 ~]# /usr/share/logstash/bin/logstash -e? 'input { stdin{} } output { stdout{} }'

WARNING: Could not find logstash.yml whichistypically locatedin$LS_HOME/config or /etc/logstash. You can specify the pathusing--path.settings. Continuingusingthe defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Usingdefaultconfig which logs errors to the consoleThe stdin pluginisnow waitingforinput:

Abc? ? ? ? #輸入這個

2020-06-17T05:38:32.783Z elk2 abc? ? #輸出這個

使用rubydebug詳細(xì)輸出

[root@elk2 ~]# /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { stdout{ codec => rubydebug} }'?

WARNING: Could not find logstash.yml whichistypically locatedin$LS_HOME/config or /etc/logstash. You can specify the pathusing--path.settings. Continuingusingthe defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Usingdefaultconfig which logs errors to the consoleThe stdin pluginisnow waitingforinput:

Hello? ? ?#輸入

{"host"=>"elk2",? ? ? ? ?#輸出?

"@timestamp"=>2020-06-17T05:40:38.039Z,"

message"=>"hello","@version"=>"1"}

???[root@elk2 ~]# /usr/share/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["192.168.0.208:9200"]} }'?

WARNING: Could not find logstash.yml whichistypically locatedin$LS_HOME/config or /etc/logstash. You can specify the pathusing--path.settings. Continuingusingthe defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Usingdefaultconfig which logs errors to the consoleThe stdin pluginisnow waitingforinput:

123456

wangshibohuanqiu

hahaha

logstash的配置

配置地址

/etc/logstash/conf.d下,以*.conf結(jié)尾

vim /etc/logstash/conf.d/elk1.conf?

input { stdin { } }

output?

? {elasticsearch {hosts=>["192.168.0.208:9200"]}

? stdout {codec=>rubydebug }

}

執(zhí)行

[root@elk2 ~]# /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/elk1.conf

?WARNING: Could not find logstash.yml whichistypically locatedin$LS_HOME/config or /etc/logstash. You can specify the pathusing--path.settings. Continuingusingthe defaultsCould not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Usingdefaultconfig which logs errors to the consoleThe stdin pluginisnow waitingforinput:

Beijing????????#輸入

{"@version"=>"1",????????#輸出"

host"=>"elk2","

message"=>"beijing",

"@timestamp"=>2020-06-17T05:48:29.275Z

}?

更多用法后續(xù)列出

安裝kibana

下載地址:wgethttps://artifacts.elastic.co/downloads/kibana/kibana-6.1.0-x86_64.rpm?

#安裝rpm -ivh kibana-6.1.0-x86_64.rpm

修改配置文件

vim/etc/kibana/kibana.yml?

2server.port:5601? ? ? #端口

7server.host:"0.0.0.0"????#服務(wù)監(jiān)聽地址

21elasticsearch.url:"http://192.168.0.213:9200"????????#聲明地址氢橙,從哪里查尸疆,集群里面隨便選一個30kibana.index:".kibana"????????#kibana自己創(chuàng)建的索引

33kibana.defaultAppId:"discover"????#打開kibana頁面時有巧,默認(rèn)打開discover

62elasticsearch.pingTimeout:1500????#ping檢測超時時間

66elasticsearch.requestTimeout:30000????#請求超時時間

80elasticsearch.startupTimeout:5000????#啟動超時時間

?114i18n.locale:"zh-CN"????#啟用中文

啟動服務(wù)

systemctl? restart? kibana.service

systemctl? status? kibana.service

systemctl? enable? kibana.service

查看端口

netstat-utnlp | grep5601

訪問服務(wù)

http://192.168.0.208:5601

如果起不來

curl -XDELETE http://localhost:9200/.kibana*

到這里我們的elk就搭建成功了招盲,下一篇教大家安裝es 的插件愿题,方便后續(xù)更好的維護(hù)免胃。

? 沒有理論粉楚,只有實(shí)戰(zhàn)

更多干貨? ?公總耗【大隆愛分享】

那就趕緊來關(guān)我們?

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
禁止轉(zhuǎn)載辣恋,如需轉(zhuǎn)載請通過簡信或評論聯(lián)系作者。
  • 序言:七十年代末解幼,一起剝皮案震驚了整個濱河市抑党,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌撵摆,老刑警劉巖底靠,帶你破解...
    沈念sama閱讀 212,542評論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異特铝,居然都是意外死亡暑中,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,596評論 3 385
  • 文/潘曉璐 我一進(jìn)店門鲫剿,熙熙樓的掌柜王于貴愁眉苦臉地迎上來鳄逾,“玉大人,你說我怎么就攤上這事灵莲〉癜迹” “怎么了?”我有些...
    開封第一講書人閱讀 158,021評論 0 348
  • 文/不壞的土叔 我叫張陵政冻,是天一觀的道長枚抵。 經(jīng)常有香客問我,道長明场,這世上最難降的妖魔是什么汽摹? 我笑而不...
    開封第一講書人閱讀 56,682評論 1 284
  • 正文 為了忘掉前任,我火速辦了婚禮苦锨,結(jié)果婚禮上逼泣,老公的妹妹穿的比我還像新娘趴泌。我一直安慰自己,他們只是感情好拉庶,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,792評論 6 386
  • 文/花漫 我一把揭開白布嗜憔。 她就那樣靜靜地躺著,像睡著了一般砍的。 火紅的嫁衣襯著肌膚如雪痹筛。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,985評論 1 291
  • 那天廓鞠,我揣著相機(jī)與錄音,去河邊找鬼谣旁。 笑死床佳,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的榄审。 我是一名探鬼主播砌们,決...
    沈念sama閱讀 39,107評論 3 410
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼搁进!你這毒婦竟也來了浪感?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,845評論 0 268
  • 序言:老撾萬榮一對情侶失蹤饼问,失蹤者是張志新(化名)和其女友劉穎影兽,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體莱革,經(jīng)...
    沈念sama閱讀 44,299評論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡峻堰,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,612評論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了盅视。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片捐名。...
    茶點(diǎn)故事閱讀 38,747評論 1 341
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖闹击,靈堂內(nèi)的尸體忽然破棺而出镶蹋,到底是詐尸還是另有隱情,我是刑警寧澤赏半,帶...
    沈念sama閱讀 34,441評論 4 333
  • 正文 年R本政府宣布贺归,位于F島的核電站,受9級特大地震影響除破,放射性物質(zhì)發(fā)生泄漏牧氮。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,072評論 3 317
  • 文/蒙蒙 一瑰枫、第九天 我趴在偏房一處隱蔽的房頂上張望踱葛。 院中可真熱鬧丹莲,春花似錦、人聲如沸尸诽。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,828評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽性含。三九已至洲赵,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間商蕴,已是汗流浹背叠萍。 一陣腳步聲響...
    開封第一講書人閱讀 32,069評論 1 267
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留绪商,地道東北人苛谷。 一個月前我還...
    沈念sama閱讀 46,545評論 2 362
  • 正文 我出身青樓,卻偏偏與公主長得像格郁,于是被迫代替她去往敵國和親腹殿。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,658評論 2 350