PGObject::Util::Replication::Master - Manage Database Masters
Version 0.01
Quick summary of what the module does.
Perhaps a little code snippet.
use PGObject::Util::Replication::Master; my $masterdb = PGObject::Util::Replication::Master->new( host => 'localhost', port => 5432, ); # also slot management $master->slots(); $master->addslot('slotname'); $master->removeslot('slotname');
Hostname or IP address
defaults to 5432
Username for the connection string. If not provided, dbi defaults to the username for the system user of the script running this module
Password for connecting, if needed based on pg_hba.conf settings
Database name for connecting. Defaults to postgres
Whether to autocommit statements. This defaults to true.
If set, save the connection for repeated use. Defaults to off which means we reconnect for each operation.
Set to true if you are doing a lot of operations.
This is the variables we read or write. It is intended to be unmodified as it is.
Returns a DBI connection to the database and checks to make sure we are not in recovery. If we are in recovery, an exception is thrown.
Disconnect, if using persist_connect
Returns true if the user credentials allow us to create and manage replication slots.
This requires either superuser or replication attributes for the user.
Lists all replication slots, their lags, etc.
Returns info from a single named slot
Adds a named replication slot
Deletes a named replication slot
connects to the db and asks for the current wal log series number (lsn) and related information. Is intended to be used for monitoring and to deliver telemtry data.
Returned hashref includes:
The curret query log sequence number at the time of snapshot epoch
The current epoch at time of snapshot (technically small variance is possible here).
Number of bytes sent to the WAL since last time this was called (if known). Will be undef on first run after loading module.
Number of seconds (including fractional seconds) since last run if known. Will be undef on first run after loading module.
Number of bytes per sec on average since last run. Will be undef on first run.
On the first run, we will get the lsn and the epoch of the current snapshot but no deltas because we lack a comparison. On subsequent runs we get telemetry.
Reads all settings from the pg instance.
Adds one more config setting to the managed list and sets it to the default
Sets a config value for later config file writing.
Returns a file of the structure of the config file, based on all managed values.
Chris Travers, <chris.travers at adjust.com>
<chris.travers at adjust.com>
Please report any bugs or feature requests to bug-pgobject-util-replication-master at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PGObject-Util-Replication-Master. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-pgobject-util-replication-master at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc PGObject::Util::Replication::Master
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Util-Replication-Master
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/PGObject-Util-Replication-Master
CPAN Ratings
http://cpanratings.perl.org/d/PGObject-Util-Replication-Master
Search CPAN
http://search.cpan.org/dist/PGObject-Util-Replication-Master/
Copyright 2017 Chris Travers.
This program is distributed under the (Revised) BSD License: http://www.opensource.org/licenses/BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Adjust.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install PGObject::Util::Replication::Master, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PGObject::Util::Replication::Master
CPAN shell
perl -MCPAN -e shell install PGObject::Util::Replication::Master
For more information on module installation, please visit the detailed CPAN module installation guide.