wildfly 10.1 mysql replication second database is read-only exception
I started using Wildfly 10.1 and use mysql as a database. I have two databases, DB1 and DB2. Wildfly will connect to DB2 when D1 disconnected. I've done it so far. But when I connect to DB2, I get a "Connection is read-only" error. I looked at the topic here Database Fail Over in Jboss Data sources but
> <connection-property name = "readOnly"> false </ connection-property>
not resolve. I'm looking for a solution to that. I want master/master not master/slave. In my mysql configuration in standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/RailbaseLabDS" pool-name="RailbaseLabDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://IP1:3306,IP2:3306/DBN?autoreconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<url-delimiter>|</url-delimiter>
<security>
<user-name>DBN</user-name>
<password>DBN</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<background-validation>true</background-validation>
<background-validation-millis>5000</background-validation-millis>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
mysql jboss regression wildfly wildfly-10
add a comment |
I started using Wildfly 10.1 and use mysql as a database. I have two databases, DB1 and DB2. Wildfly will connect to DB2 when D1 disconnected. I've done it so far. But when I connect to DB2, I get a "Connection is read-only" error. I looked at the topic here Database Fail Over in Jboss Data sources but
> <connection-property name = "readOnly"> false </ connection-property>
not resolve. I'm looking for a solution to that. I want master/master not master/slave. In my mysql configuration in standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/RailbaseLabDS" pool-name="RailbaseLabDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://IP1:3306,IP2:3306/DBN?autoreconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<url-delimiter>|</url-delimiter>
<security>
<user-name>DBN</user-name>
<password>DBN</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<background-validation>true</background-validation>
<background-validation-millis>5000</background-validation-millis>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
mysql jboss regression wildfly wildfly-10
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36
add a comment |
I started using Wildfly 10.1 and use mysql as a database. I have two databases, DB1 and DB2. Wildfly will connect to DB2 when D1 disconnected. I've done it so far. But when I connect to DB2, I get a "Connection is read-only" error. I looked at the topic here Database Fail Over in Jboss Data sources but
> <connection-property name = "readOnly"> false </ connection-property>
not resolve. I'm looking for a solution to that. I want master/master not master/slave. In my mysql configuration in standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/RailbaseLabDS" pool-name="RailbaseLabDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://IP1:3306,IP2:3306/DBN?autoreconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<url-delimiter>|</url-delimiter>
<security>
<user-name>DBN</user-name>
<password>DBN</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<background-validation>true</background-validation>
<background-validation-millis>5000</background-validation-millis>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
mysql jboss regression wildfly wildfly-10
I started using Wildfly 10.1 and use mysql as a database. I have two databases, DB1 and DB2. Wildfly will connect to DB2 when D1 disconnected. I've done it so far. But when I connect to DB2, I get a "Connection is read-only" error. I looked at the topic here Database Fail Over in Jboss Data sources but
> <connection-property name = "readOnly"> false </ connection-property>
not resolve. I'm looking for a solution to that. I want master/master not master/slave. In my mysql configuration in standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/RailbaseLabDS" pool-name="RailbaseLabDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://IP1:3306,IP2:3306/DBN?autoreconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<url-delimiter>|</url-delimiter>
<security>
<user-name>DBN</user-name>
<password>DBN</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<background-validation>true</background-validation>
<background-validation-millis>5000</background-validation-millis>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
mysql jboss regression wildfly wildfly-10
mysql jboss regression wildfly wildfly-10
edited Nov 16 '18 at 10:45
user8945079
asked Nov 16 '18 at 6:58
user8945079user8945079
64
64
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36
add a comment |
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53332890%2fwildfly-10-1-mysql-replication-second-database-is-read-only-exception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53332890%2fwildfly-10-1-mysql-replication-second-database-is-read-only-exception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I need emergency help, isn't there anyone who can help?
– user8945079
Nov 19 '18 at 7:34
I found the solution at link. It make the second server access as read/write instead of read-only.
– user8945079
Nov 19 '18 at 11:36