|
11 | 11 | * [Customize configuration](#create-custom-configuration)
|
12 | 12 | * [Work with an existing server](#work-with-an-existing-server)
|
13 | 13 | * [Specify passwords](#specify-passwords)
|
| 14 | + * [Install Percona server on Centos](#install-percona-server-on-centos) |
14 | 15 | 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
|
15 | 16 | 5. [Limitations - OS compatibility, etc.](#limitations)
|
16 | 17 | 6. [Development - Guide for contributing to the module](#development)
|
@@ -166,6 +167,78 @@ mysql::db { 'mydb':
|
166 | 167 | }
|
167 | 168 | ```
|
168 | 169 |
|
| 170 | +### Install Percona server on Centos |
| 171 | + |
| 172 | +This example shows how to do a minimal installation of a Percona server on a |
| 173 | +Centos (has been tested on Puppet 4.4 / Centos 7 / Percona Server 5.7) |
| 174 | +including the Percona server, client and bindingsi (including perl and python ones). |
| 175 | + |
| 176 | +Of course, you will probably want to customize it a bit more. and update the |
| 177 | +version to the one you will want to have (trying to keep a coherence between |
| 178 | +those) |
| 179 | + |
| 180 | +**Note:** The installation of the yum repository is not part of this package |
| 181 | +and is here only to show a full example of how you can install this. |
| 182 | + |
| 183 | +```puppet |
| 184 | +yumrepo { 'percona': |
| 185 | + descr => 'CentOS $releasever - Percona', |
| 186 | + baseurl => 'http://repo.percona.com/centos/$releasever/os/$basearch/', |
| 187 | + gpgkey => 'http://www.percona.com/downloads/percona-release/RPM-GPG-KEY-percona', |
| 188 | + enabled => 1, |
| 189 | + gpgcheck => 1, |
| 190 | +} |
| 191 | +
|
| 192 | +class {'mysql::server': |
| 193 | + package_name => 'Percona-Server-server-57', |
| 194 | + package_ensure => '5.7.11-4.1.el7', |
| 195 | + service_name => 'mysql', |
| 196 | + config_file => '/etc/my.cnf', |
| 197 | + includedir => '/etc/my.cnf.d', |
| 198 | + root_password => 'PutYourOwnPwdHere', |
| 199 | + override_options => { |
| 200 | + mysqld => { |
| 201 | + log-error => '/var/log/mysqld.log', |
| 202 | + pid-file => '/var/run/mysqld/mysqld.pid', |
| 203 | + }, |
| 204 | + mysqld_safe => { |
| 205 | + log-error => '/var/log/mysqld.log', |
| 206 | + }, |
| 207 | + } |
| 208 | +} |
| 209 | +
|
| 210 | +# Note: this is not needed in our case as installing Percona-Server-server-57 |
| 211 | +# also installs Percona-Server-client-57. It is only here to show how to |
| 212 | +# install the Percona MySQL client |
| 213 | +class {'mysql::client': |
| 214 | + package_name => 'Percona-Server-client-57', |
| 215 | + package_ensure => '5.7.11-4.1.el7', |
| 216 | +} |
| 217 | +
|
| 218 | +class { 'mysql::bindings': |
| 219 | + client_dev_package_name => 'Percona-Server-shared-57', |
| 220 | + client_dev_package_ensure => '5.7.11-4.1.el7', |
| 221 | + client_dev => true, |
| 222 | + daemon_dev_package_name => 'Percona-Server-devel-57', |
| 223 | + daemon_dev_package_ensure => '5.7.11-4.1.el7', |
| 224 | + daemon_dev => true, |
| 225 | + perl_enable => true, |
| 226 | + perl_package_name => 'perl-DBD-MySQL', |
| 227 | + python_enable => true, |
| 228 | + python_package_name => 'MySQL-python', |
| 229 | +} |
| 230 | +
|
| 231 | +# Dependencies definition |
| 232 | +Yumrepo['percona']-> |
| 233 | +Class['mysql::server'] |
| 234 | +
|
| 235 | +Yumrepo['percona']-> |
| 236 | +Class['mysql::client'] |
| 237 | +
|
| 238 | +Yumrepo['percona']-> |
| 239 | +Class['mysql::bindings'] |
| 240 | +``` |
| 241 | + |
169 | 242 | ## Reference
|
170 | 243 |
|
171 | 244 | ### Classes
|
|
0 commit comments