This patch provides one of the alternative solution to address the
problem that the error log might grow too large.
Closes-bug: #1812950
Change-Id: If7c0c71492eb30f24cbcc03ca05a67e6ea571f4e
This change adds the config option max_connect_errors for MySQL to this
charm and sets a default of 100.
Commit also includes the inclusion of this (default) config setting in the
unit tests.
Closes-Bug: #1776908
Change-Id: I33b9e29bd64ad8a1fec0edc3dfd657a87648b537
Install a systemd unit override with LimitNOFILE raised to the required
number based on the same calculation the server performs to ensure both
the requested max_connections and table_open_cache values can be met.
The MySQL server does make some attempt to do this itself when started
as root which worked under Xenial, however in Bionic the systemd service
is started as the mysql user with LimitNOFILE=5000. As a result, the
server cannot raise the limit itself and caps max-connections to 4190,
table-open-cache to 200 and logs a warning to that effect:
[Warning] Changed limits: max_connections: 4190 (requested 12000)
More background:
https://www.percona.com/blog/2017/10/12/open_files_limit-mystery/
Change-Id: I25b429cc9b4970e3d7ef39bb9e6d738fe943686f
Closes-Bug: #1905366
Add a NRPE check to monitor the number of threads connected
to the MySQL database, in proportion to the maximum number of connections.
For this check, a nagios user will be created. This user does not have any
permissions set, does not have access to any database and can only connect
from localhost.
Warning and Critical thresholds (in percentage) can be configured.
Add an action to reset nagios's password. This action could only be run
on the leader unit.
Closes-Bug: #1816759
Change-Id: Id35b0331322c2744a9f839b3eb153eed1bc53aac
These options allow tuning the Galera replication to avoid flow control from
slowing down the primary.
Change-Id: Ib275cae0db02e4c8c0a85fcc8cb138b26eb26982
Closes-Bug: 1799622
This patchset implements new relations: "master" and "slave" based
on a common "mysql-async-replication" interface which are used for
the purpose on enabling MySQL asynchronous replication between
multiple Percona XtraDB Clusters.
Change-Id: I94710bff17091516875c81ca769d8078ef5efd10
Closes-Bug: 1776171
The percona-cluster packages have been fixed in the package
repositories and no longer need this option to work around the
duplicate primary key error that this worked around. This patch
removes this option.
Change-Id: I493c64c3167b51399484f6fec75f674bfe53e2fb
Related-Bug: #1366997
Percona-cluster was failing to start when enable-binlogs was set to
True due to missing server_id in the configuration.
Set the server_id to a unique, non-zero, positive number from 1 to
2**32 - 1.
Closes-Bug: #1772947
Change-Id: Id7da6dd8f27e364e0d5244e4ec33ae4645e4ef96
In order to fix bug#1756928 the whole cluster buildup process needed to
be redesigned. The assumptions about what is_bootstrapped and clustered
meant and when to restart on configuration changed needed to be
re-evaluated.
The timing of restarts needed to be protected to avoid collisions.
Only bootstrapped hosts should go in to the
wsrep_cluster_address=gcomm:// setting. Adding or removing units should
be handled gracefully. Starting with a single unit and expanding to a
cluster must work.
This change guarantees mysqld is restarted when the configuration file
changes and meets all the above requirements. As a consequence of the redesign,
the workload status now more accurately reflects the state of the unit.
Charm-helpers sync to bring in distributed_wait fix.
Closes-Bug: #1756308
Closes-Bug: #1756928
Change-Id: I0742e6889b32201806cec6a0b5835e11a8027567
Bionic will ship with Percona XtraDB Cluster 5.7 and a newer
version of Percona XtraBackup; the majority of charm changes
are associated with the use of native mysql{@} units for
bootstrap and startup of mysqld.
Co-Authored-By: James Page <james.page@ubuntu.com>
Change-Id: I50c5642e11393da3bc03de0ef0b9af4c32e9a0c9
In order to support rolling upgrades, OpenStack services
are moving to a trigger driven approach to db upgrade,
involving expand, migrate and contract phases.
This requires that the underlying db supports creation of
such triggers which requires that:
log_bin_trust_function_creators = 1
in the MySQL global configuration.
Change-Id: Id2cf2dd5a0929270229541e6cd488cd1c0d6103e
Closes-Bug: 1750705
Percona-cluster was responding to db and db-admin relations before it
was ready. This led to the error: "WSREP has not yet prepared node for
application use."
This change applies the same gating share-db relation already has to db
and db-admin relations. It also condenses code used in both instances.
This change guarantees the rendered configuration will not
auto-bootstrap for non-leaders. This addresses Bug 1738896.
Closes-Bug: #1742683
Closes-Bug: #1738896
Change-Id: If525595fd109e6a738071a3f016b9c2eabec529e
Inline with the mysql charm, add a tuning-level configuration option
that allows end users to change the configuration profile for PXC.
This option supports three values
safest (default): use configuration options with best data
integrity guarantees.
fast: compromise some data integrity guarantees
to improve performance.
unsafe: pretty much throw away all data integrity
guarantees to maximise performance.
In clustered deployments, 'fast' and 'unsafe' may be appropriate to
use but should be considered carefully before reconfiguration away
from the default 'safest' option.
Right now, this option tweaks the innodb_flush_log_at_trx_commit
value for PXC:
safest (default): 1
fast: 2
unsafe: 0
but should be used for other tuning optimizations that come along
in the future.
Also add direct configuration options for:
innodb-change-buffering
innodb-io-capacity
to allow end users to tweak other performance optimizations that
we can't yet do automatically using charm options.
This commit also includes a resync of charm-helpers, which includes
the fix to flush priviledges after adding grants to resolve bug
1513239.
Change-Id: I7c31e3bfbb825ae7091913e678dd1b7893892d1d
Closes-Bug: 1599222
Closes-Bug: 1513239
Ubuntu 14.04 ships with PXC 5.5, which has a lower default
value for max_connect_errors (10 vs 100); bump this value
inline with later 5.6 release to avoid issues with connections
from clients getting blacklisted due to connection problems.
(NOTE: my.cnf is used on trusty, mysqld.cnf on xenial or later).
Change-Id: I5475c4e1b10cb638d0694c380714c468f8d78d46
Closes-Bug: 1564083
MySQL automatically attempts to resolve hostnames to IP addresses,
mapping to ACL entries for users; this adds overhead for each
connection, and when DNS is wonky in some way can cause access
issues.
Use 'skip-name-resolve' to ensure that only IP addresses are
used with checking ACL's.
Change-Id: Idf55ddc3090da97a96dd0bbc30fc845f65d1692c
Partial-Bug: 1599222
The 5.6 version of mysql defauls to performance_schema=on at server
startup. This allocates all the memory that would be required to
handle max-connections plus several other memory settings.
We occasionally saw connection exhaustion in HA clouds with
max-connections near 2000. The common practice became to set
max-connections unrealistically high near 10k or 20k. In the move to
5.6 on Xenial this became a problem as the memory requirements for
values that high are unrealistic.
This change adds performance schema as a configuration option and
defaults to off giving 5.5 like behavior. It also considerably
updates documentation and highlights the need to carefully consider
memory related configuration settings for production environments.
Make the amulet test python2 and python3 capable.
Change-Id: Id01095ac2f73fa041b25b2602496a4c04a13e3ef
Partial-Bug: #1654086
Closes-Bug: #1600001
This change introduces 'enable-binlogs' and 'binlogs-path' charm
options so that binlogs can be configured through charms. Binlogs
are by default disabled.
Closes-Bug: 1424603
Change-Id: I437170506bbd7013f4884277ff863af2b485046b
For PXC on later Ubuntu releases, the wsrep provider never
actually gets set, resulting in un-clustered configurations.
Add the required wsrep_provider stanza to the mysqld.cnf
template to ensure that we actually deploy clustered PXC
instances when multiple units are used.
Change-Id: Ie0995be5151845382405396b63f404c9ea9a36ed
Closes-Bug: 1572604
Also increases the default for table_open_cache to 2048, as the default
of 512 is a bit too low (and there is no repercussions with using larger
table cache).
Note: table_cache got renamed to table_open_cache in MySQL 5.1.3, but
mysql-common didn't address that. Change is made in the charm now so
that future upgrades (from 5.5 to 5.6) can be smooth.