In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Test environment:
CentOS Linux release 7.4.1708 (Core) X64
PostgreSQL: 10.1 (Source)
Pgbackrest: pgbackrest-release-1.27.tar.gz
1.Test-Simple-1.302120.tar.gz
# perl Makefile.PL
# make
# make test
.
.
All tests successful.
Files=220, Tests=2514, 29 wallclock secs (1.10 usr 0.60 sys + 17.97 cusr 4.61 csys = 24.28 CPU)
Result: PASS
#
# make install
2.DBI-1.637.tar.gz
# tar zxvf DBI-1.637.tar.gz
# cd DBI-1.637
# perl Makefile.PL
# make
# make test
.
.
All tests successful.
Files=194, Tests=9005, 113 wallclock secs (2.57 usr 0.80 sys + 94.07 cusr 12.95 csys = 110.39 CPU)
Result: PASS
PERL_DL_NONLAZY=1 / usr/bin/perl "- Iblib/lib"-Iblib/arch "test.pl
Test.pl
DBI test application $Revision$
Switch: DBI 1.637 by Tim Bunce, 1.637
Available Drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge
Dbi:ExampleP:: testing 3 sets of 20 connections:
Connecting... 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Disconnecting...
Connecting... 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Disconnecting...
Connecting... 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Disconnecting...
Connect 20 and disconnect them, 3 times: 0.0040s / 60 = 0.0001s
Testing handle creation speed...
51282 NullP sth/s perl 5.016003 x86_64-linux-thread-multi (gcc 4.8.5-O2-g-pipe-Wall-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic) 0.000019s
Test.pl done
#
# make install
3.version-0.9918.tar.gz
# perl Makefile.PL
# make
# make test
.
.
All tests successful.
Test Summary Report
-
T/07locale.t (Wstat: 0 Tests: 8 Failed: 0)
TODO passed: 7
Files=12, Tests=2502, 2 wallclock secs (0.45 usr 0.12 sys + 1.05 cusr 1.13 csys = 2.75 CPU)
Result: PASS
Make [1]: Entering directory `/ home/soft/dbd-pg/version-0.9918/vutil'
No tests defined for version::vxs extension.
Make [1]: Leaving directory `/ home/soft/dbd-pg/version-0.9918/vutil'
# make install
4.DBD-Pg-3.7.0.tar.gz
Export PATH=/opt/pgsql/10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
Export LD_LIBRARY_PATH=/opt/pgsql/10.1/lib
Export MANPATH=/opt/pgsql/10.1/share/man:$MANPATH
# perl Makefile.PL
Configuring DBD::Pg 3.7.0
PostgreSQL version: 100001 (default port: 5432)
POSTGRES_HOME: (not set)
POSTGRES_INCLUDE: / opt/pgsql/10.1/include
POSTGRES_LIB: / opt/pgsql/10.1/lib
OS: linux
Checking if your kit is complete...
Looks good
Using DBI 1.637 (for perl 5.016003 on x86_64-linux-thread-multi) installed in / usr/local/lib64/perl5/auto/DBI/
Writing Makefile for DBD::Pg
#
# make
Cp lib/Bundle/DBD/Pg.pm blib/lib/Bundle/DBD/Pg.pm
Cp Pg.pm blib/lib/DBD/Pg.pm
/ usr/bin/perl-p-e "sAccord" driver engine Pg.xsi PG; s / ^ do\ (/ dontdo\ (/ "/ usr/local/lib64/perl5/auto/DBI/Driver.xst > Pg.xsi
/ usr/bin/perl / usr/share/perl5/vendor_perl/ExtUtils/xsubpp-typemap / usr/share/perl5/ExtUtils/typemap Pg.xs > Pg.xsc & & mv Pg.xsc Pg.c
Gcc-c-I/opt/pgsql/10.1/include-I/usr/local/lib64/perl5/auto/DBI-D_REENTRANT-D_GNU_SOURCE-fno-strict-aliasing-pipe-fstack-protector-I/usr/local/include-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64-DPGLIBVERSION=100001-DPGDEFPORT=5432-O2-g-pipe-Wall-Wp -D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic-DPERL_EXTMALLOC_DEF-Dmalloc=Perl_malloc-Dfree=Perl_mfree-Drealloc=Perl_realloc-Dcalloc=Perl_calloc-DVERSION=\ "3.7.0\"-DXS_VERSION=\ "3.7.0\"-fPIC "- I/usr/lib64/perl5/CORE" Pg.c
Gcc-c-I/opt/pgsql/10.1/include-I/usr/local/lib64/perl5/auto/DBI-D_REENTRANT-D_GNU_SOURCE-fno-strict-aliasing-pipe-fstack-protector-I/usr/local/include-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64-DPGLIBVERSION=100001-DPGDEFPORT=5432-O2-g-pipe-Wall-Wp -D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic-DPERL_EXTMALLOC_DEF-Dmalloc=Perl_malloc-Dfree=Perl_mfree-Drealloc=Perl_realloc-Dcalloc=Perl_calloc-DVERSION=\ "3.7.0\"-DXS_VERSION=\ "3.7.0\"-fPIC "- I/usr/lib64/perl5/CORE" dbdimp.c
Gcc-c-I/opt/pgsql/10.1/include-I/usr/local/lib64/perl5/auto/DBI-D_REENTRANT-D_GNU_SOURCE-fno-strict-aliasing-pipe-fstack-protector-I/usr/local/include-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64-DPGLIBVERSION=100001-DPGDEFPORT=5432-O2-g-pipe-Wall-Wp -D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic-DPERL_EXTMALLOC_DEF-Dmalloc=Perl_malloc-Dfree=Perl_mfree-Drealloc=Perl_realloc-Dcalloc=Perl_calloc-DVERSION=\ "3.7.0\"-DXS_VERSION=\ "3.7.0\"-fPIC "- I/usr/lib64/perl5/CORE" quote.c
In file included from Pg.h:59:0
From quote.c:10:
/ usr/local/lib64/perl5/auto/DBI/DBIXS.h:491:25: warning: 'dbi_get_state' defined but not used [- Wunused-function]
Static dbistate_t** dbi_get_state (pTHX) {\
^
/ usr/local/lib64/perl5/auto/DBI/DBIXS.h:504:27: note: in expansion of macro'_ DBISTATE_DECLARE_COMMON'
# define DBISTATE_DECLARE_ DBISTATE_DECLARE_COMMON
^
Pg.h:65:1: note: in expansion of macro 'DBISTATE_DECLARE'
DBISTATE_DECLARE
^
Gcc-c-I/opt/pgsql/10.1/include-I/usr/local/lib64/perl5/auto/DBI-D_REENTRANT-D_GNU_SOURCE-fno-strict-aliasing-pipe-fstack-protector-I/usr/local/include-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64-DPGLIBVERSION=100001-DPGDEFPORT=5432-O2-g-pipe-Wall-Wp -D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic-DPERL_EXTMALLOC_DEF-Dmalloc=Perl_malloc-Dfree=Perl_mfree-Drealloc=Perl_realloc-Dcalloc=Perl_calloc-DVERSION=\ "3.7.0\"-DXS_VERSION=\ "3.7.0\"-fPIC "- I/usr/lib64/perl5/CORE" types.c
In file included from Pg.h:59:0
From types.c:15:
/ usr/local/lib64/perl5/auto/DBI/DBIXS.h:491:25: warning: 'dbi_get_state' defined but not used [- Wunused-function]
Static dbistate_t** dbi_get_state (pTHX) {\
^
/ usr/local/lib64/perl5/auto/DBI/DBIXS.h:504:27: note: in expansion of macro'_ DBISTATE_DECLARE_COMMON'
# define DBISTATE_DECLARE_ DBISTATE_DECLARE_COMMON
^
Pg.h:65:1: note: in expansion of macro 'DBISTATE_DECLARE'
DBISTATE_DECLARE
^
Running Mkbootstrap for DBD::Pg ()
Chmod 644 Pg.bs
Rm-f blib/arch/auto/DBD/Pg/Pg.so
Gcc- shared-O2-g-pipe-Wall-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack-protector-strong-- param=ssp-buffer-size=4-grecord-gcc-switches-M64-mtune=generic-Wl,-z,relro Pg.o dbdimp.o quote.o types.o-o blib/arch/auto/DBD/Pg/Pg.so\
-L/opt/pgsql/10.1/lib-lpq-lm\
Chmod 755 blib/arch/auto/DBD/Pg/Pg.so
Cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs
Chmod 644 blib/arch/auto/DBD/Pg/Pg.bs
Manifying blib/man3/Bundle::DBD::Pg.3pm
Manifying blib/man3/DBD::Pg.3pm
[root@localhost DBD-Pg-3.7.0] # make test
PGINITDB= "/ opt/pgsql/10.1/bin/initdb" PERL_DL_NONLAZY=1 / usr/bin/perl "- MExtUtils::Command::MM"- e"test_harness (0, 'blib/lib',' blib/arch')" tAction.t
T/00_signature.t.... Skipped: Set the environment variable TEST_SIGNATURE to enable this test
T/00basic.t. Ok
T/01connect.t. 1/15 #
# DBI Version 1.637
# DBD::Pg Version 3.7.0
# Perl Version 5.16.3
# OS linux
# PostgreSQL (compiled) 100001
# PostgreSQL (target) 100001
# PostgreSQL (reported) PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
# Default port 5432
# DBI_DSN dbi:Pg:
# DBI_USER postgres
# Test schema dbd_pg_testschema
# LANG en_US.UTF-8
# array_nulls on
# backslash_quote safe_encoding
# client_encoding UTF8
# server_encoding UTF8
# standard_conforming_strings on
# Adjusted: DBI_DSN
T/01connect.t. Ok
T/01constants.t. Ok
T/02attribs.t. Ok
T/03dbmethod.t. Ok
T/03smethod.t. Ok
T/04misc.t. Ok
T/06bytea.t. Ok
T/07copy.t. Ok
T/08async.t. Ok
T/09arrays.t. Ok
T/12placeholders.t.. Ok
T/20savepoints.t.... Ok
T/30unicode.t. Ok
T/99cleanup.t. Ok
All tests successful.
Files=16, Tests=2129, 26 wallclock secs (0.57 usr 0.13 sys + 3.78 cusr 4.35 csys = 8.83 CPU)
Result: PASS
[root@localhost DBD-Pg-3.7.0] # make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing / usr/local/lib64/perl5/auto/DBD/Pg/Pg.so
Installing / usr/local/lib64/perl5/auto/DBD/Pg/Pg.bs
Installing / usr/local/lib64/perl5/DBD/Pg.pm
Installing / usr/local/lib64/perl5/Bundle/DBD/Pg.pm
Installing / usr/local/share/man/man3/Bundle::DBD::Pg.3pm
Installing / usr/local/share/man/man3/DBD::Pg.3pm
Appending installation info to / usr/lib64/perl5/perllocal.pod
#
5.other perl module
# yum install-y perl-IO-Socket-SSL perl-XML-LibXML openssl-devel perl-Digest-SHA perl-JSON-PP
6.pgbackrest
# tar zxvf pgbackrest-release-1.27.tar.gz
# cd pgbackrest-release-1.27
# lib #
# cp-r lib/pgBackRest / usr/share/perl5
# find / usr/share/perl5/pgBackRest-type f-exec chmod 644 {} +
# find / usr/share/perl5/pgBackRest-type d-exec chmod 755 {} +
# bin #
# cp bin/pgbackrest / usr/bin/pgbackrest
# chmod 755 / usr/bin/pgbackrest
# log #
# mkdir-m 770 / var/log/pgbackrest
# chown postgres:postgres / var/log/pgbackrest
# conf #
# touch / etc/pgbackrest.conf
# chmod 640 / etc/pgbackrest.conf
# chown postgres:postgres / etc/pgbackrest.conf
# Build and Install C Library #
# cd libc/
# perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none
Writing Makefile for pgBackRest::LibC
#
# make test
.
.
All tests successful.
Files=1, Tests=4, 1 wallclock secs (0.02 usr 0.01 sys + 0.12 cusr 0.03 csys = 0.18 CPU)
Result: PASS
#
# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing / usr/local/lib64/perl5/auto/pgBackRest/LibC/LibC.so
Installing / usr/local/lib64/perl5/auto/pgBackRest/LibC/LibC.bs
Installing / usr/local/lib64/perl5/pgBackRest/LibC.pm
Installing / usr/local/lib64/perl5/pgBackRest/LibCAuto.pm
Installing / usr/local/lib64/perl5/auto/pgBackRest/LibC/autosplit.ix
Appending installation info to / usr/lib64/perl5/perllocal.pod
#
# su-postgres
Last login: Thu Dec 21 15:50:54 CST 2017 on pts/1
[postgres@localhost] $pgbackrest-- help
Unknown option: help
PgBackRest 1.27-General help
Usage:
Pgbackrest [options] [command]
Commands:
Archive-get Get a WAL segment from the archive.
Archive-push Push a WAL segment to the archive.
Backup Backup a database cluster.
Check Check the configuration.
Expire Expire backups that exceed retention.
Help Get help.
Info Retrieve information about backups.
Restore Restore a database cluster.
Stanza-create Create the required stanza data.
Stanza-upgrade Upgrade a stanza.
Start Allow pgBackRest processes to run.
Stop Stop pgBackRest processes from running.
Version Get version.
Use 'pgbackrest help [command]' for more information.
[postgres@localhost ~] $
# root #
# mkdir / var/lib/pgbackrest
# chmod 750 / var/lib/pgbackrest
# chown postgres:postgres / var/lib/pgbackrest
# su-postgres
$vi postgresql.conf
Listen_addresses ='*'
Wal_level = logical
Archive_mode = on
Archive_command = 'pgbackrest-- stanza=db archive-push% p'
# log_line_prefix ='% m [% p]'
# max_wal_senders = 10
Wal_keep_segments = 5000
# hot_standby = on
$openssl rand-base64 48
LFhhFeDQPazx59LPvztsWu5leUqsiOwhI8JT7gMAmACMVX+Kcwak5qDOVNiiNkqX
$vi / etc/pgbackrest.conf
# contains only letters and cannot be db01
[db]
Db-path=/pgdata10
[global]
Repo-cipher-pass=lFhhFeDQPazx59LPvztsWu5leUqsiOwhI8JT7gMAmACMVX+Kcwak5qDOVNiiNkqX
Repo-cipher-type=aes-256-cbc
Repo-path=/var/lib/pgbackrest
Retention-full=2
Process-max=3
Start-fast=y
Stop-auto=y
$vi .bash _ profile
# User specific environment and startup programs
Export LD_LIBRARY_PATH=/opt/pgsql/10.1/lib
Export MANPATH=/opt/pgsql/10.1/share/man:$MANPATH
Export PATH=/opt/pgsql/10.1/bin:$PATH:$HOME/.local/bin:$HOME/bin
1) .create repository
$pgbackrest-stanza=db-log-level-console=info stanza-create
2017-12-21 16 db1-path=/pgdata10 1415 25.331 P00 INFO: stanza-create command begin 1.27:-- db1-path=/pgdata10-- log-level-console=info-- repo-path=/var/lib/pgbackrest-- stanza=db01
2017-12-21 16 1415 25.801 P00 INFO: stanza-create command end: completed successfully
$
$pgbackrest-stanza=db-log-level-console=info check
2017-12-21 16 db1-path=/pgdata10 4615 45.886 P00 INFO: check command begin 1.27:-- db1-path=/pgdata10-- log-level-console=info-- repo-path=/var/lib/pgbackrest-- stanza=db
2017-12-21 16 parcels 46 P00 48.243 P00 INFO: WAL segment 000000010000000000000005 successfully stored in the archive at'/ var/lib/pgbackrest/archive/db/10-1Universe 000000010000000000000000000000000005Clavia85cb846cee3a5a47b487415a2570ce7b5fb2f8.gz'
2017-12-21 16 Flux 46 purl 48.244 P00 INFO: check command end: completed successfully
$
2)。 Backup operation
# full #
Pgbackrest-stanza=db-type=full-log-level-console=info backup
# incremental #
$pgbackrest-stanza=db-type=incr-log-level-console=info backup
# diff #
Pgbackrest-stanza=db-type=diff-log-level-console=info backup
# display backup #
$pgbackrest-stanza=db-log-level-console=info info
# restore (--delta, PGDATA base exist part file,miss some files) #
$pgbackrest-stanza=db-delta-log-level-console=info restore
# restore (--delta, PGDATA none file) #
$pgbackrest-stanza=db-log-level-console=info restore
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.