Skip to content

Commit

Permalink
Deployed a8ed3fa to 8.4 with MkDocs 1.6.1 and mike 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Action committed Jan 15, 2025
1 parent f930428 commit 0c32ff7
Show file tree
Hide file tree
Showing 6 changed files with 361 additions and 404 deletions.
94 changes: 49 additions & 45 deletions 8.4/load-balance-proxysql.html
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,9 @@ <h1 id="load-balance-with-proxysql">Load balance with ProxySQL<a class="headerli
of a crash to minimize downtime.</p>
<p>The daemon accepts incoming traffic from MySQL clients and forwards it to
backend MySQL servers.</p>
<p>The proxy is designed to run continuously without needing to be restarted. Most
<p>The proxy is designed to run continuously without needing to be restarted. Most
configuration can be done at runtime using queries similar to SQL statements in
the ProxySQL admin interface. These include runtime parameters, server
the ProxySQL admin interface. These include runtime parameters, server
grouping, and traffic-related settings.</p>
<div class="admonition admonition">
<p class="admonition-title">See also</p>
Expand All @@ -2320,7 +2320,7 @@ <h1 id="load-balance-with-proxysql">Load balance with ProxySQL<a class="headerli
<code>proxysql-admin</code> tool does not require any custom scripts to keep track of Percona XtraDB Cluster status.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>In version 8.4, Percona XtraDB Cluster does not support ProxySQL v1. </p>
<p>In version 8.4, Percona XtraDB Cluster does not support ProxySQL v1.</p>
</div>
<h2 id="manual-configuration">Manual configuration<a class="headerlink" href="#manual-configuration" title="Permanent link">&para;</a></h2>
<p>This section describes how to configure ProxySQL with three Percona XtraDB Cluster nodes.</p>
Expand Down Expand Up @@ -2363,7 +2363,7 @@ <h2 id="manual-configuration">Manual configuration<a class="headerlink" href="#m
or install the client on Node 4 and connect locally.
For this tutorial, install Percona XtraDB Cluster on Node 4:</p>
<p><strong>Changes in the installation procedure</strong></p>
<p>In Percona XtraDB Cluster 8.4, ProxySQL is not installed automatically as a dependency of the <code>percona-xtradb-cluster-client-8.0</code> package. You should install the <code>proxysql</code> package separately.</p>
<p>In Percona XtraDB Cluster 8.4, ProxySQL is not installed automatically as a dependency of the <code>percona-xtradb-cluster-client-8.4</code> package. You should install the <code>proxysql</code> package separately.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>ProxySQL has multiple versions in the version 2 series.</p>
Expand Down Expand Up @@ -2506,9 +2506,14 @@ <h3 id="create-proxysql-monitoring-user">Create ProxySQL monitoring user<a class
<p>To enable monitoring of Percona XtraDB Cluster nodes in ProxySQL,
create a user with <code>USAGE</code> privilege on any node in the cluster
and configure the user in ProxySQL.</p>
<p>The following example shows how to add a monitoring user on Node 2:</p>
<p>The following example shows how to add a monitoring user on Node 2 if you are using the depreated<code>mysql_native_password</code> authentication method:</p>
<div class="highlight" data-prompt="mysql@pxc2>"><pre><span></span><code>mysql@pxc2&gt;<span class="w"> </span>CREATE<span class="w"> </span>USER<span class="w"> </span><span class="s1">&#39;proxysql&#39;</span>@<span class="s1">&#39;%&#39;</span><span class="w"> </span>IDENTIFIED<span class="w"> </span>WITH<span class="w"> </span>mysql_native_password<span class="w"> </span>by<span class="w"> </span><span class="s1">&#39;$3Kr$t&#39;</span><span class="p">;</span>
mysql@pxc2&gt;<span class="w"> </span>GRANT<span class="w"> </span>USAGE<span class="w"> </span>ON<span class="w"> </span>*.*<span class="w"> </span>TO<span class="w"> </span><span class="s1">&#39;proxysql&#39;</span>@<span class="s1">&#39;%&#39;</span><span class="p">;</span>
</code></pre></div>
<p>The following example adds a monitoring user on Node 2 if you are using the <code>caching_sha2_password</code> authentication method:</p>
<div class="highlight" data-prompt="mysql@pxc2>"><pre><span></span><code>mysql@pxc2&gt;<span class="w"> </span>CREATE<span class="w"> </span>USER<span class="w"> </span><span class="s1">&#39;proxysql&#39;</span>@<span class="s1">&#39;%&#39;</span><span class="w"> </span>IDENTIFIED<span class="w"> </span>WITH<span class="w"> </span>caching_sha2_password<span class="w"> </span>by<span class="w"> </span><span class="s1">&#39;$3Kr$t&#39;</span><span class="p">;</span>
</code></pre></div>
<p>Grant the user account privileges:</p>
<div class="highlight" data-prompt="mysql@pxc2>"><pre><span></span><code>mysql@pxc2&gt;<span class="w"> </span>GRANT<span class="w"> </span>USAGE<span class="w"> </span>ON<span class="w"> </span>*.*<span class="w"> </span>TO<span class="w"> </span><span class="s1">&#39;proxysql&#39;</span>@<span class="s1">&#39;%&#39;</span><span class="p">;</span>
</code></pre></div>
<p>The following example shows how to configure this user on the ProxySQL node:</p>
<div class="highlight" data-prompt="mysql@proxysql>"><pre><span></span><code>mysql@proxysql&gt;<span class="w"> </span>UPDATE<span class="w"> </span>global_variables<span class="w"> </span>SET<span class="w"> </span><span class="nv">variable_value</span><span class="o">=</span><span class="s1">&#39;proxysql&#39;</span>
Expand Down Expand Up @@ -2635,32 +2640,30 @@ <h3 id="test-cluster-with-sysbench">Test cluster with sysbench<a class="headerli
<p><code>sysbench</code> requires ProxySQL client user credentials that you created in Creating ProxySQL Client User.</p>
</div>
<ol>
<li>
<p>Create the database that will be used for testing on one of the Percona XtraDB Cluster nodes:</p>
<li>Create the database that will be used for testing on one of the Percona XtraDB Cluster nodes:</li>
</ol>
<div class="highlight" data-prompt="mysql@pxc1>"><pre><span></span><code>mysql@pxc1&gt;<span class="w"> </span>CREATE<span class="w"> </span>DATABASE<span class="w"> </span>sbtest<span class="p">;</span>
</code></pre></div>
</li>
<li>
<p>Populate the table with data for the benchmark on the ProxySQL node:</p>
<ol>
<li>Populate the table with data for the benchmark on the ProxySQL node:</li>
</ol>
<div class="highlight" data-prompt="root@proxysql:~#"><pre><span></span><code>root@proxysql:~#<span class="w"> </span>sysbench<span class="w"> </span>--report-interval<span class="o">=</span><span class="m">5</span><span class="w"> </span>--num-threads<span class="o">=</span><span class="m">4</span><span class="w"> </span><span class="se">\</span>
--num-requests<span class="o">=</span><span class="m">0</span><span class="w"> </span>--max-time<span class="o">=</span><span class="m">20</span><span class="w"> </span><span class="se">\</span>
--test<span class="o">=</span>/usr/share/doc/sysbench/tests/db/oltp.lua<span class="w"> </span><span class="se">\</span>
--mysql-user<span class="o">=</span><span class="s1">&#39;sbuser&#39;</span><span class="w"> </span>--mysql-password<span class="o">=</span><span class="s1">&#39;sbpass&#39;</span><span class="w"> </span><span class="se">\</span>
--oltp-table-size<span class="o">=</span><span class="m">10000</span><span class="w"> </span>--mysql-host<span class="o">=</span><span class="m">127</span>.0.0.1<span class="w"> </span>--mysql-port<span class="o">=</span><span class="m">6033</span><span class="w"> </span><span class="se">\</span>
prepare
</code></pre></div>
</li>
<li>
<p>Run the benchmark on the ProxySQL node:</p>
<ol>
<li>Run the benchmark on the ProxySQL node:</li>
</ol>
<div class="highlight" data-prompt="root@proxysql:~#"><pre><span></span><code>root@proxysql:~#<span class="w"> </span>sysbench<span class="w"> </span>--report-interval<span class="o">=</span><span class="m">5</span><span class="w"> </span>--num-threads<span class="o">=</span><span class="m">4</span><span class="w"> </span><span class="se">\</span>
--num-requests<span class="o">=</span><span class="m">0</span><span class="w"> </span>--max-time<span class="o">=</span><span class="m">20</span><span class="w"> </span><span class="se">\</span>
--test<span class="o">=</span>/usr/share/doc/sysbench/tests/db/oltp.lua<span class="w"> </span><span class="se">\</span>
--mysql-user<span class="o">=</span><span class="s1">&#39;sbuser&#39;</span><span class="w"> </span>--mysql-password<span class="o">=</span><span class="s1">&#39;sbpass&#39;</span><span class="w"> </span><span class="se">\</span>
--oltp-table-size<span class="o">=</span><span class="m">10000</span><span class="w"> </span>--mysql-host<span class="o">=</span><span class="m">127</span>.0.0.1<span class="w"> </span>--mysql-port<span class="o">=</span><span class="m">6033</span><span class="w"> </span><span class="se">\</span>
run
</code></pre></div>
</li>
</ol>
<p>ProxySQL stores collected data in the <code>stats</code> schema:</p>
<div class="highlight" data-prompt="mysql@proxysql>"><pre><span></span><code>mysql@proxysql&gt;<span class="w"> </span>SHOW<span class="w"> </span>TABLES<span class="w"> </span>FROM<span class="w"> </span>stats<span class="p">;</span>
</code></pre></div>
Expand Down Expand Up @@ -2781,45 +2784,46 @@ <h2 id="assisted-maintenance-mode">Assisted maintenance mode<a class="headerlink
<ul>
<li>
<p><code>DISABLED</code>: This value is the default state
that tells ProxySQL to route traffic to the node as usual.</p>
that tells ProxySQL to route traffic to the node as usual.</p>
</li>
<li>
<p><code>SHUTDOWN</code>: This state is set automatically when you initiate node shutdown.</p>
<p>You may need to shut down a node when upgrading the OS, adding resources,
changing hardware parts, relocating the server, etc.</p>
<p>When you initiate node shutdown, Percona XtraDB Cluster does not send the signal immediately.
Intead, it changes the state to <code>pxc_maint_mode=SHUTDOWN</code>
and waits for a predefined period (10 seconds by default).
When ProxySQL detects that the mode is set to <code>SHUTDOWN</code>,
it changes the status of this node to <code>OFFLINE_SOFT</code>. This status stops creating new node connections.
After the transition period, long-running active transactions are aborted.</p>
</li>
</ul>
<p>You may need to shut down a node when upgrading the OS, adding resources,
changing hardware parts, relocating the server, etc.</p>
<p>When you initiate node shutdown, Percona XtraDB Cluster does not initiate the server shutdown process immediately.
Intead, it changes the state to <code>pxc_maint_mode=SHUTDOWN</code>
and waits for a predefined period (10 seconds by default).
When ProxySQL detects that the mode is set to <code>SHUTDOWN</code>,
it changes the status of this node to <code>OFFLINE_SOFT</code>. This status stops creating new node connections.
After the transition period, long-running active transactions are aborted.</p>
<ul>
<li>
<p><code>MAINTENANCE</code>: You can change to this state
if you need to perform maintenance on a node without shutting it down.</p>
if you need to perform maintenance on a node without shutting it down.</p>
<p>You may need to isolate the node for a specific time
so that it does not receive traffic from ProxySQL
while you resize the buffer pool, truncate the undo log,
defragment, or check disks, etc.</p>
so that it does not receive traffic from ProxySQL
while you resize the buffer pool, truncate the undo log,
defragment, or check disks, etc.</p>
<p>To do this, manually set <code>pxc_maint_mode=MAINTENANCE</code>.
Control is not returned to the user for a predefined period
(10 seconds by default). You can increase the transition period
using the <code>pxc_maint_transition_period</code> variable
to accommodate long-running transactions.
If the period is long enough for all transactions to finish,
there should be little disruption in the cluster workload. If you increase
the transition period, the packaging script may determine the wait as a server stall.</p>
Control is not returned to the user for a predefined period
(10 seconds by default). You can increase the transition period
using the <code>pxc_maint_transition_period</code> variable
to accommodate long-running transactions.
If the period is long enough for all transactions to finish,
there should be little disruption in the cluster workload. If you increase
the transition period, the packaging script may determine the wait as a server stall.</p>
<p>When ProxySQL detects that the mode is set to <code>MAINTENANCE</code>,
it stops routing traffic to the node. During the transition period,
any existing connections continue, but ProxySQL avoids opening new connections and starting transactions.
Still, the user can open connections to monitor status.</p>
it stops routing traffic to the node. During the transition period,
any existing connections continue, but ProxySQL avoids opening new connections and starting transactions.
Still, the user can open connections to monitor status.</p>
<p>Once control is returned, you can perform maintenance activity.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Data changes continue to be replicated across the cluster.</p>
</div>
<p>!!! note</p>
<div class="highlight"><pre><span></span><code> Data changes continue to be replicated across the cluster.
</code></pre></div>
<p>After you finish maintenance, set the mode back to <code>DISABLED</code>.
When ProxySQL detects this, it starts routing traffic to the node again.</p>
When ProxySQL detects this, it starts routing traffic to the node again.</p>
</li>
</ul>
<p><strong>Related sections</strong></p>
Expand All @@ -2839,7 +2843,7 @@ <h2 class="title" id="get-expert-help">Get expert help<a class="headerlink" href
<small>

Last update:
2024-12-18
2025-01-15

</small>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 8.4/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 0c32ff7

Please sign in to comment.