К основному контенту

Weblogic Diagnostic Framework Run Bash Script (reboot managed server) - (bad practices)

Вообщем переодически сервер дохнет по: The WebLogic Server encountered a critical failure java.lang.OutOfMemoryError: Metaspace Reason: There is a panic condition in the server. The server is configured to exit on panic И хотя это гавно пишет типа  Reason: There is a panic condition in the server. The server is configured to exit on panic чёт ни хуя он ни куда не exit.... Вообщем т.к разбираться с тем чем он жрётся нет ни времени ни желания (оно обязательно появится)... как вариант можно приделать костыль... костыль будет заключаться в ребуте сервера при возникновении этой ошибки. Что значит для этого надо... Желания и понимание что так жить нельзя, и вообще... Делаем новый модуль называем скажем:  Reboot-OOMMetaSpace Идём в в новый модуль делаем Policy: Называем его OOM-Metaspace и говорит что это Server log: Жмём next в Configuration Policy пишем: log.logMessage.contains('java.lang.OutOfMemoryError: Metaspace'...

Elastic serach create index with mapping (not analyzed fields)+Elasticsearch index templates

Просто что бы не забыть!!!
Создания индекса с полями not_analyzed.

Создаем сам индекс.
curl -XPUT 'http://localhost:9200/resource1/'

Настраиваем mapping:'
curl -XPUT 'http://localhost:9200/resource1/_mapping/vm' -d '
{
"vm" : {
"properties" : {
"type" : {"type" : "string"},
"host" : {"type" : "string"},
"message" : {"type" : "string"},
"@timestamp" : {"format" : "dateOptionalTime","type" : "date"},
"@version" : {"type" : "string"},
"path" : {"type" : "string", "index" : "not_analyzed"},
"VCenterName": { "type": "string", "index" : "not_analyzed" },
"ClusterName": { "type": "string", "index" : "not_analyzed" },
"HostName": { "type": "string", "index" : "not_analyzed" },
"HostCPU": { "type": "integer"},
"HostMem": { "type": "float"},
"NameVm": { "type": "string", "index" : "not_analyzed" },
"OSName": { "type": "string", "index" : "not_analyzed" },
"PowerStateVm": { "type": "string", "index" : "not_analyzed" },
"NumberCPUsVM": { "type": "integer"},
"MemoryGBVM": { "type": "float"},
"FileName_System_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_System": { "type": "float"},
"DiskSize_System_Real": { "type": "float"},
"FileName_Data_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Data": { "type": "float"},
"DiskSize_Data_Real": { "type": "float"},
"FileName_Backup1_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup1": { "type": "float"},
"DiskSize_Backup1_Real": { "type": "float"},
"FileName_Backup2_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup2": { "type": "float"},
"DiskSize_Backup2_Real": { "type": "float"},
"FileName_Backup3_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup3": { "type": "float"},
"DiskSize_Backup3_Real": { "type": "float"},
"FileName_Backup4_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup4": { "type": "float"},
"DiskSize_Backup4_Real": { "type": "float"},
"FileName_Backup5_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup5": { "type": "float"},
"DiskSize_Backup5_Real": { "type": "float"},
"FileName_Backup6_Short": { "type": "string", "index" : "not_analyzed" },
"DiskSize_Backup6": { "type": "float"},
"DiskSize_Backup6_Real": { "type": "float"}
}
}
}'

P.S
По умолчанию kibana 4 создаёт индекс с одной репликой которая нам на хер не нужна... поэтому удаляем её:

curl -XPUT 'localhost:9200/my_index/_settings' -d ' {     "index" : {         "number_of_replicas" : 0     } }'

Elasticsearch index templates.

В догонку есть предположим что в определённый индекс (который у нас создаётся каждый день) надо сделать соответствующие поля integer и т.д
Для этого нам необходмо создать index template
Делается это следующим образом, в падлу делать это запросом когда есть пиздатый плагин kopf!=)


Нас интересует template т.е шаблон к каким индексам это будет примененно в моём случае countshard*
А так же mappings.

В итоге у меня получилось следующее:
{
  "template": "countshard*",
  "settings": {},
  "mappings": {
    "countshard": {
      "properties": {
        "path": {
          "type": "string"
        },
        "@timestamp": {
          "format": "dateOptionalTime",
          "type": "date"
        },
        "indexname": {
          "type": "string",
          "index": "not_analyzed"
        },
        "@version": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "time": {
          "format": "dateOptionalTime",
          "type": "date"
        },
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "countshard": {
          "type": "integer"
        },
        "docscount": {
          "type": "integer"
        },
        "tags": {
          "type": "string"
        }
      }
    }
  },
  "aliases": {}
}







Комментарии