emqx5.6.1 数据、配置备份与迁移

EMQX 支持导入和导出的数据包括:

  • EMQX 配置重写的内容:
    • 认证与授权配置
    • 规则、连接器与 Sink/Source
    • 监听器、网关配置
    • 其他 EMQX 配置
  • 内置数据库 (Mnesia) 的数据
    • Dashboard 用户和 REST API 密钥
    • 客户端认证凭证(内置数据库密码认证、增强认证)
    • PSK 认证数据
    • 授权规则
    • 黑名单数据
  • 存储在 EMQX 数据目录(node.data_dir)中的 SSL/TLS 证书
  • 存储在 EMQX 数据目录中的授权 acl.conf 文件

一、进入容器

docker exec -it stand-alone-emqx bash

二、进入bin目录、执行导出命令(找到可执行文件)

emqx@wiat-22:/opt/emqx$  cd bin/
emqx@wiat-22:/opt/emqx/bin$ ls
emqx  emqx-5.6.1  emqx.cmd  emqx_cluster_rescue  emqx_ctl  emqx_ctl-5.6.1  emqx_ctl.cmd  install_upgrade.escript  install_upgrade.escript-5.6.1  no_dot_erlang.boot  node_dump  nodetool  nodetool-5.6.1
#导出命令
emqx@wiat-22:/opt/emqx/bin$ ./emqx ctl data export
Exporting data to "data/backup/emqx-export-2024-06-22-16-09-06.703.tar.gz"...
Exporting cluster configuration...
Exporting additional files from EMQX data_dir: "data"...
Exporting built-in database...
Exporting emqx_authn_mnesia database table...
Exporting emqx_authn_scram_mnesia database table...
Exporting emqx_acl database table...
Exporting emqx_retainer_message database table...
Exporting emqx_admin database table...
Exporting emqx_psk database table...
Exporting emqx_app database table...
Exporting emqx_banned_rules database table...
Exporting emqx_banned database table...
Data has been successfully exported to data/backup/emqx-export-2024-06-22-16-09-06.703.tar.gz.

三、进入backup目录把导出的数据迁移到另一台emqx(在另一台emqx  data目录下新建tmp文件夹,把数据放进去)

四、进入21的emqx容器里

# 进入容器
root@wiat-21:/docker/software/stand-alone-emqx# docker exec -it stand-alone-emqx bash
# 进入bin目录
emqx@wiat-21:/opt/emqx$ cd bin/
# 导入命令
emqx@wiat-21:/opt/emqx/bin$ ./emqx ctl data import /opt/emqx/data/tmp/emqx-export-2024-06-22-16-09-06.703.tar.gz
Importing data from "/opt/emqx/data/tmp/emqx-export-2024-06-22-16-09-06.703.tar.gz"...
Importing cluster configuration...
Config key path "authorization.sources.file" was present before import and has been overwritten.
Importing built-in database...
Importing emqx_banned database table...
Importing emqx_banned_rules database table...
Importing emqx_app database table...
Importing emqx_psk database table...
Importing emqx_admin database table...
Importing emqx_retainer_message database table...
Importing emqx_acl database table...
Importing emqx_authn_scram_mnesia database table...
Importing emqx_authn_mnesia database table...
Data has been imported successfully.

五:结果

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值