問題
- どの種類の更新トランザクションも機能せず、ユーザーはポータルで Web コンテンツやファイルなどを作成/更新できません。
- Liferay サービスのログには、
java.sql.SQLException に関するいくつかのエラーがあります。MySQL サーバーは --read-only オプションで実行されているため、このステートメントを実行できません
例:Apr 28 09:26:22.890 build-1546 [liferay-7b56457799-c9gtg] org.quartz.JobPersistenceException: Failure updating scheduler state when checking-in: The MySQL server is running with the --read-only option so it cannot execute this statement [See nested exception: java.sql.SQLException: The MySQL server is running with the --read-only option so it cannot execute this statement] at org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterCheckIn(JobStoreSupport.java:3393) at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3240) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3857) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3894) Caused by: java.sql.SQLException: The MySQL server is running with the --read-only option so it cannot execute this statement at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955) at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1094) at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1042) at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1345) at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1027) at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.updateSchedulerState(StdJDBCDelegate.java:2930) at org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterCheckIn(JobStoreSupport.java:3387) ... 3 more
Environment
- Liferay Cloud プロジェクト
解決策
DB で発生した読み取り専用エラーは、Cloud SQL の従来の HA モードの問題に関連しています。 Cloud SQL は、さまざまなチェックポイントを使用してマスター インスタンスの可用性をチェックし、インスタンスが正常であるかどうかを確認します。特に、そのうちの 1 つはディスクの書き込み可能性です。書き込み可能性のためにマスターが正常でない場合、トラフィックはフェイルオーバー レプリカにルーティングされ、DB の状態が「読み取り専用」になります。
長期的な解決策は、明示的なフェイルオーバー レプリカを使用しない HA モードを設定することです。
新しい HA レプリケーション モードには、レプリケーション パフォーマンスの向上など、いくつかの追加の利点があり、お客様にとってコストへの影響はありません。
Liferay チームはお客様と協力して、この移行を実行するための詳細なパスを提供します。 その間、動作が発生した場合 推奨される回避策は Liferay サービスを再起動することです。
追加情報