This demo script walks through several OE replication scenario's using the sports database. In the demo all of the databases are located on the same machine, obviously property files would need adjusting for real-world multi-machine replication.
Original Demo script by Dan Mitchell
Primary failure and manual failover
- Supported Linux distro (see Progress Availability Guides)
- Minimum of OpenEdge 11.7.x installed (preferably OE12.2x or higher)
- Using the Replication Set functionality
- Git installed
-
Move to your working directory (from now on called $WRK)
-
Execute the following command:
git clone https://github.com/rwdroge/oereplication\_demo.git
-
Open four PuTTY sessions to your Linux instance
- From prompt make sure to become super user (if you aren't already):
sudo su
- From prompt make sure to become super user (if you aren't already):
-
Change directory, background and foreground in three windows
- First window – background teal, foreground black
cd $WRK/primary
- Second window – background yellow, foreground black
cd $WRK/secondary
- Third window – background white, foreground black
cd $WRK/tertiary
- Fourth window – do not change colors
cd $WRK/primary
- First window – background teal, foreground black
-
In each window, execute the commands:
export DLC=<your_dlc>;
export PATH=$PATH:$DLC/bin
-
In black window
./reset.sh
-
This will have setup the environment (and started replication between primary, secondary and tertiary databases)
-
In teal, yellow and white screens, execute:
./tl.sh
-
In black window in $WRK/primary, execute:
./updatecust.sh
-
Watch teal for "Sending" and yellow and white for "Processing messages"
-
Replication is working correctly from primary to secondary and tertiary
-
In $WRK/primary, execute:
dsrutil primary -C transition failover
-
In teal and yellow do ctrl-c and once failover is done execute:
./tl2.sh
-
In the black window execute:
cd /usr/wrk/secondary
./updatecust.sh
-
In yellow, confirm "Sending"
-
In teal, confirm "process"
-
Primary and secondary databases have reversed roles
-
From $WRK/secondary, execute:
dsrutil secondary -C transition failover
-
In teal and yellow, ctrl-c and after failback is done execute:
./tl.sh
-
In $WRK/primary, execute:
./updatecust.sh
-
In teal, confirm "Sending"
-
In yellow, confirm "process"
-
System has reversed roles again
-
In primary, execute:
./transetup.sh
- In secondary:
cp secondary.repl.properties.t secondary.repl.properties
dsrutil secondary -C terminate agent
dsrutil secondary -C restart agent
- In primary:
dsrutil primary -C restart server
- In secondary:
-
In all three windows execute:
./tl.sh
-
In Primary, to verify that replication is still working as shown in screens from last exercise execute:
./updatecust.sh
-
In the black window execute and note the PID (process id):
ps -ef |grep rpserv
-
Kill process by executing:
kill -9 <PID>
-
Yellow and White screens' logs will say "Pre-transition"
-
Press Ctrl-C in teal window
-
In Black window execute:
cd $WRK/secondary
dsrutil secondary -C transition
-
After transition completes, stop yellow (CTRL+C) and execute:
./tl2.sh
-
In $WRK/secondary, execute:
./updatecust.sh
-
Yellow screen is now showing "Sending" and white shows "process"
-
Secondary database is now the source database and tertiary continues to be a target to the new source
- In the black screen execute:
cd $WRK/secondary
probkup online secondary secondary.bak
cp secondary.bak ../primary
cd ../primary
./restoreprimary.sh
restoreprimary.sh:
prodel primary prorest primary secondary.bak rfutil primary -C mark backedup proutil primary -C aimage begin proutil primary -C aiarchiver enable proutil handy -C enablesitereplication target ./pri-server2.sh```
-
Execute:
cd ../secondary
-
Execute:
./restartreplserv.sh
restartreplserv.sh:
dsrutil secondary -C terminate server dsrutil secondary -C restart server cd ../primary dsrutil primary -C restart agent
-
In teal window, execute:
./tl2.sh
-
In black window execute:
./updatecust.sh
-
Yellow window is now showing "Sending" and teal and white are processing so primary database is now a target database
- In black window execute:
cd $WRK/secondary
./configfailback.sh
configfailback.sh
cp secondary.repl.properties.tf secondary.repl.properties
dsrutil secondary -C terminate server
dsrutil secondary -C restart server
-
Restart ./tl.sh in yellow and teal windows
-
In black window execute:
dsrutil secondary -C transition failover
cd ../primary
./updatecust.sh