You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apple Silicon M1上集成New Relic与Couchbase遇unsupported报错求助

解决Couchbase + New Relic 在Apple Silicon M1 Docker环境下的集成问题

当前报错的核心原因

  • 官方couchbase-open-source-integration暂未适配ARM64架构(M1属于ARM64),直接使用会触发不支持提示。
  • 若Docker中运行的Couchbase是x86镜像,通过Rosetta模拟运行时,可能间接导致New Relic集成的兼容性问题。

可行的集成方案

方案1:基于New Relic Infrastructure Agent自定义监控

  1. 给Docker中的Couchbase容器暴露监控端口:默认开启8091的REST API端口,或手动启用9102的Prometheus指标端口。
  2. 在M1设备部署ARM64版本的New Relic Infrastructure Agent,通过配置抓取Couchbase指标:
    • 编辑nri-prometheus配置文件,添加Couchbase的Prometheus端点:
      endpoints:
        - url: "http://<couchbase容器IP>:9102/metrics"
          headers:
            Authorization: "Basic <base64编码的用户名:密码>"
      
    • 重启Infrastructure Agent后,指标会自动同步到New Relic平台。

方案2:通过Couchbase REST API自定义脚本上报指标

  1. 编写Shell/Python脚本,定期调用Couchbase的REST API(如http://localhost:8091/pools/default),采集集群、节点、桶的性能数据。
  2. 利用New Relic Metric API或nri-flex工具上报采集到的指标:
    • 示例Python片段(上报节点CPU使用率):
      import requests
      import os
      
      # 获取Couchbase指标
      cb_auth = ("admin", "your-password")
      cb_response = requests.get("http://couchbase:8091/pools/default", auth=cb_auth)
      cpu_usage = cb_response.json()["nodes"][0]["systemStats"]["cpu_utilization_rate"]
      
      # 上报到New Relic
      nr_api_key = os.getenv("NEW_RELIC_API_KEY")
      headers = {"Api-Key": nr_api_key, "Content-Type": "application/json"}
      payload = [
        {
          "metrics": [
            {"name": "couchbase.node.cpu.utilization", "value": cpu_usage, "type": "gauge"}
          ],
          "eventType": "CouchbaseNodeMetric"
        }
      ]
      requests.post("https://metric-api.newrelic.com/metric/v1", json=payload, headers=headers)
      
    • 将脚本配置为定时任务(如Docker容器内的cron),定期执行上报。

方案3:Prometheus + New Relic Remote Write联动

  1. 在M1 Docker环境部署ARM64版本的Prometheus,配置抓取Couchbase的Prometheus指标。
  2. 配置Prometheus的remote_write规则,将数据同步到New Relic:
    • 在Prometheus配置文件中添加:
      remote_write:
        - url: "https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<你的Prometheus实例名>"
          headers:
            Authorization: "Bearer <New Relic许可证密钥>"
      
    • 启动Prometheus后,指标会自动流转到New Relic平台。

M1架构适配注意事项

  • 确保所有使用的镜像(Couchbase、New Relic Agent、Prometheus)均为ARM64版本,避免使用x86镜像依赖Rosetta模拟,否则可能引发兼容性故障。
  • 若官方Couchbase Prometheus exporter不支持ARM64,可选用社区维护的ARM兼容版本。

内容的提问来源于stack exchange,提问作者Gorkem

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 03:45:30