ELK日志管理之——elasticsearch部署
生活随笔
收集整理的這篇文章主要介紹了
ELK日志管理之——elasticsearch部署
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、配置官方yum源
[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、如果服務器無法上外網進行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" #集群節點名稱,默認自動獲取 path.data: /path/to/data #集群數據文件存放路徑 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"] #如果集群不是在同一網段中,是沒法自動加進集群的,需要在這里配置節點的ip和端口6、查看elasticsearch集群狀態常用命令
1、檢查elasticsearch集群狀態: [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集群詳細信息: [root@localhost ~]# curl 'http://127.0.0.1:9200/_cluster/stats?pretty'3、查看數據: [root@localhost ~]# curl 'localhost:9200/_cat/indices?v'4、刪除存儲的uustore-nginx索引: [root@localhost ~]# curl -XDELETE 'localhost:9200/uustore-nginx'5、創建索引(.kibana索引如果刪除需要自己創建): [root@localhost ~]# curl -XPUT 'localhost:9200/.kibana?pretty' -d' {"index.mapper.dynamic": true }'轉載于:https://www.cnblogs.com/dengtr/p/5027355.html
總結
以上是生活随笔為你收集整理的ELK日志管理之——elasticsearch部署的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 被盗刷导致产生不良征信 遇到这种情况该咋
- 下一篇: 海天味业股票 调味行业的龙头长期看好