Management of D2000 archives must be performed as a root user.

The script <instancedir>/bin/d2arc <command> [<appname> [<arcname>]] is used to manage the D2000 application archives

<appname> is the name of the application, if not specified, the script will ask for the application name.

<arcname> is the name of the archive, if not specified, the script will ask for the archive name.

<command> is one of the options:

create

creates an archive database for the archive <arcname>

[root@localhost bin]# ./d2arc create app1 arc1
=======================
Ready to create D2000 archive:
           Application name: app1
               Archive name: arc1
            psql executable: /usr/pgsql-9.6/bin/psql
--
        D2000 instance name: d2000
     D2000 installation dir: /opt/d2000
=======================

Proceed (yY|nN)? [y]: y
Creating archive database...done
Archive database arc1 created.

In case you are creating an archive for an application that runs on a computer other than the D2000 kernel (i.e., a remote archive), enter the name of the remote application. The script detects that the application does not exist on the local computer, so it offers to create it and also creates a systemd service that will start the archive process.


[root@localhost bin]# ./d2arc create remoteApp arc1
Application remoteApp does not exist. Create remote application (yY|nN)? [y]: y
=======================
Ready to create D2000 archive:
           Application name: remoteApp
               Archive name: arc1
            psql executable: /usr/pgsql-9.6/bin/psql
--
        D2000 instance name: d2000
     D2000 installation dir: /opt/d2000
=======================

Proceed (yY|nN)? [y]: y
Creating archive database...done
Archive database arc1 created.

Enter D2000 process command line: archiv /CremoteApp /Warc1
systemd service "d2000-remoteApp-arc1.arc.service" for process "arc1.arc" was created.


delete

deletes the archive database to the archive <arcname>

[root@localhost bin]# ./d2arc delete app1 arc1
=======================
Ready to delete D2000 archive:
           Application name: app1
               Archive name: arc1
            psql executable: /usr/pgsql-9.6/bin/psql
--
        D2000 instance name: d2000
     D2000 installation dir: /opt/d2000
=======================

Proceed (yY|nN)? [n]: y
Archive "arc1" was deleted.

export-data

exports the archive database to a file

[root@localhost bin]# ./d2arc export-data app1 arc1
Enter dump file name [app1_arc1.archive_dmp]:
Enter password for postgresql user dba:
Password:
Export to app1_arc1.archive_dmp finished.import-data

import-data

imports the archive database from the file 

[root@localhost bin]# ./d2arc import-data app1 arc1
Enter dump file name [app1_arc1.archive_dmp]:
Enter password for postgresql user dba:
Import from app1_arc1.archive_dmp finished.
Napíšte komentár