Skip to main content

MongoDB 备份

我们提供了多种实用程序,可以通过 MongoDB 的嵌入式版本从 Alteryx Server 部署中备份和还原数据。使用此备份功能从系统故障或数据损坏或丢失中恢复。您还可以使用恢复选项回滚到过去的数据。

AlteryxService 可执行文件 AlteryxService.exe 提供了多种命令行实用程序,可以用来备份和还原数据。因为数据库备份过程需要关闭 Server(禁用计划和 Server 功能几分钟),所以请在非高峰时间执行备份。

创建 MongoDB 备份

  1. 停止 AlteryxService。按顺序关闭多台计算机 - Server UI 节点、工作程序和控制器。

  2. 通过命令行找到 Alteryx Server 安装文件夹(例如, D:\Program Files\Alteryx\bin )。

  3. 运行此命令将数据库备份保存在指定的文件夹(必须为空文件夹):

    alteryxservice emongodump=path_to_backup_location

    \Program Files\Alteryx\bin\AlteryxService.exe emongodump=c:\temp\dumpOutput

  4. 重新启动 AlteryxService。以相反顺序重新启动多台计算机 - 依次重新启动控制器、工作程序和 Server UI 节点。

从 MongoDB 备份还原

  1. 停止 AlteryxService。

  2. 通过命令行找到 Alteryx Server 安装文件夹(例如, D:\Program Files\Alteryx\bin )。

  3. 运行以下命令将 MongoDB 备份还原到指定文件夹(必须为空文件夹): alteryxservice emongorestore=path_to_backup_location,path_to_Mongo_folder,10

    \Program Files\Alteryx\bin\AlteryxService.exe emongorestore=c:\temp\dumpOutput,c:\temp\restoreInput,10

    The final parameter, ,10, ensures lower memory usage by MongoDB during the restore. This reduces the chance of out-of-memory errors but might increase the time to restore. Leaving off the ,10 might lead to faster restores. In either case, review mongoRestore.log as described below to ensure the restore was successful.

    注意

    如果将 MongoDB 还原到具有不同名称的新文件夹,则必须更新 Alteryx 系统设置 > Controller > Persistence 中的 Data Folder ,以允许 AlteryxService 从刚恢复的 MongoDB 文件夹启动。如需详细了解控制器配置,请转至 控制器 帮助页面。

  4. 重新启动 AlteryxService。

    小心

    This is a necessary step as a restore failure will not be reported in the previous step and can lead to missing data on your Server. To do so, review the mongoRestore.log file in the MongoDB folder where the data was restored. Open mongoRestore.log and follow these steps:

    • Confirm that it reports #### document(s) restored successfully, 0 document(s) failed to restore on the last line.

    • Search for error, critical, fatal, and failed. If you are looking for failed, make sure the result is different from the sentence in the previous point, which contains 0 document(s) failed.

    If the recovery has failed, or if you find any results when searching the key words listed above, please contact Support with all the information you have gathered.

    Do not proceed if the MongoDB restore failed.

  5. 重新启动 AlteryxService。

使用 MongoDB 备份

  1. 打开 System Settings(系统设置)

  2. 转至 Controller > Persistence

  3. 在Data Folder(数据文件夹)字段中,浏览至备份文件夹。

  4. 选择 Next ,完成“系统设置”窗口后续步骤,然后重新启动服务。当服务启动时,它将从还原的文件夹中运行。