kibana/elasticsearch使用

本文详细介绍Elasticsearch中各种高级查询方法,包括精准匹配、地理位置过滤、多条件查询等,并提供实例帮助理解。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

--获取某一特定值的信息<REST Verb> /<Index>/<Type>/<ID>?<Rounting>=
GET /yinshang/poi/4628754?routing=B00155MPVY

—快捷查询无法查询中文字
GET /dp_pois/_search?q=city:”藤县”  


—查询中文字符串
GET /dp_pois/_search    {
    "query" : {
        "match" : {
            "city": "上海"
        }
    }
}

—两次运行结果顺序不一样
GET /yinshang/_search   
{
    "query" : {
        "match" : {
            "city": "上海"
        }
    }
}

—term的类型应为kewword
GET /yinshang/_search
{

  "query": {
    "bool": {
      "filter": {
        "term": { "city": "南京" }
      }
    }
  }
}
--terms 匹配多个数据
GET /yinshang/_search
{

  "query": {
    "bool": {
      "filter": {
        "terms": { "city": ["南京"] }
      }
    }
  }
}

—查找上海大于3星的商铺
GET /yinshang/_search   
{
    "query" : {
        "bool": {
            "must": {
                "match" : {
                    "city": "上海"
                }
            },
            "filter": {
                "range" : {
                    "stars" : { "gt" : 3 } 
                }
            }
        }
    }
}

match 完全模糊匹配     match_phrase短语模糊匹配 keyword类型数据只能全匹配


— 创建文档
第一种方法使用 op_type 查询 -字符串参数:
PUT /website/blog/123?op_type=create
{ ... }
第二种方法是在 URL 末端使用 /_create :
PUT /website/blog/123/_create
{ ... }

DELETE /website/blog/123

如果每页展示 5 条结果,可以用下面方式请求得到 13 页的结果:
GET /_search?size=5
GET /_search?size=5&from=5
GET /_search?size=5&from=10

被允许的操作符如下:
gt:大于
gte:大于等于
lt:小于
lte:小于等于


——————————
查询点评poi商铺数量
GET /dp_pois/_search
{
    "query" : {
        "match" : {
            "name": "华联"
        }
    }
}

--查询多个index的方法
GET /amap_pois,amap_pois4,amap_pois5/_search
{
    "query" : {
        "match" : {
            "name": "华联"
        }
    }
}

—分组并计算平均评分
GET /yinshang/_search
{
    "size" : 0,
    "aggs" : { 
        "t_name" : { 
            "terms" : { 
              "field" : "type_name"
            },
            "aggs": { 
            "avg_price": { 
               "avg": {
                  "field": "stars" 
               }
            }
         }
        }
    }
}


—多个分组 类型、城市
GET /yinshang/_search
{
    "size" : 0,
    "aggs" : { 
        "type_name" : { 
            "terms" : { 
              "field" : "type_name"
            },
            "aggs": {
            "city" : { 
              "terms" : { 
                "field" : "city"
              }

            }}
        }
    }
}

—地理范围过滤,无该方法,filtered已不再使用
GET /yinshang/_search
{
  "query": {
    "filtered": {
      "filter": {
        "geo_distance": {
          "distance": "1km", 
          "position": { 
            "lat":  31.25575572,
            "lon": 121.4214928
          }
        }
      }
    }
  }
}
可改为如下形式
GET /yinshang/_search
{
  "query": {
    "bool": {
      "filter": {
        "geo_distance": {
          "distance": "1km", 
          "position": { 
            "lat":  31.25575572,
            "lon": 121.4214928
          }
        }
      }
    }
  }
}



—泉州,stars>3
GET /yinshang/_search
{
    "query" : {
        "bool": {
            "must": {
                "match" : {
                    "city": "泉州"
                }
            },
            "filter": {
                "range" : {
                    "stars" : { "gt" : 3 } 
                }
            }
        }
    }
}

—泉州三星级美食
GET /yinshang/_search
{
    "query" : {
        "bool": {
            "must": {
                "match" : {
                    "city": "泉州"

                }
            },
            "should": [
            { "match": { "type_name": "美食"}}],
            "filter": {
                "range" : {
                    "stars" : { "gt" : 3 } 
                }
            }
        }
    }
}

or

GET /yinshang/_search
{
    "query" : {
        "bool": {
            "must": {
                "match" : {
                    "city": "上海"

                }
            },
            "should": [
            { "match": { "type_name": "美食"}},
            {"range" : {
                    "stars" : { "gt" : 4 } }
                }]
        }
    }
}


GET /yinshang/_search
{
    "query" : {
                "multi_match" : {
                    "query": "3",
                    "fields":   [ "stars" ]
                }   
    }
}

—查询多个条件
GET /yinshang/_search
{

 "query": {

  "bool": {"must": [
            { "match": { "type_name": "美食"}},
            { "match": { "city": "上海"}}
          ]}
  }
}

—多fields查找字段内容
GET /yinshang/_search
{
  "query": {
    "multi_match": {
      "query": “上海 购物",
      "fields":   [ "name", "addr","city" ]
    }
  }
}

—-地理范围内poi
GET /yinshang/_search
{
  "query": {
"bool" : {
    "must" : {
        "match_all" : {}
    },
    "filter" : {
        "geo_distance" : {
            "distance" : "200km",
            "position" : {
                "lat" : 24.999, 
                "lon" : 118.999
            }
        }
    }
}}
}

longitude,latitude 经度,纬度
经度东西半球的坐标范围是 -180 到 180
纬度南北半球的坐标范围是 -90 到 90

—指定地理范围内的poi
GET /yinshang/_search?size=0
{
    "aggs" : {
        "rings" : {
            "geo_distance" : {
                "field" : "position",
                "origin" : "24.999, 118.999",
                "unit" : "km", 
                "ranges" : [
                    { "to" : 100 },
                    { "from" : 100, "to" : 300 },
                    { "from" : 300 }
                ]
            }
        }
    }
}


—上海地区不同类别poi的数量
GET /yinshang/_search?size=0
{
    "query" : {
        "match" : {
            "city" : "上海"
        }
    },
    "aggs" : {
        "type_name" : {
            "terms" : {
              "field" : "type_name"
            }
        }
    }
}

—不同城市家乐福数量
GET /yinshang/_search?size=0
{
    "query" : {
        "match" : {
            "name" : "家乐福"
        }
    },
    "aggs" : {
        "city" : {
            "terms" : {
              "field" : "city"
            }
        }
    }
}


—minimum_should_match 匹配度
GET /dp_pois/_search
{
    "query" : {
        "match" : {
            "name": {"query": "家乐福", "minimum_should_match": "100%"}

        }
    }
}

—match more
GET /yinshang/_search
{
  "query": {
    "bool": {
      "should": [
        { "match": { "city": "北京" }},
        { "match": { "type_name": "丽人"   }},
        { "match": { "area": "海淀区"  }}
      ],
      "minimum_should_match": 3
    }
  }
}

使用bool过滤器来合并多个过滤器以实现and,or和not逻辑。bool查询也做了类似的事,但有一个显著的不同。分值计算(Score Calculation)
bool查询通过将匹配的must和should语句的_score相加,然后除以must和should语句的总数来得到相关度分值_score。
must_not语句不会影响分值;它们唯一的目的是将不需要的文档排除在外
—多字段分值https://www.elastic.co/guide/cn/elasticsearch/guide/current/_boosting_query_clauses.html
—dis_max 即分离 最大化查询(Disjunction Max Query)
{
    "query": {
        "dis_max": {
            "queries": [
                { "match": { "title": "Brown fox" }},
                { "match": { "body":  "Brown fox" }}
            ]
        }
    }
}
—指定点附近地铁的数量
GET /yinshang/_search
{
  "query": {
    "bool": {
      "must": {
        "match": { 
          "addr": "地铁"
        }
       }
      }
    },
    "aggs" : {
        "rings" : {
            "geo_distance" : {
                "field" : "position",
                "origin" : "31.254822, 121.440661",
                "unit" : "km", 
                "ranges" : [
                    { "to" : 1 }
                ]
            }
        }
    },
    "post_filter": { 
    "geo_distance": {
      "distance":   "1km",
      "position": {
        "lat":      31.254822,
        "lon":     121.440661
      }
    }
    },
    "size": 10
}
—查询city包含 南京 并且name包含 美食 的地址      ,查询结果再按city名分组
GET /dp_pois/_search
{
  "size" : 0, 
  "query": { 
    "bool": {
      "must": [
        { "match": { "city":     "南京" }},
        { "match": { "name": "美食"          }}
      ]
    }
  },
  "aggs": {
    "users": {
      "terms": {
        "field":   "city",      
        "order": { "top_score": "desc" } 
      },
      "aggs": {
        "top_score": { "max":      { "script":  "_score"           }}, 
        "blogposts": { "top_hits": { "_source": "addr", "size": 5 }}  
      }
    }
  }
}

—创建index
PUT /customer?pretty
PUT /customer/_doc/1?pretty
{
  "name": "John Doe"
}
GET /customer/_doc/1?pretty
DELETE /customer?pretty
<REST Verb> /<Index>/<Type>/<ID>
POST /customer/_doc/1/_update?pretty
{
  "doc": { "name": "Jane Doe" }
}
POST /customer/_doc/1/_update?pretty
{
  "doc": { "name": "Jane Doe", "age": 20 }
}
POST /customer/_doc/1/_update?pretty
{
  "script" : "ctx._source.age += 5"
}
DELETE /customer/_doc/2?pretty

—范围 排序
GET /_search
{
  "query": { "match_all": {} },
  "sort": { "stars": { "order": "desc" }},
  "from": 10, 
  "size": 10
}
—指定source中字段
GET /_search
{
  "query": { "match_all": {} },
  "_source": ["name", "addr"]
}
—查找词语
GET /_search
{
  "query": { "match_phrase": { "addr": "上海" } }
}


—must同时满足
GET /_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "addr": "上海" } },
        { "match": { "addr": "" } }
      ]
    }
  }
}
—满足一个
GET /_search
{
  "query": {
    "bool": {
      "should": [
        { "match": { "addr": "上海" } },
        { "match": { "addr": "" } }
      ]
    }
  }
}
—分组
GET /_search
{
  "size": 0,
  "aggs": {
    "group_by_city": {
      "terms": {
        "field": "city"
      }
    }
  }
}

—每个城市美食的数量及平均评分
GET /_search
{
  "query": { "bool": {
    "must": {
                "term" : {
                    "type_name": "美食"
                }},

    "filter": {
                "range" : {
                    "stars" : { "gt" : 0 } 
                }
            }
    }
  } ,
  "size": 0,
  "aggs": {
    "group_by_city": {
      "terms": {
        "field": "city"

      },
      "aggs": {
        "average_balance": {
          "avg": {
            "field": "stars"
          }
        }
      }
    }
  }

}
—指定点附近的美食排序
POST /_search
{
   "query" : {
      "term" : { "type_name": "美食" }
   },
   "sort" : [
        {
            "_geo_distance" : {
                "position" : [113.3624924, 22.94712592],
                "order" : "asc",
                "unit" : "km",
                "mode" : "min",
                "distance_type" : "arc"
            }
        }
    ]
}

—南京玄武区不同种类的商铺的数量,以及南京所有区分别的商铺数量
GET /_search
{
  "query": {
    "bool": {
      "filter": {
        "term": { "city": "南京" } 
      }
    }
  },
  "aggs": {
    "colors": {
      "terms": { "field": "area" } 
    },
    "color_red": {
      "filter": {
        "term": { "area": "玄武区" } 
      },
      "aggs": {
        "models": {
          "terms": { "field": "type_name" } 
        }
      }
    }
  },
  "post_filter": { 
    "term": { "area": "玄武区" }
  }
}


1、分城市/行政区级别的poi按类别统计数量
GET /_search?size=0
{
  "aggs" : {
    "city" : {
      "terms" : {
         "field" : "city"

      },
      "aggs" : {
        "type_names" : {
          "terms" : {
            "field" : "type_name"

          }
        }
      }
    }
  }
}
上述语法无法应用到dp_pois上,应terms参数类型应为keyworld
2、综合超市数量、地理分布(例如家乐福,沃尔玛、大润发、欧尚、联华、华联)
GET /yinshang/_search
{   "size": 10, 
    "query" : {
        "match_phrase" : {
            "name" : "家乐福"
        }
    }    ,
    "aggs" : {
        "city" : {
            "terms" : {
              "field" : "city"
            },
            "aggs" : {
              "area" : {
              "terms" : {
                "field" : "area"
              }}
            }
        }
    }
}


GET /_search
{   "size": 10, 
    "query" : {
      "bool": {
        "must": [
         {"match_phrase" : {"name" : "家乐福"}},
        {"match_phrase" : {"type_name": "购物>超市/便利店"}}
        ]

    }},
    "aggs" : {
        "city" : {
            "terms" : {
              "field" : "city"
            },
            "aggs" : {
              "area" : {
              "terms" : {
                "field" : "area"
              }}
            }
        }
    },
    "post_filter": { 
    "term": { "area": "浦东新区" }
  }
}


    1   以点评数据为主
    2   通过关键字“家乐福”以及poi类型,找出全国所有的家乐福超市(约300家),具体结果可能需要手动去把最终的列表整理出来,poi信息的准确性可以和高德poi交叉验证
GET /_search
{   "size": 1000, 
    "query" : {
      "bool": {
        "must": [
          {"match_phrase": {"name": ""}},
         {"match_phrase" : {"name" : "家乐福"}},
        {"match_phrase" : {"type_name": "购物>超市/便利店"}}
        ]

    }},
    "aggs" : {
        "city" : {
            "terms" : {
              "field" : "city"
            },
            "aggs" : {
              "area" : {
              "terms" : {
                "field" : "area"
              }}
            }
        }
    }
}
因elastic无法对符号进行匹配,总数为436家,比实际值大
    3   搜索每一个家乐福周边三公里内的poi列表
GET /_search
{ 
  "query": {
    "bool": {
      "filter": {
        "geo_distance": {
          "distance":      "3km",
          "distance_type": "plane", 
          "position": {
            "lat":  31.3028178,
            "lon": 121.4187999
          }
        }
      }
    }
  }
}


    1   * 在某个特定的地理范围内(多边形),找出所有特定类型(例如餐饮),名称包含关键字(例如麦当劳)的poi,返回满足条件的poi列表,包含poi的基本信息(名称,经纬度坐标,地址,id)
GET /_search
{
    "query": {
        "bool" : {
            "must" : {
                "match_all" : {}
            },
            "filter" : {
                "geo_polygon" : {
                    "position" : {
                          "points": [ 
                              [121.335041,30.755042],
                              [121.335464,30.75513],
                              [121.335888,30.755213],
                              [121.33598,30.755229],
                              [121.336071,30.755213],
                              [121.33613,30.755146],
                              [121.336594,30.754063],
                              [121.335738,30.753756],
                              [121.334816,30.753431],
                              [121.334172,30.753226],
                              [121.333574,30.754501],
                              [121.335041,30.755042]
                            ]

                    }
                }
            }
        }
    }
}


    2   * 指定城市(例如上海),返回所有名称包含关键字(例如万达广场)的商场列表,包含商场的基本信息(名称,地址,经纬度坐标边界, id)
GET /_search
{ 
  "query": {
    "bool": {
      "must": [
        {"match_phrase": {"name": "万达广场"}},
        {"match_phrase": { "_type": "mall" }}
      ], 
      "filter": {
        "term": { "city": "上海" }
      }
    }
  }
}

    3   * 指定某个商场(从接口#2中返回),以该商场的经纬度坐标边界为地理范围,按照接口#1的条件做进一步查询
GET /_search
{
    "query": {
        "bool" : {
            "must" : {
                "match" : {"name" : "麦当劳"}
            },
            "filter" : {
                "geo_polygon" : {
                    "position" : {
                          "points": [ 
                          [121.513433,31.299647],
                          [121.513283,31.299743],
                          [121.513088,31.300281],
                          [121.512564,31.301219],
                          [121.511901,31.302248],
                          [121.511898,31.302326],
                          [121.335738,30.753756],
                          [121.334816,30.753431],
                          [121.334172,30.753226],
                          [121.333574,30.754501],
                          [121.335041,30.755042]
                            ]

                    }
                }
            }
        }
    }
}
    4   * 指定某个品牌关键字(例如麦当劳),返回所有包含该品牌的商场列表,包含商场的基本信息(名称,地址,经纬度坐标边界, id)
    GET /_search
{
  "query": {
    "has_child": {
      "type": "poi",
          "query": {
            "bool" : {
                "must" : {
                    "match" : {"name" : {"query": "麦当劳", "minimum_should_match": "100%"}}
                },
                "filter" : {
                    "geo_polygon" : {
                        "position" : {
                              "points": [ 
                              [121.085376,31.410612], [121.960162,31.436394], [121.995868,30.823947], [121.008472,30.803897], [121.085376,31.410612]
                                ]

                        }
                    }
                }
            }
        }
    }
  }
}

[es@rocky-linux ~]$ systemctl status kibana.service × kibana.service - Kibana Loaded: loaded (/etc/systemd/system/kibana.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2025-03-24 20:10:22 CST; 4s ago Duration: 4.290s Process: 2186 ExecStart=/opt/kibana/bin/kibana (code=exited, status=1/FAILURE) Main PID: 2186 (code=exited, status=1/FAILURE) CPU: 5.183s 3月 24 20:10:22 rocky-linux kibana[2186]: at SafeSubscriber.<anonymous> (/opt/kibana/node_modules/rxjs/dist/cjs/internal/util/lift.js:14:28) 3月 24 20:10:22 rocky-linux kibana[2186]: at /opt/kibana/node_modules/rxjs/dist/cjs/internal/Observable.js:30:30 3月 24 20:10:22 rocky-linux kibana[2186]: at Object.errorContext (/opt/kibana/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9) 3月 24 20:10:22 rocky-linux kibana[2186]: at Observable.subscribe (/opt/kibana/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24) 3月 24 20:10:22 rocky-linux kibana[2186]: at /opt/kibana/node_modules/rxjs/dist/cjs/internal/Observable.js:86:19 3月 24 20:10:22 rocky-linux kibana[2186]: at new Promise (<anonymous>) 3月 24 20:10:22 rocky-linux kibana[2186]: FATAL Error: [config validation of [xpack.security].enabled]: definition for this key is missing 3月 24 20:10:22 rocky-linux systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE 3月 24 20:10:22 rocky-linux systemd[1]: kibana.service: Failed with result 'exit-code'. 3月 24 20:10:22 rocky-linux systemd[1]: kibana.service: Consumed 5.183s CPU time.我遇到kibana启动失败的问题了,配置如下:server.host: "0.0.0.0" server.ssl.enabled: true server.ssl.certificate: /opt/kibana/config/certs/kibana.crt server.ssl.key: /opt/kibana/config/certs/kibana.key elasticsearch.hosts: ["https://10.211.55.3:9201", "https://10.211.55.3:9202", "https://10.211.55.3:9203"] elasticsearch.username: "elastic" elasticsearch.password: "123456" elasticsearch.ssl.certificateAuthorities: ["/opt/kibana/config/certs/ca.crt"] elasticsearch.ssl.verificationMode: full xpack.security.enabled: true xpack.security.encryptionKey: "/opt/kibana/config/encryption.key" xpack.encryptedSavedObjects.encryptionKey: "7ac84bcad5624f3a957e1ce95947d5bd26f8c2c144a7a5b781a39fc13e8d9ae5" server.compression.enabled: true问题出在哪里?
03-25
<think>好的,我现在需要帮用户分析他们在容器中执行 `find / -name kibana` 命令后出现的输出。用户提供的输出显示了很多权限被拒绝的错误,但同时也找到了Kibana的相关路径,主要集中在`/opt/bitnami/kibana`和`/bitnami/kibana`。我需要解释这些结果的含义,并帮助用户理解可能的问题和解决方案。 首先,用户可能是在容器环境中运行Kibana,并且遇到了路径相关的问题,或者他们想确认Kibana是否正确安装。输出中的权限被拒绝错误可能是因为普通用户没有权限访问某些系统目录,比如`/etc/ssl/private`、`/root`等。这可能是因为容器中的用户权限受限,这是正常的安全措施,通常不需要担心这些错误。 接下来,用户找到的Kibana路径主要集中在`/opt/bitnami/kibana`,这提示用户可能使用的是Bitnami提供的Kibana镜像。Bitnami通常会将其应用程序安装在`/opt/bitnami`目录下,所以这些路径是正常的。另外,`/bitnami/kibana`可能是一个数据卷或挂载点,用于持久化数据,比如配置文件或日志。 我需要解释这些路径的作用,比如`/opt/bitnami/kibana/bin/kibana`可能是Kibana的可执行文件,而其他路径可能是插件或模块的目录。同时,用户需要注意权限问题,尤其是当他们在容器中挂载卷时,确保挂载路径不会覆盖关键目录,导致文件丢失或权限错误。 用户之前的问题是关于`/usr/share/kibana/node/bin/node`路径缺失的错误,而这次的`find`命令结果显示Kibana安装在`/opt/bitnami`下,这可能意味着用户使用了不同来源的镜像(比如Bitnami而非官方Elastic镜像),导致路径不一致。需要指出这一点,并建议用户检查他们使用的镜像来源,确保路径配置正确。 另外,用户可能需要确认他们的部署配置(比如Kubernetes的Deployment或Helm Chart)是否正确引用了这些路径,尤其是数据持久化和配置文件的位置。如果用户自定义了挂载卷,需要确保没有覆盖必要的目录,导致Kibana无法找到所需的文件。 最后,应该给出一些建议,比如如何验证Kibana的运行状态,检查日志,或者如何调整挂载配置以避免权限问题。同时提醒用户,如果使用Bitnami镜像,应参考其文档进行配置,因为路径结构可能与官方镜像不同。</think>$$ \textcolor{blue}{\text{深度解析}} $$ $$ \text{容器路径扫描结果} \Rightarrow \exists \text{多层级Kibana部署特征} \in \{ \text{Bitnami定制化安装} \lor \text{数据卷分离存储} \} $$ 一、路径结构诊断矩阵 $$ \begin{array}{|c|c|c|} \hline \text{路径类型} & \text{典型路径} & \text{功能定位} \\ \hline \text{主程序} & /opt/bitnami/kibana/bin/kibana & \text{核心可执行文件} \\ \hline \text{插件系统} & /opt/bitnami/kibana/x-pack/plugins/* & \text{安全/监控/ML等扩展模块} \\ \hline \text{数据卷} & /bitnami/kibana & \text{持久化存储区} \\ \hline \text{启动脚本} & /opt/bitnami/scripts/kibana & \text{容器初始化入口点} \\ \hline \end{array} $$ 二、权限拒绝分析 $$ \text{Permission denied错误} = \left\{ \begin{aligned} &\text{容器用户权限限制} \\ &\text{安全策略约束} \\ &\text{非root用户运行} \end{aligned} \right. $$ ```bash # 验证容器用户身份 whoami && id # 输出示例:I have no name! uid=1001 gid=0(root) ``` 三、Bitnami镜像特性 $$ \boxed{\text{Bitnami目录规范}} $$ ```text /opt/bitnami/ ├── kibana # 主程序 ├── scripts # 生命周期管理脚本 └── common-functions # 环境变量库 ``` 四、关键路径验证方法 ```bash # 检查Kibana进程状态 ps aux | grep kibana # 应显示:/opt/bitnami/kibana/bin/../node/bin/node # 确认数据卷挂载 ls -l /bitnami/kibana/data # 预期可见indices等ES相关目录 ``` 五、典型问题场景 **场景1:自定义挂载覆盖** ```yaml # 错误配置示例(覆盖主程序路径) volumeMounts: - name: my-volume mountPath: /opt/bitnami/kibana # ❌ 导致原始文件被覆盖 ``` **场景2:环境变量冲突** ```bash # 错误示例:覆盖默认路径 export KIBANA_HOME=/usr/share/kibana # 与Bitnami路径不兼容 ``` 六、修复操作指南 1. **路径兼容性调整** ```dockerfile # 正确使用Bitnami镜像的Dockerfile示例 FROM bitnami/kibana:8.11.1 COPY ./my_custom_plugins/ /opt/bitnami/kibana/plugins/ ``` 2. **安全挂载方案** ```yaml # Kubernetes安全挂载配置 volumeMounts: - name: config-volume mountPath: /opt/bitnami/kibana/config # ✅ 仅覆盖配置目录 - name: data-volume mountPath: /bitnami/kibana # ✅ 匹配持久化路径 ``` 七、日志排查技巧 ```bash # 查看容器初始化日志 cat /opt/bitnami/kibana/logs/init.log # 实时监控Kibana运行日志 tail -f /opt/bitnami/kibana/logs/kibana.log | grep -i "ERROR" ``` 八、架构验证公式 $$ \text{容器架构匹配度} = \frac{\text{宿主机架构}}{\text{镜像架构}} \in \{ \text{x86\_64} : \text{amd64}, \text{ARM} : \text{arm64} \} $$ ```bash # 验证二进制兼容性 file /opt/bitnami/kibana/node/bin/node | grep ELF # 期望输出:ELF 64-bit LSB executable, x86-64 ``` **关键结论**:该路径结构表明使用的是Bitnami定制化Kibana镜像,其目录规范与官方Elastic镜像存在显著差异(对比:官方路径为`/usr/share/kibana`)。当出现路径相关错误时,必须严格遵循镜像提供商的目录约定,特别注意: 1. 挂载操作应避开`/opt/bitnami/kibana`主程序路径 2. 自定义配置需注入到`/opt/bitnami/kibana/config` 3. 持久化数据应存放于`/bitnami/kibana` 4. 插件安装需对应`/opt/bitnami/kibana/plugins`目录结构
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值