|
Post by account_disabled on Dec 3, 2023 4:00:23 GMT
性能在线事务处理 (OLTP):您可以通过消除报告查询的负担来提高 OLTP 系统的事务处理时间和查询时间。事务处理时间是指事务完成之前给定查询运行的时间长度。 并行系统测试:升级新系统时,需要确保系统能够与现有数据良好配合;因此需要在部署之前使用生产数据库的副本进行测试。 复制的工作原理 通常,人们认为在涉足主架构和辅助架构时。然而,PostgreSQL 实现可以遵循以下三种方法中的任何一种: 流式复制:将数据从主节点复制到辅助节点,然后将数据复制到 Amazon S3 或 Azure Blob 进行备份存储。 卷级复制在存储级别从主节点复制到辅助节点,然后备份到 blob/S3 存储。 增量备份:从主节点复制数据,同时从 存储构建新的 电话号码清单 辅助节点,从而允许直接从主节点进行流式传输。 方法一:流式传输 PostgreSQL流式复制,也称为WAL复制,在所有服务器上安装PostgreSQL后可以无缝设置。这种复制方法依赖于将 WAL 文件从主数据库移动到目标数据库。 您可以使用主从配置来实现 PostgreSQL 流式复制。主服务器是管理主数据库及其所有操作的主要实例。辅助服务器充当附加实例,并自行执行对主数据库所做的所有更改,并在此过程中生成相同的副本。主服务器是读/写服务器,而辅助服务器是只读服务器。 该方法需要配置主节点和备节点。以下部分介绍了轻松设置它们所需的步骤。 主节点配置 您可以通过执行以下步骤配置主节点以进行流式复制: 步骤一:初始化数据库 要初始化数据库,您可以使用initidb实用程序命令。接下来,您可以使用以下命令创建具有复制权限的新用户备用服务器与主服务器不同步时,此参数对于有用的功能是必需的。 wal_level:可以使用该参数启用 流式复制,可能的值该参数可用于指定日志文件中可保存的WAL文件的大小。 当设置为 您可以使用此参数与辅助设备进行读取连接。指定与备用服务器建立的最大并发连接数。 第 3 步:创建一个新条目 更改文件中的参数后文件中的新复制条目可以允许服务器相互建立连接以进行复制。 该文件通常位于 PostgreSQL 数据目录中。
|
|