Files
xrpl-dev-portal/content/infrastructure/rippled/troubleshooting/fix-sqlite-tx-db-page-size-issue.ja.md
Rome Reginelli b51bcb4ea3 Information Architecture v3 (#1934)
* Update look up escrows to remove redundant info about lookups via sender/destination. Modify cancel expired escrow for brevity.

* Cancel escrow: fix notes

* Add draft of updated cancel-escrow.js.

* Update intro to escrows.

* Add Escrow Tutorial

* Minor corrections

* Fix headings, add HTML

* Update escrow docs

This commit re-creates f205a92db2 with
some adjustments:

- Omit the accidentally-created dir full of junk
- Fix some typos and one mistake in the Escrow limitations section
- Add a table to the EscrowCreate ref to clarify valid combos of fields.

* Concept info from send-a-time-held-escrow added to escrow.md

* IA: Move "Consensus Network" files

This re-creates some work from the original commit 56fffe0b9f

* Rewrite escrows article (re-created)

This commit re-creates relevant work from the following commits:

9a4a588f2b Update escrow.md context info
e1b017dc83 Remove references to using escrow for interledger payments.

* IA: Move "XRPL servers" files

This re-creates some work from original commit 7611979abf

* IA: move "production readiness" files.

Re-creates work from the following commit:

692438693a  Move tutorials to concepts

* New intro articles

Original commit: 56fffe0b9f

* IA: Reorg account concepts

Re-creates some work from original commit 56fffe0b9f

* IA: reorg transaction concepts

Original commits:
9d4eff9940  WIP - reorg accounts
7611979abf  WIP dir. reorg

* IA: reorg consensus concepts

Original commit: 56fffe0b9f

* IA: Reorg ledger docs

Original commit: 56fffe0b9f

- Rephrased some details of the section

* IA: rename issuing/operational addresses page

Original commit: 56fffe0b9f

* Moving use cases

* Fleshing out Use Cases

Note, the dactyl-config.yml file has not been fully updated.

* Clean up checks conceptual info.

* Remove redundant checks use case section

Original commit: 3c29e9c05e

* IA: move Dex under tokens

Original commit: d08b3ba7d7

* Touch up stablecoin issuer use case (#1856)

* Consolidate stablecoin use case

* Stablecoin issuer: cleanup progress through sending

* Stablecoin issuer: reorg second half

(Note: the dactyl-config.yml is not fully reconciled yet)

* Move rippled and clio tutorials into infrastructure

* Remove link to checks amendement.

* Add note to account_objects.md about commandline interface type field.

* Merge expiration case with lifecycle section.

* Interoperability Use Cases

* Add graphics to intro

* Move escrow use cases to dedicated page.

* Update use case page intros and corresponding concept info.

* Clarify meaning of direct XRP payments.

* Intro link updates

* Payment use cases

* Remove some unnecessary links in transactions section

Original commit: e6fcf4a4dc

* Link cleanup in Tokens section

Original commit: 9588dd5e70

* Touch up 'Configure Peering' section

Original commit: fc8f0990b8

* Clean up links in accounts section

Original commit: 3da5fde7a8

* Add NFT mkt use case

* p2p payments: edits to Wallets

* Clean up payments use cases

* Refine history description

* IA: use case cleanup

* IA: reconcile servers, ledgers sections

* IA: reconcile payment types, tx, tokens

* IA: reconcile accounts section

* IA: reconcile infra

* IA: Fix most broken links

* Full Docs Index: omit from sidebar

* IA: fix up most broken links

* fix Absolute path link to internal content

* Quick updates to Software Ecosystem

* Remove some absolute links to internal resources

* Fix remaining broken links in JA target

* Contributing: tweak formatting

* Tutorials: fix some minor issues

* remove interop use cases

* remove intro image and personal references to dennis

* alphabetize-transaction-nav

* Remove unused files

* Add QS escrow tutorials

* IA: move ledgers, consensus protocol files around

* IA: update nav for new page hierarchy

* reordering of topics under new networks and servers top-nav

* Move "Naming" to "What is XRP?"

* Update dactyl-config.yml

Remove xrp.md from the TOC.

* Update list-xrp-as-an-exchange.md

Update link to what-is-xrp

* Update list-xrp-as-an-exchange.ja.md

Change link to what-is-xrp

* Update currency-formats.md

Change link to what-is-xrp

* Update currency-formats.ja.md

Change link to what-is-xrp

* Update cancel-an-expired-escrow.md

Change link to what-is-xrp

* Update paymentchannelfund.md

Change link to what-is-xml

* Update look-up-escrows.md

Change link to what-is-xrp

* Update tokens.md

change link to what-is-xrp

* Update use-payment-channels.md

* Update send-a-time-held-escrow.md

Update link to what-is-xml

* fix broken links

* Update parallel-networks.md

Change link to what-is-xml

* Update parallel-networks.ja.md

* Update invariant-checking.md

Remove link to xrp.html

* Update invariant-checking.ja.md

Remove link to xrp.html

* Update transaction-cost.md

Change link to what-is-xrp

* Update transaction-cost.ja.md

Change link to what-is-xrp

* Update send-a-conditionally-held-escrow.md

Change link to what-is-xrp

* Update stablecoin-issuer.md

Change link to what-is-xrp

* Update tokens.ja.md

Change link to what-is-xml

* Update autobridging.ja.md

Change link to what-is-xrp

* Update currency-formats.md

update text

* reorganize infrastructure nav section

* Update currency-formats.md

Try removing link altogether.

* Update currency-formats.ja.md

Remove link to what-is-xrp.html

* move commandline usage topic to infrastructure

* initial intro rewrite

* minor update to language

* IA.v3: rm Production Readiness

* Delete xrp.md

* Update xrp link in snippet

* Add redirect for old xrp.html URL

* Small edits to 'What is XRP?' article

* Add missing imgs

* XRP - copy edit per @DennisDawson

* restructure tutorials nav and pages

* fix broken links

* more broken link fixes

* Algo trading: 1st draft

* Algo trading: notes on taxes

* Algo trading: edits per review

* algo trading: fix broken link

* Ledger structure: rewrite for accuracy and clarity

* Update links to removed 'tree format' header

* Ledger Structure: Update diagrams

* Re-gen CSS for ledger structure changes

* Ledger structure: edits per review

* IA.v3: fix broken NFT links introduced by rebase

* Desktop Wallet (py): update little stuff

* Update some capacity/storage details

* contribute doc nav update

* fix image link in create diagram page

* IAv3: Fix 'Ledgers' blurb

* Update full history requirements with details from community members

* add reviewer suggestions

* Edits per @trippled review

* Apply suggestions from peer review

Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>

* FH: reword file size limit note per review

* Update software ecosystem

* updates per review

* Minor tweaks to graphics

* fixTypos

* Update content/concepts/introduction/software-ecosystem.md

Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>

* Update content/concepts/introduction/software-ecosystem.md

Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>

* [JA] update AccountDelete cost

* custom transactors doc

* add doc to dactyl config

* [JA] fix NonFungibleTokensV1_1 amendment status

* [JA] update NFTokenOffer page

* Remove old, unused XRP article (#2039)

* add reviewer suggestions

* Add tooling to check for file/nav consistency

- From the repo top, run tool/check_file_consistency.py to look for
  Markdown files that exist in the "content/" directory but aren't used
  in the documentation.
- New "enforce_filenames" filter prints a warning to console when
  building, if a file's path and filename don't match expectations
  based on its place in the nav and top heading.

* File consistency checker: correctly handle filenames starting in _

* Remove unused old 'get started' and associated code

* Create Resources section & reorg some files

- Rename some files/folders based on their place in the nav
- Move a bunch of non-documentation stuff, and docs on contributing code
  and/or docs to the new "Resources" section.
- Known issue: nav spills into a second row on page widths between
  993px-1110px. To be fixed in a later CSS update, maybe along with
  making the Resources dropdown multi-column.

* Fix #2078 code tab bug

CSS not built yet, to reduce merge conflicts. Won't have any effect
until that happens.

* fix Transaction JSON

* [JA] translate contributing contents

* fix contributing-to-documentation parent

* fix contribute-code blurb

* Top nav: add cols for Resources, fix broken links

* CSS: fix top nav overflows

* Fix broken link from redirect not in JA target

* Top nav: add Infra to article types

* Update contrib info & rename intro file

* [ja] Update link to suggested first page to translate

* [ja] fix contribute docs organization

* Run private network with docker tutorial (#2065)

* [NO-ISSUE] Run private network with docker tutorial

Adds a tutorial page in the Infrastructure section on how to run a private XRPL network with Docker.

Please let me know if you think this is a useful page to include for developers, whether the steps are clear or not, and if you have suggestions on what can be added to it.

* Add minor link fixes and Japanese target

* Apply suggestions from code review

Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>

* Add link to ripple-docker-testnet setup scripts in See Also section

* Update repo URL

---------

Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>

* add intro gfx (#2036)

* add intro gfx

* Move graphic up

* Update some graphics with their revised versions

* Add updated version of the custodial vs non-custodial graphic

---------

Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>
Co-authored-by: Amarantha Kulkarni <akulkarni@ripple.com>

* Update to reflect current UNL publishers

* [ja] update contributing

Co-authored-by: tequ <git@tequ.dev>

* Incorporate feedback on "What is XRP" page. (#2099)

* Add trademark info for XRP

* Revert section to previous state

* Fix broken link (#2101)

---------

Co-authored-by: Oliver Eggert <oeggert@ripple.com>
Co-authored-by: ddawson <dennis.s.dawson@gmail.com>
Co-authored-by: Maria Shodunke <mshodunke@ripple.com>
Co-authored-by: tequ <git@tequ.dev>
Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>
Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com>
Co-authored-by: develoQ <develoQ.jp@gmail.com>
Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com>
Co-authored-by: Amarantha Kulkarni <akulkarni@ripple.com>
2023-09-01 12:40:18 -07:00

13 KiB
Raw Blame History

html, parent, blurb
html parent blurb
fix-sqlite-tx-db-page-size-issue.html troubleshoot-the-rippled-server.html rippledバージョン0.40.0以前で起動された完全履歴サーバーでのSQLiteのページサイズに関する問題を解決します。

SQLiteトランザクションデータベースのページサイズの問題の解決

全トランザクション履歴(または極めて大量のトランザクション履歴)が記録されているrippledサーバーと、0.40.02017年1月リリースよりも古いバージョンのrippledで最初に作成されたデータベースでは、SQLiteデータベースのページサイズが原因でサーバーが適切に稼働しなくなる問題が発生する可能性があります。最近のトランザクション履歴のみが保管されているサーバーデフォルト構成と、バージョン0.40.0以降のrippledでデータベースファイルが作成されているサーバーでは、この問題が発生する可能性はそれほどありません。

このドキュメントでは、この問題の発生時に問題を検出し解決する手順を説明します。

背景

rippled サーバーではトランザクション履歴のコピーがSQLiteデータベースに保管されます。バージョン0.40.0より古いrippledでは、このデータベースの容量は約2TBに設定されました。ほとんどの場合はこの容量で十分です。ただし、レジャー32570本番環境XRP Ledgerの履歴で利用可能な最も古いレジャーバージョン以降の全トランザクション履歴は、このSQLiteデータベースの容量を超える可能性があります。rippledサーバーバージョン0.40.0以降では、これよりも大きな容量でSQLiteデータベースファイルが作成されているため、この問題が発生する可能性は低くなります。

SQLiteデータベースの容量は、データベースの_ページサイズ_パラメーターによって決まります。この容量は、データベース作成後は容易に変更できません。SQLiteの内部についての詳細は、SQLite公式ドキュメントを参照してください。)データベースが保管されているディスクとファイルシステムに空き容量がある場合でも、データベースが容量いっぱいになることがあります。以下の「解決策」で説明するように、この問題を回避するためにページサイズを再構成するには、時間のかかる移行プロセスが必要です。

ヒント: ほとんどの場合、rippledサーバーの稼働に全履歴が必要となることはありません。サーバーにトランザクションの全履歴が記録されていれば、長期分析やアーカイブ、または災害に対する事前対策に役立ちます。リソースを大量に消費せずにトランザクション履歴を保管する方法については、履歴シャーディングを参照してください。

検出

サーバーがこの問題に対して脆弱である場合は、次の2種類の方法でこの問題を検出できます。

  • ご使用のrippledサーバーが[バージョン1.1.0][新規: rippled 1.1.0]以降の場合、(問題が発生する前に)事前に問題を検出できます。
  • (サーバーがクラッシュした場合)どのrippledバージョンでも、問題を事後に特定できます。

いずれの場合でも、問題を検出するにはrippledのサーバーログへのアクセスが必要です。

ヒント: このデバッグログの位置は、rippledサーバーの構成ファイルの設定に応じて異なる可能性があります。デフォルトの構成では、サーバーのデバッグログは/var/log/rippled/debug.logファイルに書き込まれます。

事前の検出

SQLiteのページサイズの問題を事前に検出するには、 [rippled 1.1.0][新規: rippled 1.1.0]以上を実行している必要があります。rippledサーバーは、以下のようなメッセージをデバッグログに定期的に少なくとも2分間隔で書き込みます。ログエントリーの正確な数値とトランザクションデータベースへのパスは、ご使用の環境に応じて異なります。

Transaction DB pathname:/opt/rippled/transaction.db; SQLite page size:1024
 bytes; Free pages:247483646; Free space:253423253504 bytes; Note that this
 does not take into account available disk space.

SQLite page size: 1024 bytesという値は、トランザクションデータベースが小さいページサイズで構成されており、全トランザクション履歴に対応できる容量がないことを示しています。この値がすでに4096バイト以上の場合、SQLiteデータベースにはすでに全トランザクション履歴を保管できる十分な容量があり、このドキュメントで説明する移行を行う必要はありません。

rippledサーバーは、このログメッセージに示されているFree spaceが524288000バイト500MB未満になると停止します。空き容量がこのしきい値に近づいている場合は、予期しない停止を回避するためにこの問題を解決してください。

事後の検出

サーバーのSQLiteデータベース容量をすでに超えている場合には、rippledサービスがこの問題を示すログメッセージを書き込み、停止します。

rippled 1.1.0以降

rippledバージョン1.1.0以降では、サーバーは以下のようなメッセージをサーバーのデバッグログに書き込み、通常の方法でシャットダウンします。

Free SQLite space for transaction db is less than 512MB.To fix this, rippled
 must be executed with the vacuum <sqlitetmpdir> parameter before restarting.
 Note that this activity can take multiple days, depending on database size.

rippled 1.1.0より前

バージョン1.1.0より前のrippledでは、サーバーが繰り返しクラッシュし、以下のようなメッセージがサーバーのデバッグログに書き込まれます。

Terminating thread doJob:AcquisitionDone: unhandled
 N4soci18sqlite3_soci_errorE 'sqlite3_statement_backend::loadOne: database or
 disk is full while executing "INSERT INTO [...]

解決策

この問題を解決するには、このドキュメントで説明する手順に従い、サポートされているLinuxシステムでrippledを使用します。推奨されるハードウェア構成とおおよそ一致するシステムスペックで全履歴を記録するサーバーの場合、このプロセスにかかる日数は2日を超える可能性があります。

前提条件

  • [rippledバージョン1.1.0][新規: rippled 1.1.0]以上を実行している必要があります。

    • このプロセスを開始する前に、安定した最新バージョンにrippledをアップグレードします。

    • 以下のコマンドを実行して、ローカルにインストールしたrippledのバージョンを確認できます。

        rippled --version
      
  • rippledユーザーが書き込めるディレクトリーに、トランザクションデータベースの2つめのコピーを一時的に保管するのに十分な空き容量が必要です。この空き容量は、既存のトランザクションデータベースと同じファイルシステムに設ける必要はありません。

    トランザクションデータベースは、構成の[database_path]設定で指定されるフォルダーのtransaction.dbファイルに保管されます。このファイルのサイズを調べ、必要な空き容量を確認できます。次に例を示します。

      ls -l /var/lib/rippled/db/transaction.db
    

移行プロセス

トランザクションデータベースを大きなページサイズに移行するには、以下の手順を実行します。

  1. すべての前提条件を満たしていることを確認します。

  2. 移行プロセスの実行中に一時ファイルを保管するフォルダーを作成します。

     mkdir /tmp/rippled_txdb_migration
    
  3. rippledユーザーに、一時フォルダーの所有権を付与します。これにより、ユーザーは一時フォルダー内のファイルに書き込みできるようになります。(rippledユーザーがすでにアクセス権限を持つ場所に一時フォルダーがある場合は、この操作は不要です。)

     chown rippled /tmp/rippled_txdb_migration
    
  4. 一時フォルダーに、トランザクションデータベースのコピーを保管するのに十分な空き容量があることを確認します。

    たとえば、dfコマンドのAvail出力と、transaction.dbファイルのサイズを比較します。

     df -h /tmp/rippled_txdb_migration
    
     Filesystem      Size  Used Avail Use% Mounted on
     /dev/sda2       5.4T  2.6T  2.6T  50% /tmp
    
  5. rippledがまだ稼働している場合は停止します。

     sudo systemctl stop rippled
    
  6. screenセッション(または類似のツール)を開き、ログアウトしてもプロセスが停止しないようにします。

     screen
    
  7. rippledユーザーになります。

     sudo su - rippled
    
  8. 一時ディレクトリへのパスを指定した--vacuumコマンドで、rippled実行可能ファイルを直接実行できます。

     /opt/ripple/bin/rippled -q --vacuum /tmp/rippled_txdb_migration
    

    rippled実行可能ファイルにより次のメッセージが即時に表示されます。

     VACUUM beginning. page_size:1024
    
  9. プロセスが完了するまで待ちます。これには丸2日以上かかることがあります。

    プロセスが完了したら、rippled実行可能ファイルは以下のメッセージを表示して終了します。

     VACUUM finished. page_size:4096
    

    待機している間にscreenセッションを切り離すには、CTRL-Aを押してからDを押します。その後、以下のようなコマンドでスクリーンセッションを再接続します。

     screen -x -r
    

    プロセスが完了したら、スクリーンセッションを終了します。

     exit
    

    screenコマンドについての詳細は、公式Screenユーザーマニュアルまたはオンラインで使用可能なその他の多数のリソースを参照してください。

  10. rippledサービスを再起動します。

    sudo systemctl start rippled
    
  11. rippledサービスが正常に起動したかどうかを確認します。

    コマンドラインインターフェイスを使用してサーバーの状況を確認できますサーバーがJSON-RPC要求を受け入れないように設定している場合を除く。次に例を示します。

    /opt/ripple/bin/rippled server_info
    

    このコマンドの予期される応答の説明については、[server_infoメソッド][]ドキュメントを参照してください。

  12. サーバーのデバッグログを参照し、SQLite page sizeが現在4096であることを確認します。

    tail -F /var/log/rippled/debug.log
    

    また定期的なログメッセージには、移行前に比べて非常に多くのフリーページとフリースペースが示されているはずです。

  13. 必要に応じて、移行プロセスのために作成した一時フォルダーをこの時点で削除できます。

    rm -r /tmp/rippled_txdb_migration
    

    トランザクションデータベースの一時コピーを保持するために追加のストレージをマウントした場合は、この時点でそのストレージをアンマウントして取り外すことができます。

{% include '_snippets/rippled-api-links.md' %} {% include '_snippets/tx-type-links.md' %} {% include '_snippets/rippled_versions.md' %}