はじめに GMOペパボ Advent Calendar 2017の15日目の記事です。 昨日の担当は@kurotakyさんによる RubyでBancor protocolのシミュレーションをするライブラリ"Bancor"を作っています - mo-fu note でした。 ブロックチェーン技術や仮想通貨はだいぶ前から話題になっていますが、それに関連した面白そうな取り組みをしているようなので、興味のある方はぜひご覧下さい。 さて、今回はMySQLのレプリケーションについて書いていこうと思います。 なぜMySQLの話なのか? 私のTwitterアカウントを見ている人ならご存知かもしれませんが、ここ数ヶ月ほぼMySQL(とカレー🍛)のことしかツイートしていないくらいにはMySQLを触っていたからです。 最近、MySQLをアップグレードするためだけに生きてるみたいなところがある— ぱ (@purp
How to Set Up Asynchronous Replication from Galera Cluster to Standalone MySQL server with GTID Hybrid replication, i.e. combining Galera and asynchronous MySQL replication in the same setup, became much easier since GTID got introduced in MySQL 5.6. Although it was fairly straightforward to replicate from a standalone MySQL server to a Galera Cluster, doing it the other way round (Galera → standa
Galera replication for MySQL brings not only the new, great features to our ecosystem, but also introduces completely new maintenance techniques. Are you concerned about adding such new complexity to your MySQL environment? Perhaps that concern is unnecessarily. I am going to present here some simple tips that hopefully will let fresh Galera users prevent headaches when there is the need to recove
SSHで暗号化された通信経路でMySQLの準同期レプリケーションを行うための方法を紹介します。今回使用したMySQLのバージョンは5.5.30です。 1. マスタとスレーブと間でSSH経由で通信ができるようにする レプリケーションの設定に入る前に、マスタDBがあるサーバー(以降、マスタと表記)とそのレプリケーション先のDBがあるサーバー(以降、スレーブと表記)の間の通信がちゃんとできるか確認しましよう。 ------- スレーブでやること ---------- まず、以下のコマンドを実行してSSHポートフォワーディングによってスレーブの10000ポートからマスタの3306ポートにアクセスできるようにします。 ssh -f -N -C -L 10000:localhost:3306 user01@master.tamurasouko.com -p 22 上記のコマンドで下図のようなポートフォ
#経緯 とある勉強会の内容の復習&整理 #タイトル インストール・アーキテクチャ基礎編 レプリケーション編 ←今回はこちら バックアップ編 チューニング基礎編 #レプリケーション編 アジェンダ レプリケーションとは レプリケーションの仕組み レプリケーションの種類 レプリケーションの設定方法 バイナリログの管理方法 その他の考慮事項 参考情報 #1. レプリケーションとは ##1.1. 基礎知識 データの複製(レプリカ)を別のサーバにモテる機能 MySQLの標準機能で、多数のWebサイト等で利用されている - シンプルな設定で利用可能 - マスター → スレーブ構成 ##1.2. マスタースレーブ構成 サーバはマスター、スレーブまたは両方になれる マスターサーバ - データを変更 - 変更内容をスレーブに転送 - マスターは複数のスレーブを持てる スレーブサーバ - マスターでの変更内容を
要件 レプリケーションについて調べていたら脱線してレプリケーションを SSL 対応させてみた 構成 以下のような感じ。 インターネットを介して二台のサーバーで稼働している MySQL にてレプリケーションを行う。その際に SSL で通信を暗号化する。 手順 MySQL SSL 対応確認、設定 こちら を参考にマスター、スレーブともに MySQL を SSL 対応しておく スレーブ側も必要かは要確認 レプリケーションユーザー作成 マスター側のにレプリケーション用のユーザーを作成する。このときに注意するのは REQUIRE SSL オプション。 GRANT REPLICATION SLAVE ON *.* TO ${repl_user}@${slave_ip} IDENTIFIED BY '${your_password}' REQUIRE SSL; FLUSH PRIVILEGES; マスタ
経緯 一つの開発用サーバでmysqlのreplicationを利用したscriptを作成しなくてはならなくなり、戦友:id:maroekunから教えてもらった mysqld_multiを利用してみることにした。 mysqld_multiとは MySQL MySQL 4.1 リファレンスマニュアル 4.8.3 mysqld_multi(複数の MySQL サーバを管理するプログラム) mysqld_multi は、さまざまな Unix ソケットおよび TCP/IP ポートをリッスンする複数の mysqld プロセスを管理するためのプログラムです。 ようは、一つのmysqld で複数プロセスを立ち上げることができます。 もちろん、複数プロセス間でreplicationを取ることも可能です。 設定 /etc/my.cnf の設定はこんな感じです [mysqld_multi] mysqld = /
レプリケーションとは、あるデータベースから他のデータベースに複製を作ることです。 これは通常、以下のような理由から使われます。 サーバがダウンしたときの対処 複数のデータベースが同じ内容を持つことで、一つのサーバがダウンしても 他のサーバを使うことが可能になります。 負荷分散 複数のデータベースを交互にアクセスすることで、一つのサーバに掛かる負担を減らすことが出来ます。 MySQLでは「一方向レプリケーション」を採用しています。 一つのサーバを「マスタ」として機能させ、残りのサーバが「スレーブ」になります。 データの複製は「マスタ→スレーブ」という方向でのみ行われます。 そのため、データの更新は必ずマスタサーバで実行する必要があります。 マスタサーバで更新を行うと、その更新内容が全てのスレーブサーバに通知され スレーブサーバはマスタサーバと同じ更新処理を行います。これにより、マスタとスレー
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く