legacy-knowledge-base
公開されました Jul. 2, 2025

コンテンツを更新できません: MySQL サーバーが --read-only オプションで実行されています

written-by

Jose Jimenez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • どの種類の更新トランザクションも機能せず、ユーザーはポータルで 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 サービスを再起動することです。


追加情報

ヘルプ センターでチケットを開いて、サポート サービスにお問い合わせください。

https://status.liferay.cloud件の の更新を確認してください

did-this-article-resolve-your-issue

legacy-knowledge-base