發表文章

CentOS下Metricbeat無法連接上Elasticsearch 錯誤 x509: certificate signed by unknown authority

圖片
搭建 Metricbeat 時 status 出現以下之錯誤: ERROR [publisher_pipeline_output] pipeline/output.go:154 Failed to connect to backoff(elasticsearch(https://localhost:9200)): Get "https://localhost:9200": x509: certificate signed by unknown authority 由錯誤報告中,  certificate signed by unknown authority  可以得知連線並沒有 SSL 憑證導致無法正確連接到 Elasticsearch 。 解決方法有兩種: 1.  將 SSL 憑證位置加入到Metricbeat配置中      (a).  進入metricbeat 配置中(配置位置可能會有所不同) vim /etc/metricbeat/metricbeat.yml     (b).  配置如下 2.  直接無視 SSL 憑證警告     (a).  進入metricbeat 配置中(配置位置可能會有所不同) vim /etc/metricbeat/metricbeat.yml     (b).  配置如下 結果: Connection to backoff(elasticsearch(https://localhost:9200)) established     

CentOS下查詢Elasticsearch版本

圖片
 在 Elasticsearch 為啟動狀態時,於Terminal執行以下指令 (指令中account 與 password 請依照配置調整) curl -k -u account:password -XGET "https://localhost:9200" 結果: (version 下的 number 屬性即為 Elasticsearch 的版本)