Upload
linas-virbalas
View
702
Download
0
Tags:
Embed Size (px)
Citation preview
© Continuent 2010
Linas Virbalas Continuent, Inc.
© Continuent 2010
/ Introductions / What is Tungsten? / Architecture of a Rule–Based Management
Framework for Database Clusters / Demo of Business Rules in Operation / Business Rules in Source Code / Questions and Comments
© Continuent 2010
© Continuent 2010
/ Our Mission: Continuent is the data reliability company that keeps business in business
/ Our Solution: • Continuent Tungsten (Master/Slave Database Replication)
/ Our Value: • Enterprise class data management • Open source cost • Integrated solution
/ Our Technical Expertise • Database replication • Database cluster management • Application connectivity • Software-as-a-Service (SaaS)
© Continuent 2010
© Continuent 2010
What Is Tungsten?
/ Tungsten implements master/slave clusters to: • Protect data • Maintain high availability • Improve resource utilization • Raise performance
/ Install and set up in a few minutes / Integrated backup/restore and data integrity checks / Efficient failover operations / Distributed, rule-driven management / No/minimal application changes / Highly pluggable / No specialized hardware requirements
© Continuent 2010
What’s Inside Tungsten?
/ Replication - Making copies • Tungsten Replicator -- Database-neutral, platform independent
master/slave replication
/ Connectivity -- Finding databases • Tungsten Connector -- Fast MySQL/PostgreSQL client to JDBC
proxying • Tungsten SQL Router --JDBC wrapper for high-performance and
transparent failover, load-balancing, and partitioning (no proxy required)
/ Management -- Administering the database • Tungsten Manager -- Distributed administration with autonomic,
rule-based configuration and no single point of failure • Tungsten Monitor -- Track resource status and database liveness
© Continuent 2010
Management Client
Management Client
Replicator
Monitor
Manager
Replicator
Monitor
Manager
Application Server
SQL Router/Connector Manager
Application Server
SQL Router/Connector Manager
© Continuent 2010
Multiple Routes to Databases Java App Server Tungsten SQL Router
PHP Application
Tungsten Connector
libpq.a
Tungsten Cluster
PostgreSQL JDBC Driver
© Continuent 2010
Tungsten on Open Source Databases
/ MySQL 5.0/5.1 • Read and replicate from MySQL binlog • Works with Oracle, MySQL and look-alikes (Percona, MariaDB)
/ PostgreSQL < 9 • Warm Standby + WAL Shipping • Good basic availability/fast failover • Slaves open up for reads only after failover
/ PostgreSQL >= 9 • Hot Standby + Streaming Replication • Slaves opened up for reads = Tungsten scaling facilities work • Add Streaming Replication = minimal delay in replicating data
/ Sometime in the future: Read PG logs directly!
© Continuent 2010
/ 15 minute cluster installation / Single commands to:
• View cluster status • Provision a new standby • Confirm liveness of replication • Switch servers safely for maintenance • Failover a dead server to most current replica
/ Automatic discovery of new replicas / Automatic failover when databases fail / Simple procedures for provisioning / Transparent application routing / Easy scaling
Tungsten Added Value
© Continuent 2010
© Continuent 2010
Distributed Rule-Based Management
Manager (Coordinator)
Manager
Manager Admin Client
Admin Client
Admin Client
© Continuent 2010
/ Tungsten Manager processes connect to each other via Group Communications protocol
/ Group Communications provide essential features for running multi-node environments:
• Membership detection • Notification about joined/left/crashed members • Reliable message broadcast (lost messages retransmitted) • Ordered message broadcast (all members receive
messages in the same order)
/ Different transport protocols can be used • IP Multicast – for open local networks • Peer to Peer TCP – for firewalled local networks • Centralized Gossip Server – for Cloud environments
Group Communications in Clustering
© Continuent 2010
/ Trivial Rule:
/ Example (pseudo code):
What is a Rule?
© Continuent 2010
What is a Rule Engine?
© Continuent 2010
How does the Rule Engine Work? Application with a Rule
Engine (Tungsten Manager)
© Continuent 2010
How does the Rule Engine get its Facts?
Tungsten Manager
Tungsten Monitor
Tungsten Replicator
© Continuent 2010
/ Only one Coordinator for a group (cluster) • Only one Manager must act on important events like
failures • Having more than one Coordinator would lead to race
conditions and eventually chaotic cluster behavior
/ Tungsten chooses Coordinator from the Group Communications
• Coordinator is the oldest member of the group • New members handshake with the Coordinator when
joining • Upon Coordinator death, GC automatically promotes a
new one
Who is The Coordinator?
© Continuent 2010
© Continuent 2010
© Continuent 2010
/ Lower level rules react on events from • Database servers • Replicators • Managers
/ Outcome: the state change of a concept “data source”
The Rules are “Layered”
/ Higher level rules react on • Data source state changes
/ Outcome: actual operations to the cluster components (eg. promote slave to a master)
© Continuent 2010
Scenario: Database Crashes / Failover is handled by a controlled chain reaction of
rules rather than a single rule: 1. "DETECT AND FENCE FAILED DATASERVER" rule
detects state transition of the master DB from ONLINE to STOPPED It then 'fences' the failure by setting the data source of the stopped
DB server to FAILED
2. "AUTOMATIC FAILOVER" rule fires, because DataSource(state == ResourceState.FAILED && role == "master”)
It then calls a method in the ClusterManagementHelper to do the actual failover, after which it refreshes the data source states
i If the data source was of a slave, it would stay in the FAILED state and no further action would take place
© Continuent 2010
© Continuent 2010
© Continuent 2010
/ Business Rules are a very powerful and flexible tool for automating otherwise complex tasks
/ They are especially useful in implementing automated DB clusters
/ A robust top layer connecting all the components underneath into a seamless experience
Conclusion
© Continuent 2010
© Continuent 2010
© Continuent 2010
HQ and Americas 560 S. Winchester Blvd., Suite 500 San Jose, CA 95128 Tel (866) 998-3642 Fax (408) 668-1009
e-mail: [email protected], [email protected]
EMEA and APAC Lars Sonckin kaari 16 02600 Espoo, Finland Tel +358 50 517 9059 Fax +358 9 863 0060
Continuent Web Site: http://www.continuent.com