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

是否有Memgraph Helm Chart?寻求K8s、Podman等部署入门指引

Memgraph 跨环境部署入门指引

Kubernetes 部署方案

手动部署核心资源

如果暂时找不到现成的Helm Chart,可先通过手动编写K8s资源文件完成部署:

  1. Deployment 配置(memgraph-deployment.yaml)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: memgraph
spec:
  replicas: 1
  selector:
    matchLabels:
      app: memgraph
  template:
    metadata:
      labels:
        app: memgraph
    spec:
      containers:
      - name: memgraph
        image: memgraph/memgraph:latest
        ports:
        - containerPort: 7687 # Bolt协议端口
        - containerPort: 7444 # Memgraph Studio端口
        volumeMounts:
        - name: memgraph-data
          mountPath: /var/lib/memgraph
      volumes:
      - name: memgraph-data
        persistentVolumeClaim:
          claimName: memgraph-pvc
  1. Service 配置(memgraph-service.yaml)
apiVersion: v1
kind: Service
metadata:
  name: memgraph-service
spec:
  type: NodePort
  selector:
    app: memgraph
  ports:
  - port: 7687
    targetPort: 7687
    nodePort: 30007
  - port: 7444
    targetPort: 7444
    nodePort: 30008
  1. 持久化存储 PVC(memgraph-pvc.yaml)
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: memgraph-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

执行部署命令:

kubectl apply -f memgraph-deployment.yaml
kubectl apply -f memgraph-service.yaml
kubectl apply -f memgraph-pvc.yaml

自定义Helm Chart(替代现成Chart)

若需要复用部署模板,可自行构建Helm Chart:

  • 初始化Chart骨架:helm create memgraph-chart
  • 编辑values.yaml,修改镜像为memgraph/memgraph:latest,配置端口、存储请求等参数
  • 调整templates/deployment.yaml和templates/service.yaml,适配Memgraph的端口映射与存储挂载需求
  • 安装自定义Chart:helm install memgraph ./memgraph-chart

Podman 部署方案

单容器快速部署

直接通过命令启动Memgraph容器,包含端口映射与数据持久化:

podman run -d -p 7687:7687 -p 7444:7444 -v memgraph-data:/var/lib/memgraph memgraph/memgraph:latest

容器状态验证

  • 查看运行状态:podman ps,确认容器状态为Up
  • 查看启动日志:podman logs <容器ID/名称>,检查是否出现Memgraph is ready提示

运行验证与问题排查

功能验证

  • K8s环境:通过kubectl logs <Pod名称>查看启动日志;使用Bolt客户端连接bolt://<集群节点IP>:30007测试数据读写
  • Podman环境:本地使用Bolt客户端连接bolt://localhost:7687,或访问http://localhost:7444打开Memgraph Studio

常见问题排查

  • 端口无法访问:K8s环境检查NodePort是否在集群节点开放,Podman环境确认端口未被占用
  • 数据丢失:验证PVC或Podman卷是否正确挂载,检查容器内/var/lib/memgraph目录权限
  • 资源瓶颈:K8s环境用kubectl top pod <Pod名称>查看资源占用;Podman环境用podman stats监控CPU/内存使用

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.15 13:26:18