Skip to content

Conversation

@akuzminsky
Copy link
Member

Summary

  • Implements complete Percona Server configuration management
  • Adds bootstrap integration with ih-mysql CLI from infrahouse-toolkit
  • Configures MySQL with GTID replication settings for master/replica topology

Changes

File Purpose
packages.pp Installs percona-server-server and client
config.pp Configures my.cnf with GTID replication, auto-calculated buffer pool
service.pp Manages MySQL service
bootstrap.pp Calls ih-mysql bootstrap for master election and replica setup
mysqld.cnf.erb MySQL configuration template with GTID settings

Bootstrap Behavior

The ih-mysql bootstrap command (from infrahouse-toolkit) handles:

  • Master election via DynamoDB distributed lock
  • MySQL user creation (repl, backup, monitor) on master only
  • Replica configuration with GTID replication (users replicated automatically)
  • NLB target group registration (write TG for master, read TG for all)

Required Facts

Custom facts in /etc/puppetlabs/facter/facts.d/custom.json:

  • percona.cluster_id - Unique cluster identifier
  • percona.dynamodb_table - DynamoDB table for locking
  • percona.credentials_secret - AWS Secrets Manager secret name
  • percona.vpc_cidr - VPC CIDR for user host restrictions
  • percona.read_tg_arn - Read target group ARN
  • percona.write_tg_arn - Write target group ARN

Test plan

  • Deploy to development environment with 3 EC2 instances
  • Verify first instance becomes master and creates users
  • Verify second/third instances become replicas
  • Verify replication is working (SHOW REPLICA STATUS)
  • Verify target group registrations

Implements complete Percona Server management:
- packages.pp: Installs percona-server-server and client
- config.pp: Configures my.cnf with GTID replication settings
- service.pp: Manages MySQL service
- bootstrap.pp: Calls ih-mysql CLI for master election and replica setup
- mysqld.cnf.erb: MySQL configuration template

Bootstrap uses ih-mysql from infrahouse-toolkit which handles:
- Master election via DynamoDB distributed lock
- MySQL user creation (repl, backup, monitor) on master only
- Replica configuration with GTID replication
- NLB target group registration

Requires custom facts in /etc/puppetlabs/facter/facts.d/custom.json:
- percona.cluster_id
- percona.dynamodb_table
- percona.credentials_secret
- percona.vpc_cidr
- percona.read_tg_arn
- percona.write_tg_arn

Closes #236
@akuzminsky akuzminsky merged commit 9ba5bdb into main Jan 19, 2026
2 checks passed
@akuzminsky akuzminsky deleted the feature/percona-server-config branch January 19, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants