ELK日志管理之——elasticsearch部署
生活随笔
收集整理的這篇文章主要介紹了
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 EOF2、安裝elasticsearch
[root@localhost ~]# yum install elasticsearch3、如果服務(wù)器無法上外網(wǎng)進(jìn)行yum安裝,可下載rpm包上傳安裝
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.noarch.rpm4、elasticsearch文件所在目錄
[root@logstash]# whereis elasticsearch elasticsearch: /etc/elasticsearch /usr/share/elasticsearch5、配置文件
[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)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 被盗刷导致产生不良征信 遇到这种情况该咋
- 下一篇: 海天味业股票 调味行业的龙头长期看好