0
  1. JBOSS を複数のデータベースに接続したい (フェールオーバー リカバリとロード バランシングを使用)。つまり、最初の DB 接続が失敗した場合に、ある DB から別の DB に接続を切り替えます。

  2. また、各 DB 接続には、個別のユーザー ID とパスワードのセットがあります。

前半はほぼ終わったけど、後半はまだ途中。

どうすればいいのですか?

4

1 に答える 1

1

That's not how it should be done. It should be done so that there is only one frontend instance where server (here JBoss) connects to, and it sends the actual connection to whichever db instance it sees fit.

The details on how to implement that would depend on the server used. Since you tagged the question with mysql, you might be interested in this tutorial on how to set up such a thing with that.

If you insist on doing it your way, I don't see how for example load balancing would work. How would JBoss know which server has more load? How would you know when you should activate failover?

If you have answers to those questions already, as indicated in your question, there's nothing preventing you from creating regular datasources with different userids and passwords pointing to different databases. I just think that's inherently wrong way to go with this.

于 2013-04-09T06:45:05.773 に答える