PostgreSQL과 호환되는 데이터베이스 백업 기술을 사용하여 AlloyDB Omni 데이터를 보호할 수 있습니다. 권장사항에 따라 Barman을 사용하는 것이 좋습니다. 관리하는 Barman 서버에서 연결을 허용하도록 AlloyDB Omni를 구성할 수 있습니다. 이렇게 하면 Barman 서버가 AlloyDB Omni 서버에 저장된 데이터의 지속적 백업을 실행할 수 있습니다.
Barman과 AlloyDB Omni 서버가 함께 작동하도록 구성한 후에는 Barman 명령어를 실행하여 다음과 같은 다양한 데이터 보호 및 재해 복구 작업을 수행할 수 있습니다.
별도의 서버에 Barman이 설치되어 있습니다. Barman을 설치한 서버는 TCP를 통해 AlloyDB Omni 서버와 통신할 수 있어야 합니다.
Barman과 호환되도록 AlloyDB Omni 구성
AlloyDB Omni 서버가 Barman과 함께 작동하도록 준비하려면 AlloyDB Omni를 설치한 서버에서 다음 명령어를 실행하세요.
적절한 권한으로 barman 데이터베이스 사용자를 만듭니다.
dockerexecpg-servicepsql-hlocalhost-Upostgres-c"CREATE USER barman;GRANT EXECUTE ON FUNCTION pg_backup_start(text, boolean) to barman;GRANT EXECUTE ON FUNCTION pg_backup_stop(boolean) to barman;GRANT EXECUTE ON FUNCTION pg_switch_wal() to barman;GRANT EXECUTE ON FUNCTION pg_create_restore_point(text) to barman;GRANT pg_read_all_settings TO barman;GRANT pg_read_all_stats TO barman;"
/var/alloydb/config/pg_hba.conf에 다음 줄을 추가합니다.
host all barman BARMAN_IP/32 AUTHN_METHOD
host replication alloydbreplica BARMAN_IP/32 AUTHN_METHOD
다음을 바꿉니다.
BARMAN_IP: Barman 서버의 IP 주소입니다.
AUTHN_METHOD: PostgreSQL용 AlloyDB 서버가 Barman 서버에서 예상하는 PostgreSQL 인증 방법입니다.
다음 값 중 하나를 사용하는 것이 좋습니다.
Barman 서버가 비밀번호 없이 인증하도록 허용하려면 trust를 사용하세요.
Barman 서버에서 비밀번호를 요구하려면 scram-sha-256를 사용합니다.
/var/alloydb/config/postgresql.conf 파일에 다음 줄을 추가합니다.
dockerexecpg-servicepsql-hlocalhost-Upostgres-c"SELECT name, setting FROM pg_catalog.pg_settings WHERE name IN ('archive_command', 'archive_mode', 'listen_addresses', 'wal_level') ORDER BY name; "
출력은 다음과 비슷합니다.
name | setting
------------------|-----------
archive_command | /bin/true
archive_mode | on
listen_addresses | *
wal_level | replica
(4 rows)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis page provides instructions on how to configure AlloyDB Omni to work with Barman, an open-source database backup server, for data protection purposes.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB Omni, in single-server deployments only, can be configured to allow connections from a Barman server, enabling continuous data backups.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring AlloyDB Omni involves creating a \u003ccode\u003ebarman\u003c/code\u003e database user with specific privileges, modifying \u003ccode\u003epg_hba.conf\u003c/code\u003e and \u003ccode\u003epostgresql.conf\u003c/code\u003e files, and restarting the service.\u003c/p\u003e\n"],["\u003cp\u003eSetting up the Barman server involves ensuring connectivity to the AlloyDB Omni server, configuring Barman with specific settings like \u003ccode\u003econninfo\u003c/code\u003e and \u003ccode\u003estreaming_conninfo\u003c/code\u003e, and using the \u003ccode\u003ebarman receive-wal\u003c/code\u003e command to start the WAL stream.\u003c/p\u003e\n"],["\u003cp\u003eAfter setup is complete, you can use barman commands to create on-demand backups, set up WAL streaming, restore from backups, or perform a point-in-time restoration.\u003c/p\u003e\n"]]],[],null,["# Set up Barman for AlloyDB Omni\n\nSelect a documentation version: 15.5.2keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/install-configure-barman)\n- [16.8.0](/alloydb/omni/16.8.0/docs/install-configure-barman)\n- [16.3.0](/alloydb/omni/16.3.0/docs/install-configure-barman)\n- [15.12.0](/alloydb/omni/15.12.0/docs/install-configure-barman)\n- [15.7.1](/alloydb/omni/15.7.1/docs/install-configure-barman)\n- [15.7.0](/alloydb/omni/15.7.0/docs/install-configure-barman)\n- [15.5.5](/alloydb/omni/15.5.5/docs/install-configure-barman)\n- [15.5.4](/alloydb/omni/15.5.4/docs/install-configure-barman)\n- [15.5.2](/alloydb/omni/15.5.2/docs/install-configure-barman)\n\n\u003cbr /\u003e\n\nThis page shows you how to protect your data by configuring AlloyDB Omni to work with [Barman](https://pgbarman.org/), an open-source database backup server.\n\n\u003cbr /\u003e\n\n\n| The information on this page applies only to AlloyDB Omni for containers. It does not apply to AlloyDB Omni for Kubernetes.\n\n\u003cbr /\u003e\n\nYou can protect your AlloyDB Omni data using any database backup technology that works with PostgreSQL. As a best practice, Google recommends Barman. You can configure AlloyDB Omni to allow\nconnections from a Barman server that you control. This enables the Barman server to perform continuous backups of the data stored in your AlloyDB Omni server.\n\nAfter you configure your Barman and AlloyDB Omni servers to work together, you can subsequently [run Barman commands](https://docs.pgbarman.org/release/latest/#general-commands) to accomplish a variety of data-protection and disaster-recovery tasks, including the following:\n\n- Create an on-demand backup of your data.\n- Set up synchronous WAL streaming of your data changes to your backup server.\n- Restore from a specific backup.\n- Perform a point-in-time restoration.\n\nFor more information about the operation of Barman, see [the Barman manual](https://docs.pgbarman.org/release/latest/).\n\nBefore you begin\n----------------\n\nBefore configuring AlloyDB Omni to work with Barman, you need the following:\n\n- [AlloyDB Omni installed and running](/alloydb/omni/15.5.2/docs/install) on a server that you control.\n\n- [Barman installed](https://docs.pgbarman.org/release/latest/#installation) on a separate server. The server that you installed Barman on must be able to communicate with the AlloyDB Omni server over TCP.\n\nConfigure AlloyDB Omni to work with Barman\n------------------------------------------\n\nTo prepare your AlloyDB Omni server to work with Barman, run the following commands on the server that you have\ninstalled AlloyDB Omni onto.\n\n1. Create the `barman` database user, with the appropriate privileges:\n\n docker exec pg-service psql -h localhost -U postgres -c \"\n CREATE USER barman;\n GRANT EXECUTE ON FUNCTION pg_backup_start(text, boolean) to barman;\n GRANT EXECUTE ON FUNCTION pg_backup_stop(boolean) to barman;\n GRANT EXECUTE ON FUNCTION pg_switch_wal() to barman;\n GRANT EXECUTE ON FUNCTION pg_create_restore_point(text) to barman;\n GRANT pg_read_all_settings TO barman;\n GRANT pg_read_all_stats TO barman;\n \"\n\n\u003cbr /\u003e\n\n1. Add the following lines to `/var/alloydb/config/pg_hba.conf`:\n\n host all barman \u003cvar translate=\"no\"\u003eBARMAN_IP\u003c/var\u003e/32 \u003cvar translate=\"no\"\u003eAUTHN_METHOD\u003c/var\u003e\n host replication alloydbreplica \u003cvar translate=\"no\"\u003eBARMAN_IP\u003c/var\u003e/32 \u003cvar translate=\"no\"\u003eAUTHN_METHOD\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eBARMAN_IP\u003c/var\u003e: the IP address of the Barman server.\n\n - \u003cvar translate=\"no\"\u003eAUTHN_METHOD\u003c/var\u003e: the PostgreSQL authentication method\n that your AlloyDB for PostgreSQL server expects from the Barman server.\n We recommend one of the following values:\n\n - To allow the Barman server to autheneticate without a password, use `trust`.\n\n - To require a password from the Barman server, use `scram-sha-256`.\n\n2. Add the following lines to the `/var/alloydb/config/postgresql.conf` file:\n\n archive_command='/bin/true'\n archive_mode=on\n listen_addresses='*'\n wal_level='replica'\n\n3. Restart the AlloyDB Omni service:\n\n sudo alloydb database-server stop\n sudo alloydb database-server start\n\n4. Confirm the necessary parameters are all set appropriately by running\n the following command:\n\n docker exec pg-service psql -h localhost -U postgres -c \"\n SELECT name, setting\n FROM pg_catalog.pg_settings\n WHERE name IN ('archive_command',\n 'archive_mode',\n 'listen_addresses',\n 'wal_level')\n ORDER BY name;\n \"\n\n The output is similar to the following: \n\n name | setting \n ------------------|-----------\n archive_command | /bin/true\n archive_mode | on\n listen_addresses | *\n wal_level | replica\n (4 rows)\n\n5. Verify that the streaming replication connection works:\n\n docker exec pg-service psql -h localhost -U postgres -c \"IDENTIFY_SYSTEM\" replication=1\n\n The output is similar to the following: \n\n systemid | timeline | xlogpos | dbname\n ---------------------+----------+------------+--------\n 7265722823667040273 | 1 | 0/1F0AFCD0 |\n (1 row)\n\nSet up the Barman backup server\n-------------------------------\n\nTo set up and configure Barman to work with your AlloyDB Omni server,\nrun the following commands on your Barman server.\n\n1. Ensure that Barman can connect to the AlloyDB Omni server as the `barman` database user.\n\n psql -h \u003cvar translate=\"no\"\u003eDATABASE_IP\u003c/var\u003e -U barman -d postgres -c \"SELECT 'Connected as: '||current_user\"\n\n Replace \u003cvar translate=\"no\"\u003eDATABASE_IP\u003c/var\u003e with the IP address of your AlloyDB Omni server.\n\n The output is similar to the following: \n\n ?column? \n ----------------------\n Connected as: barman\n (1 row)\n\n2. [Configure the Barman backup server](https://docs.pgbarman.org/release/latest/#setup-of-a-new-server-in-barman) according to your needs and preferences.\n\n Your configuration must include the following settings:\n - Set `conninfo` to connect to the AlloyDB Omni `postgres` database as the `barman` user.\n - Set `streaming_conninfo` to use the `alloydbreplica` user.\n - Configure other directives required to enable WAL streaming, as directed by the Barman documentation.\n\n The following minimal but complete example modifies [a streaming-configuration example from the Barman documentation](https://docs.pgbarman.org/release/latest#examples-of-configuration): \n\n [\u003cvar translate=\"no\"\u003eCONFIGURATION_TAG\u003c/var\u003e]\n description = \"Backup settings for my AlloyDB Omni server\"\n conninfo = host=\u003cvar translate=\"no\"\u003eDATABASE_IP\u003c/var\u003e user=barman dbname=postgres\n streaming_conninfo = host=\u003cvar translate=\"no\"\u003eDATABASE_IP\u003c/var\u003e user=alloydbreplica\n backup_method = postgres\n streaming_archiver = on\n slot_name = barman\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONFIGURATION_TAG\u003c/var\u003e: a short tag to identify this server configuration when running `barman` commands---for example, `omni`.\n\n - \u003cvar translate=\"no\"\u003eDATABASE_IP\u003c/var\u003e: the IP address of your AlloyDB Omni server.\n\n3. Switch to the `barman` user.\n\n sudo su barman\n\n4. Use [the `barman receive-wal` command](https://docs.pgbarman.org/release/3.10.0/#receive-wal) to create a replication slot, and then\n begin receiving a WAL stream from the database server:\n\n sudo barman receive-wal --create-slot \u003cvar translate=\"no\"\u003eCONFIGURATION_TAG\u003c/var\u003e\n sudo barman receive-wal \u003cvar translate=\"no\"\u003eCONFIGURATION_TAG\u003c/var\u003e &\n\n Replace \u003cvar translate=\"no\"\u003eCONFIGURATION_TAG\u003c/var\u003e with the configuration tag that you chose in the previous step.\n\nBarman is now configured to work with your AlloyDB Omni server.\nTo check the replication status, create manual backups, and perform other tasks,\nsee [General commands](https://docs.pgbarman.org/release/latest/#general-commands).\n\nFor example, to create a manual backup, run [the `barman backup` command](https://docs.pgbarman.org/release/latest/#backup).\n\nWhat's next\n-----------\n\n- [Restore an AlloyDB Omni cluster using Barman](/alloydb/omni/15.5.2/docs/clone-omni-barman)"]]