设置 Memgraph Platform 的快照频率?

huangapple go评论57阅读模式
英文:

Set the snapshot frequency for Memgraph Platform?

问题

如何更改Memgraph Platform的快照频率?我正在运行最新的Docker版本的平台(MG 2.7)。

英文:

How can I change the snapshot frequency for Memgraph Platform? I'm running the latest Docker version of the Platform (MG 2.7).

答案1

得分: 1

请按以下步骤操作以完成此任务:

  1. 在 Memgraph 配置文件中进行修改。因为您正在运行 Docker,所以需要执行一些复制/编辑/复制回的操作:

    docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--log-level=TRACE"
    -v mg_lib:/var/lib/memgraph
    -v mg_log:/var/log/memgraph
    -v mg_etc:/etc/memgraph
    memgraph/memgraph-platform

  2. 找到 Memgraph Docker 的 CONTAINER ID

    docker ps

  3. 将配置文件从容器复制到您的本地计算机:

    docker cp :/etc/memgraph/memgraph.conf memgraph.conf

  4. 使用文本编辑器打开配置文件,并修改 --snapshot-interval-sec 选项以设置所需的快照频率(以秒为单位)。保存对配置文件的更改。

  5. 将修改后的配置文件复制回容器:

    docker cp memgraph.conf :/etc/memgraph/memgraph.conf

现在重新启动 Docker,您的新配置将会生效。

英文:

To do this you'll need to modify the Memgraph configuration file. Since you are running a Docker it will involve some copy/edit/copy back operations:

  1. Start Memgraph Platform with including the -v mg_etc:/etc/memgraph flag:

    docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--log-level=TRACE"
    -v mg_lib:/var/lib/memgraph
    -v mg_log:/var/log/memgraph
    -v mg_etc:/etc/memgraph
    memgraph/memgraph-platform

  2. Find the CONTAINER ID of the Memgraph Docker:

    docker ps

  3. Copy the configuration file from the container to your local machine:

    docker cp <CONTAINER ID>:/etc/memgraph/memgraph.conf memgraph.conf

  4. Open the configuration file with a text editor, and modify the --snapshot-interval-sec option to set the desired snapshot frequency in seconds. Save the changes to the configuration file.

  5. Copy the modified configuration file back to the container:

    docker cp memgraph.conf <CONTAINER ID>:/etc/memgraph/memgraph.conf

Now restart the docker and your new configuration will be loaded.

huangapple
  • 本文由 发表于 2023年5月10日 22:12:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76219465.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定