Elasticsearch实战 第十一章 管理集群

2021-12-13  本文已影响0人  kaiker

1、改善默认配置

索引模板

curl -XPUT localhost:9200/_template/logging_index -d '{
    "template":"logstash-*",
    "settings":{
        "number_of_shards":2,
        "number_of_replicas":1
    }
    }'

默认映射

curl -XPUT 'http://localhost:9200/myindex' -d '{
    "mappings":{
        "my_type":{
            "dynamic_teplates":[{
                "UUID": {
                    "match": "*_guid",
                    "match_mapping_type":"string",
                    "mapping":{
                        "type":"string",
                        "index":"not_analyzed"
                    }
                }
            }]
        }
    }
}'

2、分配感知

3、监控瓶颈

健康状态

慢日志、热线程和线程池

内存

操作系统缓存

4、备份数据

将数据备份到共享的文件系统

curl -XPUT 'localhost:9200/_snapshot/my_repository' -d '
    {
        "type":"fs",
        "settings":{
            "location":"",
            "max_snapshot_bytes_per_sec":""
        }
    }
'

curl -XPUT 'localhost:9200/_snapshot/my_repository/first_snapshot'

从备份中恢复

使用资料库插件

上一篇 下一篇

猜你喜欢

热点阅读