LoginSignup
2
4

More than 5 years have passed since last update.

JDBCドライバでレプリケーションする方法

Posted at

JDBCとは

  • wikipediaにも書いてありますが、Java と関係データベースの接続のためのAPIです。 つまりJavaを使用しているときにデータベースに接続しようと思ったらJDBCを使う必要があるということです。

レプリケーションどうするの

  • 普通にDB接続は出来たのですが、いざレプリケーションをしようと思うと「あれ、これどうやって設定するの」となったので忘れないようにメモしておきます。(公式にガッツリ書いてありますけど笑)

レプリケーション

jdbc:mysql:replication://[master host][:port],[slave host 1][:port][,[slave host 2][:port]]...[/[database]] 

以上でレプリケーションが出来ます!簡単!

ロードバランシング

ついでにロードバランシングの方法も記述しておきます。

jdbc:mysql:loadbalance://[host1][:port],[host2][:port][,[host3][:port]]...[/[database]]

公式

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4