日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ELK日志管理之——elasticsearch部署

發(fā)布時間:2024/10/12 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ELK日志管理之——elasticsearch部署 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、配置官方y(tǒng)um源

[root@localhost ~]# rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch [root@localhost ~]# cat > /etc/yum.repos.d/elasticsearch.repo <<EOF [elasticsearch-1.7] name=Elasticsearch repository for 1.7.x packages baseurl=http://packages.elastic.co/elasticsearch/1.7/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1 EOF

2、安裝elasticsearch

[root@localhost ~]# yum install elasticsearch

3、如果服務(wù)器無法上外網(wǎng)進(jìn)行yum安裝,可下載rpm包上傳安裝

wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.noarch.rpm

4、elasticsearch文件所在目錄

[root@logstash]# whereis elasticsearch elasticsearch: /etc/elasticsearch /usr/share/elasticsearch

5、配置文件

[root@MiWiFi-R1CM ~]# vi /etc/elasticsearch/elasticsearch.yml cluster.name: elasticsearch #集群名稱 node.name: "Franz Kafka" #集群節(jié)點名稱,默認(rèn)自動獲取 path.data: /path/to/data #集群數(shù)據(jù)文件存放路徑 path.logs: /path/to/logs #日志路徑 path.work: /path/to/work #臨時文件路徑 transport.tcp.port: 9300 #集群間通信端口 http.port: 9200 #集群對外端口 discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] #如果集群不是在同一網(wǎng)段中,是沒法自動加進(jìn)集群的,需要在這里配置節(jié)點的ip和端口

6、查看elasticsearch集群狀態(tài)常用命令

1、檢查elasticsearch集群狀態(tài): [root@iZ25w09spb2Z logs]# curl -XGET 127.0.0.1:9200/_cluster/health?pretty [root@localhost ~]# curl -XGET 'http://localhost:9200/_cluster/state?pretty'2、elasticsearch集群詳細(xì)信息: [root@localhost ~]# curl 'http://127.0.0.1:9200/_cluster/stats?pretty'3、查看數(shù)據(jù): [root@localhost ~]# curl 'localhost:9200/_cat/indices?v'4、刪除存儲的uustore-nginx索引: [root@localhost ~]# curl -XDELETE 'localhost:9200/uustore-nginx'5、創(chuàng)建索引(.kibana索引如果刪除需要自己創(chuàng)建): [root@localhost ~]# curl -XPUT 'localhost:9200/.kibana?pretty' -d' {"index.mapper.dynamic": true }'

轉(zhuǎn)載于:https://www.cnblogs.com/dengtr/p/5027355.html

總結(jié)

以上是生活随笔為你收集整理的ELK日志管理之——elasticsearch部署的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。