-
Notifications
You must be signed in to change notification settings - Fork 794
changes required to enable replication #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e5e618f
ccc5aac
4884ea4
08577a9
6ea10b0
64b58ff
4c5a365
ffb3572
4ffae00
bed0844
9d61ee4
405d7de
59d5e76
56416d8
52bb3ce
d8b274a
1809705
60fed07
54d68b8
8392226
fe805e4
a9a45df
5419f4c
cd39914
d8cc8ff
4fb1d88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
class mysql::server::replication { | ||
$master_slave = $mysql::server::master_slave | ||
$server_id = $mysql::server::rep_server_id | ||
|
||
if $mysql::server::replication_enable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make the inclusion of the replication class optional in the |
||
|
||
exec { 'install-replication-plugin': | ||
command => "mysql -u root -e \"INSTALL PLUGIN rpl_semi_sync_${mysql::server::master_slave} SONAME 'semisync_${mysql::server::master_slave}.so';\"", | ||
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', | ||
onlyif => 'test `grep -c rpl_semi_sync /usr/my.cnf` != 1', | ||
} | ||
|
||
ini_setting { 'server-id': | ||
ensure => present, | ||
path => '/usr/my.cnf', | ||
section => 'mysqld', | ||
setting => 'server-id', | ||
value => $server_id, | ||
require => Exec['install-replication-plugin'], | ||
notify => Exec['restart-service'], | ||
} | ||
|
||
ini_setting { 'rpl_semi_sync_master': | ||
ensure => present, | ||
path => '/usr/my.cnf', | ||
section => 'mysqld', | ||
setting => "rpl_semi_sync_${master_slave}_enabled", | ||
value => '1', | ||
require => Exec['install-replication-plugin'], | ||
notify => Exec['restart-service'], | ||
} | ||
|
||
exec { 'restart-service': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please match this to the pattern of https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/server/installdb.pp#L26-L30 to make this work together with the rest of the module across all platforms. |
||
command => '/etc/init.d/mysql restart', | ||
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', | ||
refreshonly => true, | ||
} | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/params.pp has a variable for where the my.cnf file is located. Please use that instead of hardcoding a single location.