cloud-bigdata-book icon indicating copy to clipboard operation
cloud-bigdata-book copied to clipboard

elk 实践

Open heidsoft opened this issue 6 years ago • 16 comments

查看索引

➜  elasticsearch-7.8.1 curl -XGET 'localhost:9200/_cat/indices'
yellow open metricbeat-7.8.1-2020.08.11-000001 Rk__8HYyQWeM0d9xfl6wZA 1 1 49164   0 13.1mb 13.1mb
green  open .apm-custom-link                   zyZJQAw0Q0Glxa6OtaRS8g 1 0     0   0   208b   208b
green  open .kibana_task_manager_1             kRW3wcm_RXmwD_hGOSV9jw 1 0     5  10 10.8kb 10.8kb
green  open .apm-agent-configuration           4_4_VFGAQoGTwx0fig8xHg 1 0     0   0   208b   208b
green  open kibana_sample_data_logs            EGSClSsPSIGHlnDkjxqraQ 1 0 14074   0   11mb   11mb
green  open .async-search                      6A8gMDJASlqMYsB51s451w 1 0     3   0  6.8mb  6.8mb
green  open .kibana_1                          fdk86yC0RtO48RpI4hH6gw 1 0  3176 164  2.1mb  2.1mb
green  open .kibana-event-log-7.8.1-000001     ab62kehLQlOFjRJPBPrUQg 1 0     2   0 10.4kb 10.4kb
yellow open filebeat-7.8.1-2020.08.11-000001   LRoh9ocGSVmc6PdHnPNd6g 1 1 73091   0 12.9mb 12.9mb

➜ elasticsearch-7.8.1

分片状态查看

➜  elasticsearch-7.8.1 curl -XGET 'localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned'
.apm-custom-link                   0 p STARTED
.apm-agent-configuration           0 p STARTED
.async-search                      0 p STARTED
metricbeat-7.8.1-2020.08.11-000001 0 p STARTED
metricbeat-7.8.1-2020.08.11-000001 0 r UNASSIGNED
kibana_sample_data_logs            0 p STARTED
filebeat-7.8.1-2020.08.11-000001   0 p STARTED
filebeat-7.8.1-2020.08.11-000001   0 r UNASSIGNED
.kibana_1                          0 p STARTED
.kibana_task_manager_1             0 p STARTED
ilm-history-2-000001               0 p STARTED
.kibana-event-log-7.8.1-000001     0 p STARTED
➜  elasticsearch-7.8.1

ELK实现日志监控告警

https://www.ctolib.com/docs/sfile/ELKstack-guide-cn/elasticsearch/other/elastalert.html https://anjia0532.github.io/2017/02/14/elasticsearch-elastalert/ https://media.readthedocs.org/pdf/elastalert/latest/elastalert.pdf https://anjia0532.github.io/2017/02/14/elasticsearch-elastalert/ https://blog.51cto.com/seekerwolf/2121070 https://www.ctolib.com/docs/sfile/ELKstack-guide-cn/elasticsearch/other/elastalert.html https://www.elastic.co/guide/en/beats/filebeat/5.0/configuration-filebeat-options.html

heidsoft avatar Mar 15 '19 02:03 heidsoft

logstash-plugin

➜ logstash-6.6.0 bin/logstash-plugin install logstash-input-beats Validating logstash-input-beats Installing logstash-input-beats Installation successful ➜ logstash-6.6.0 bin/logstash-plugin install logstash-codec-rubydebug Validating logstash-codec-rubydebug Installing logstash-codec-rubydebug Installation successful

heidsoft avatar Apr 03 '19 06:04 heidsoft

性能优化

https://www.datadoghq.com/blog/elasticsearch-performance-scaling-problems/

heidsoft avatar Apr 25 '19 03:04 heidsoft

ElasticSearch 状态查询Cat接口

https://yq.aliyun.com/articles/676135

heidsoft avatar May 17 '19 08:05 heidsoft

es深度分页机制

heidsoft avatar May 26 '19 14:05 heidsoft

api快速入门

heidsoft avatar May 26 '19 14:05 heidsoft

集群监控

https://www.elastic.co/guide/en/elasticsearch/reference/6.3/cluster-stats.html https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html

heidsoft avatar May 27 '19 06:05 heidsoft

https://www.acloudtree.com/hacking-java-bytecode-for-programmers-part1-the-birds-and-the-bees-of-hex-editing/

heidsoft avatar May 27 '19 06:05 heidsoft

es api 测试

curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'
{
    "settings" : {
        "index" : {
            "number_of_shards" : 1, 
            "number_of_replicas" : 0
        }
    },
    "mappings": {
    	"_doc":{
	    	"properties": { 
			      "title":    { "type": "text"  }, 
			      "name":     { "type": "text"  }, 
			      "age":      { "type": "integer" },
			      "created":  {
			          "type":   "date", 
			          "format": "strict_date_optional_time||epoch_millis"
			        }
		    }
    	}   
   }
}
'

curl -X PUT "localhost:9200/test/_mapping/_doc" -H 'Content-Type: application/json' -d'
{
  "properties": { 
        "title":    { "type": "text"  }, 
        "name":     { "type": "text"  }, 
        "age":      { "type": "integer" },  
        "created":  {
          "type":   "date", 
          "format": "strict_date_optional_time||epoch_millis"
        }
      }
}
'

heidsoft avatar Jun 17 '19 09:06 heidsoft

副本机制模型

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#docs-replication

heidsoft avatar Dec 10 '20 11:12 heidsoft

Elasticsearch 节点选举、分片及 Recovery

https://v2ex.com/t/652785

ElasticSearch分布式原理探究 —— 节点和分片

https://www.mantian.site/blog/2019/09/09/ElasticSearch%E5%88%86%E5%B8%83%E5%BC%8F%E5%8E%9F%E7%90%86%E6%8E%A2%E7%A9%B6-%E2%80%94%E2%80%94-%E8%8A%82%E7%82%B9%E5%92%8C%E5%88%86%E7%89%87/

heidsoft avatar Dec 10 '20 11:12 heidsoft