openedge replication made easy

37
OpenEdge Replication Made Easy Adam Backman White Star Software [email protected]

Upload: danae

Post on 25-Feb-2016

162 views

Category:

Documents


7 download

DESCRIPTION

OpenEdge Replication Made Easy . Adam Backman White Star Software [email protected]. Agenda. Setup System Database Replication Maintenance Transition Common recovery scenarios Conclusion. What is it? a nd Why Do I Need it?. Types of System Replication. True failover - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: OpenEdge  Replication Made Easy

OpenEdge Replication Made Easy

Adam BackmanWhite Star Software

[email protected]

Page 2: OpenEdge  Replication Made Easy

Agenda

• Setup– System– Database– Replication

• Maintenance• Transition• Common recovery

scenarios• Conclusion

Page 3: OpenEdge  Replication Made Easy

What is it?and

Why Do I Need it?

Page 4: OpenEdge  Replication Made Easy

Types of System Replication

• True failover– Run the entire operation

• Partial failover– Run core services only in failover mode

• Recovery– The target machine is essentially a backup

• Asynchronous vs. Synchronous

Page 5: OpenEdge  Replication Made Easy

Setup: System

• Operating system• Hardware

– Disk– Other resources

• Support software

Page 6: OpenEdge  Replication Made Easy

Setup: Operating System

• Operating system version• Patches• Same Kernel parameters

Two Reasons– Nothing unexpected when you fail over– Easier to maintain if both machines are identical

Page 7: OpenEdge  Replication Made Easy

Setup: Disk

• Both machines need the same storage capacity (DB, application, temp files, …)

• Source machine can use 200 GB drives and the target can use 1TB drives

• This will affect performance in the event of a failover but you can choose to run only core services in failover mode

Page 8: OpenEdge  Replication Made Easy

Setup - Other Resources

CPU, Memory– Need to support replication

• Single fast CPU on replication machine• Multiple CPUs in Production

– Need to support all or some of your users depending on your recovery plan

Page 9: OpenEdge  Replication Made Easy

Setup: Support software

• Fax• EDI• PostalSoft

• All software must be purchased and configured if your failover plan includes moving the users to the replication machine

Page 10: OpenEdge  Replication Made Easy

Setup: Database

• Must have an existing comprehensive recovery plan in place

• Must have multi-volume after image setup• Target database *should* have the same

structure definition as the source

Page 11: OpenEdge  Replication Made Easy

Setup: Replication

• We will get to the database in a minute but you need to also plan for replication of other portions of the system.

• Options:– Remote mirrors (hardware)– Operating system commands (Example: rsync)– Any others?

Page 12: OpenEdge  Replication Made Easy

Asynchronous Replication

• Also know as log-based replication• Not true replication but a point in time

synchronization between two machines• After image files are taken from the source

machine and applied throughout the day• Pros:

– Cheap• Cons:

– Not synchronous – Must maintain the code yourself

Page 13: OpenEdge  Replication Made Easy

OpenEdge Replication

This is a feature/product from Progress that provides real-time synchronization between two or more databases. There is a replication server (source) and one or two replication agents (targets).

Page 14: OpenEdge  Replication Made Easy

What is OpenEdge Replication?

Users doing work

After Image

Source DB

OE Replication

Server

OE Replication

Agent(s)

Target DB(s)

Page 15: OpenEdge  Replication Made Easy

Pros and Cons: OpenEdge Replication

• Pros– Supported product (10.1 and above is best)– Real-time replication– Supports reporting on the target side

• Cons– Not free (REALLY NOT FREE)– Need to learn another set of utilities– No support (currently) for asynchronous

replication

Page 16: OpenEdge  Replication Made Easy

Initial Setup: OpenEdge Replication (Offline)

• After imaging must be enabled for the source database• With the database down you can enable site replication

for the source databaseproutil <dbname> –C enablesitereplication source

• Move the properties files into place Currently the same directory as the DB

• Start the source database with -DBService replserv and -pica parameters

• Do an online backup of the source• Restore the backup to the target

Page 17: OpenEdge  Replication Made Easy

-pica

• Determines the size of the interprocess communication queue between the RDBMS and the replication server

• Default value 64k in 10.1C+ and 6k before• Default value is generally too low• Always set it to it’s maximum value

– In 10.1C+ set it to 8192 (8MB)– Prior to 10.1C set it to 2048

Page 18: OpenEdge  Replication Made Easy

Initial Setup: OpenEdge Replication (Online)• Enable After Imaging (If necessary)• Put the replication properties files in place• You need to use deferred agent startup

[server]defer-agent-startup=<number-of-minutes>Note: number of minutes must be between 0 and 10080 (1 week)

• Enable replicationproutil <dbname> -C enablesitereplication source

• Do an online backup to build target databaseproutil online <source-db> <bkup_file> -REPLTargetCreation

Page 19: OpenEdge  Replication Made Easy

Initial Setup: OpenEdge Replication (continued)

• After the restore to the target is complete• Enable site replication on the target

proutil <dbname> –C enablesitereplication targetOrprorest <dbname> <backupname> -REPLTransition

• Start the target with -DBService replagent and -S <service or port number> parameters

• Use the dsrutil utility to monitor replicationdsrutil <dbname> –C monitor

• Or look for the following message in the target database .lg file“The Source and Target databases are synchronized. (10668).”

Page 20: OpenEdge  Replication Made Easy

Setup: OpenEdge properties files

• Server Properties File• Agent Properties File(s)

Page 21: OpenEdge  Replication Made Easy

Example: source.repl.properties

[server] control-agents=agent1 database=source transition=manual transition-timeout=600

[control-agent.agent1] name=agent1 database=source host=moth port=4501 connect-timeout=120 replication-method=async critical=0

Page 22: OpenEdge  Replication Made Easy

Example: target.repl.properties

[agent] name=agent1 database=source listener-minport=4387 listener-maxport=4500

Page 23: OpenEdge  Replication Made Easy

Maintenance Issues: OpenEdge Replication

• Fathom replication does not support 2-phase commit

• Index rebuild will require a initialization of the replication process (Use: index compact)

• Index and table moves must be done in multi-user mode

• Generally, changes to the database must be done in multi-user mode as the broker is the mechanism that starts replication

Page 24: OpenEdge  Replication Made Easy

After image file status

• Empty– Ready for use

• Busy– Currently being used

• Full– Closed and applied to target

• Locked (Replication only)– Closed and not yet applied to target

Page 25: OpenEdge  Replication Made Easy

Maintenance

• Is replication running?• Other replication maintenance• How to do common maintenance tasks

– Add extents– Index rebuild

Page 26: OpenEdge  Replication Made Easy

Monitoring Replication

• Use the dsrutil utility with the monitor optiondsrutil <dbname> -monitor

• This can be done on the source or target side

Page 27: OpenEdge  Replication Made Easy

Monitoring: Server Site Replication Monitor Version 2 Page 1 Database: /data/source_db Database is enabled as Fathom Replication: Source Server is: Normal processing Number of configured agents: 1 Defer Agent Startup : Continue connection attempts until: Mon Nov 7 11:59:55 2005 Deferred Agent Startup will expire in : 1 Hr 14 Min 44 Sec Next connection attempt in : 30 Seconds Connections attempts performed 1 Agent(s) currently connected 0 Delay Interval (current / min / max): 25 / 5 / 500 Recovery information State: No recovery being performed Agents needing recovery: 0 Agents connected: 0 Agents in synchronization: 0 Transition information: Type: Manual Transition timeout limit: 600 seconds

Source: Progress Fathom Replication User Guide

Page 28: OpenEdge  Replication Made Easy

Monitoring: AgentSite Replication Monitor Version 2 Page 1 Database: /data/source_db Agent: Name: agent1 ID: 1 Host name: localhost Target database: target_db State: Normal processing Critical: No Method: Asynchronous Remote agent is: Connected via broker Source and target are synchronized In normal processing Remote agent is waiting for: Nothing Recovery state: No recovery being performed Maximum bytes in TCP/IP message: 30720 Server/Agent connection time: Mon Oct 31 14:50:58 2005 Server/Agent connection timeout: 120.000 seconds Transition information: Type: Manual Timeout limit: 0 seconds The last block was sent at: Mon Oct 31 14:57:42 2005 Activity information: Blocks sent: 720 Blocks acknowledged: 28 Synchronization points 12 AI Block Information: Current RDBMS Block (Seq / Block): 5 / 1923 Last Sent Block (Seq / Block): 5 / 1923 Server to agent load check interval: 10 blocks Time between server and agent load checks: 5.597 seconds Time taken to respond to load check: 0.178 seconds

Source: Progress Fathom Replication User Guide

Page 29: OpenEdge  Replication Made Easy

Other DSRUTIL Optionapplyextent

Manual application of source AI extents to the target database.canceldefer

Do not attempt reconnect to deferred replication agent.connectagent or startagent

Start agent(s).disablesitereplication

Online disable of replication on the source database.recovery

Displays the replication recovery information.

Page 30: OpenEdge  Replication Made Easy

Other DSRUTIL Optionrelwaits

Release any waits so that database activity can continue.restart

Restart replication server.terminate

Terminates replication server or agent.transition

Transition agent to a replication-enabled database.triggertransition

Places the target database into a pre-transition state.

Page 31: OpenEdge  Replication Made Easy

Transition

• Database Roles• Changing roles• How to transition

– Auto– Manual

Page 32: OpenEdge  Replication Made Easy

Database Roles

• Primary database - The database your application interacts with. Used as a source in normal operations mode

• Secondary database - The database that acts as a target in normal operations mode

• These roles do not change but in transition the Primary database can act as a target while the Secondary database interacts with your application

Page 33: OpenEdge  Replication Made Easy

Failover

• Primary database fails• If primary machine is available apply last

transactionsdsrutil <dbname> -C applyextent <extentname>

• Then transition the databasedsrutil <dbname> -C transition [failover][failover] will transition the target via the replication agent

then transition the source. If replication is not running you cannot use the failover option

Page 34: OpenEdge  Replication Made Easy

Failback

• No activity on the databases• No users on the database• Run “dsrutil <dbname> -C transition failover”• This will transition the primary database (now

target) to transition to a source and then transition the secondary database (no a source) to a target.

• If you have “restart-after-transition” set in the properties files then the databases will be restarted in their proper roles

Page 35: OpenEdge  Replication Made Easy

Points to Remember

• Start with a good backup plan• You must have multi-volume AI• Choose a replication method that makes sense

for you• If you choose OpenEdge Replication use

asynchronous replication for performance reasons

• Test extensively before doing replication in your production environment

Page 36: OpenEdge  Replication Made Easy

Questions?

Adam [email protected]

Page 37: OpenEdge  Replication Made Easy

Thank you for your time!