Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cybozu-neco committed Aug 5, 2024
1 parent db2d791 commit 8985703
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
19 changes: 19 additions & 0 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ <h2 id="installing-manually"><a class="header" href="#installing-manually">Insta
<li><a href="usage.html#upgrading-mysql-version">Upgrading mysql version</a></li>
<li><a href="usage.html#re-initializing-an-errant-replica">Re-initializing an errant replica</a></li>
<li><a href="usage.html#stop-clustering-and-reconciliation">Stop Clustering and Reconciliation</a></li>
<li><a href="usage.html#set-to-read-only">Set to Read Only</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -1048,6 +1049,24 @@ <h3 id="stop-clustering-and-reconciliation"><a class="header" href="#stop-cluste
moco_cluster_ready_replicas{name="test",namespace="default"} NaN
moco_cluster_errant_replicas{name="test",namespace="default"} NaN
</code></pre>
<h3 id="set-to-read-only"><a class="header" href="#set-to-read-only">Set to Read Only</a></h3>
<p>When you want to set MOCO's MySQL to read-only, use the the following commands.</p>
<p>MOCO makes the primary instance writable in the clustering process.
Therefore, please be sure to stop clustering when you set it to read-only.</p>
<pre><code class="language-console">$ kubectl moco stop clustering &lt;CLSUTER_NAME&gt;
$ kubectl moco mysql -u moco-admin &lt;CLSUTER_NAME&gt; -- -e "SET GLOBAL super_read_only=1"
</code></pre>
<p>You can check whether the cluster is read-only with the following command.</p>
<pre><code class="language-console">$ kubectl moco mysql -it &lt;CLSUTER_NAME&gt; -- -e "SELECT @@super_read_only"
+-------------------+
| @@super_read_only |
+-------------------+
| 1 |
+-------------------+
</code></pre>
<p>If you want to leave read-only mode, restart clustering as follows. Then, MOCO will make the cluster writable.</p>
<pre><code class="language-console">$ kubectl moco start clustering &lt;CLSUTER_NAME&gt;
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="advanced-topics"><a class="header" href="#advanced-topics">Advanced topics</a></h1>
<div style="break-before: page; page-break-before: always;"></div><h1 id="building-custom-image-of-mysqld"><a class="header" href="#building-custom-image-of-mysqld">Building custom image of <code>mysqld</code></a></h1>
<p>There are pre-built <code>mysqld</code> container images for MOCO on <a href="https://github.com/cybozu-go/moco/pkgs/container/moco%2Fmysql"><code>ghcr.io/cybozu-go/moco/mysql</code></a>.
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ <h1 id="how-to-use-moco"><a class="header" href="#how-to-use-moco">How to use MO
<li><a href="#upgrading-mysql-version">Upgrading mysql version</a></li>
<li><a href="#re-initializing-an-errant-replica">Re-initializing an errant replica</a></li>
<li><a href="#stop-clustering-and-reconciliation">Stop Clustering and Reconciliation</a></li>
<li><a href="#set-to-read-only">Set to Read Only</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -827,6 +828,24 @@ <h3 id="stop-clustering-and-reconciliation"><a class="header" href="#stop-cluste
moco_cluster_healthy{name="test",namespace="default"} NaN
moco_cluster_ready_replicas{name="test",namespace="default"} NaN
moco_cluster_errant_replicas{name="test",namespace="default"} NaN
</code></pre>
<h3 id="set-to-read-only"><a class="header" href="#set-to-read-only">Set to Read Only</a></h3>
<p>When you want to set MOCO's MySQL to read-only, use the the following commands.</p>
<p>MOCO makes the primary instance writable in the clustering process.
Therefore, please be sure to stop clustering when you set it to read-only.</p>
<pre><code class="language-console">$ kubectl moco stop clustering &lt;CLSUTER_NAME&gt;
$ kubectl moco mysql -u moco-admin &lt;CLSUTER_NAME&gt; -- -e "SET GLOBAL super_read_only=1"
</code></pre>
<p>You can check whether the cluster is read-only with the following command.</p>
<pre><code class="language-console">$ kubectl moco mysql -it &lt;CLSUTER_NAME&gt; -- -e "SELECT @@super_read_only"
+-------------------+
| @@super_read_only |
+-------------------+
| 1 |
+-------------------+
</code></pre>
<p>If you want to leave read-only mode, restart clustering as follows. Then, MOCO will make the cluster writable.</p>
<pre><code class="language-console">$ kubectl moco start clustering &lt;CLSUTER_NAME&gt;
</code></pre>

</main>
Expand Down

0 comments on commit 8985703

Please sign in to comment.