「Splitting the data directory」の版間の差分

提供: tezos-wiki
移動先: 案内検索
(1版 をインポートしました)
 
1行目: 1行目:
Bitcoin Core normally puts all of its data into one [[data directory]], but oftentimes it is useful to adjust things so that certain of these files go elsewhere.
+
Bitcoin Coreは通常、すべてのデータを1つの[data directory]に格納しますが、これらのファイルの一部が他の場所に移動するように調整することは便利なことがよくあります。
  
==If your data directory is on a magnetic disk: Moving chainstate for improved speed==
+
==あなたのデータディレクトリが磁気ディスク上にある場合:速度向上のためにチェインステートを動かす==
  
Bitcoin Core's overall speed is significantly affected by the random-access speed of the contents of the chainstate directory; if your data directory is located on a magnetic disk, your chainstate access speed will very probably be the biggest performance bottleneck. You can therefore often massively improve performance by moving just the chainstate directory (which is only a few GB) to an SSD drive. Even moving the chainstate directory to a USB flash drive can often provide a large performance improvement, especially if the USB flash drive is advertised as being particularly high-speed.
+
Bitcoin Coreの全体的な速度は、chainstateディレクトリの内容のランダムアクセス速度に大きく影響されます。データディレクトリが磁気ディスク上にある場合は、チェーン状態のアクセス速度がパフォーマンスの最大のボトルネックになります。したがって、チェーンステートディレクトリ(わずか数GB)だけをSSDドライブに移動することで、パフォーマンスを大幅に向上させることができます。チェーンステートディレクトリをUSBフラッシュドライブに移動しても、特にUSBフラッシュドライブが特に高速であると宣伝されている場合は、パフォーマンスが大幅に向上します。
  
To move it:
+
移動するには:
  
# Shut down Bitcoin Core
+
#Bitcoin Coreをシャットダウンする
# From the [[data directory]], ''cut'' the chainstate directory (not just its contents, but the directory itself) and ''paste'' it somewhere on the target drive. On Linux, make sure that permissions allow for Bitcoin Core to read/write the directory and its files at the new location.
+
[[data directory]]から、チェインステートディレクトリ(内容だけでなくディレクトリ自体)を切り取り、ターゲットドライブのどこかに貼り付けます。 Linuxでは、Bitcoin Coreがディレクトリとそのファイルを新しい場所で読み書きするための許可が許可されていることを確認してください。
# Open a terminal in the data directory. (On Windows, Shift-RightClick the [[data directory]] and choose "open a command window here".) On Linux, run <tt>ln -s /absolute/path/to/chainstate</tt>. For example, if you moved your chainstate so that its new location is /mnt/ssd/core/chainstate (ie. within that directory are a bunch of ldb files), you'd run <tt>ln -s /mnt/ssd/core/chainstate</tt> from immediately within the data directory. On Windows, run <tt>mklink /D chainstate ?:\path\to\chainstate</tt>. For example, if you moved your chainstate so that its new location is F:\core\chainstate (ie. within that directory are a bunch of ldb files), you'd run <tt>mklink /D chainstate F:\core\chainstate</tt> from immediately within the data directory.
+
#データディレクトリの端末を開きます。 Linuxでは、<tt> ln -s / absolute / path / to / chainstate </ tt>を実行します(Windowsの場合はShiftキーを押しながら[[data directory]]をクリックし、 "ここでコマンドウィンドウを開く"を選択します)。たとえば、新しい場所が/ mnt / ssd / core / chainstateになるようにチェーンステートを移動した場合(つまり、そのディレクトリ内にldbファイルがたくさんある場合)、<tt> ln -s / mnt / ssd / core / chainstate </ tt>をデータディレクトリ内からすぐに取得します。 Windowsでは、<tt> mklink / D chainstate?:\ path \から\ chainstate </ tt>を実行します。たとえば、新しい場所がF:\ core \ chainstateになるようにチェーンステートを移動した場合(つまり、そのディレクトリ内に複数のldbファイルがある場合)、<tt> mklink / D chainstate F:\ core \ chainstate </ tt>をデータディレクトリ内からすぐに取得します。
  
If you're using a removable drive, make sure that the path to the real chainstate does not change.
+
リムーバブルドライブを使用している場合は、実際のチェーンステータスへのパスが変更されていないことを確認してください。
  
==If your data directory is on an SSD: Moving the blocks database to save space==
+
==あなたのデータディレクトリがSSD上にある場合:ブロックデータベースを移動してスペースを節約する==
  
Unlike the chainstate directory mentioned in the previous section, the blk* and rev* files in the blocks directory in the [[data directory]] are rarely accessed, and when accessed they are accessed in a highly sequential access pattern, so it will not affect performance much at all to move them to a magnetic disk, thereby freeing up 100+ GB on your SSD.
+
前のセクションで述べたchainstateディレクトリとは異なり、[[dataディレクトリ]]のblocksディレクトリにあるblk *とrev *ファイルはほとんどアクセスされず、アクセスされると非常にシーケンシャルなアクセスパターンでアクセスされるため、パフォーマンスに大きな影響を与えて磁気ディスクに移動させ、SSD上に100GB以上の空き容量を確保します。
  
Note that you can avoid the need to store the blocks database at all by running Bitcoin Core with pruning enabled (ie. add <tt>prune=550</tt> to bitcoin.conf), but then you will lose some features and be slightly less helpful to the network. Security is not affected by this, however, and you remain a [[full node]].
+
Bitcoin Coreをプルーニングを有効にして実行する(つまり、<tt> prune = 550 </ tt>をbitcoin.confに追加する)ことによってブロックデータベースを保存する必要がなくなりますが、いくつかの機能を失います。ネットワークにはあまり役立ちません。セキュリティはこれによって影響を受けず、あなたは[[完全なノード]]のままです。
  
Unlike in the chainstate case, you don't want to move the entire blocks directory because this would move the performance-relevant <tt>blocks/index</tt> directory as well. Instead, you can place the following script in the blocks directory and run it periodically '''with Bitcoin Core shut down''' to move the blk* and rev* files individually. Do not run the script while Bitcoin Core is running or you will probably wreck things in such a way that you will have to sync from 0. Modify BLK_TARGET=... in the script to point to your desired target location.
+
chainstateの場合とは異なり、ブロックディレクトリ全体を移動する必要はありません。これは、パフォーマンス関連の<tt>ブロック/インデックス</ tt>ディレクトリも移動するためです。代わりに、blocksディレクトリに次のスクリプトを置いて定期的に '' 'Bitcoin Coreをシャットダウンして' '' blk *とrev *ファイルを個別に移動することができます。 Bitcoin Coreが動作している間にスクリプトを実行しないでください。そうしないと、0から同期する必要があります。BLK_TARGET = ...をスクリプト内で変更して、目的の場所を指定します。
  
Linux:
+
Linux:
<pre>#!/bin/bash
+
<pre>#!/ bin / bash
set -e
+
セット-e
BLK_TARGET=/mnt/ssd/core/blocks #Replace with your destination, no trailing slash
+
BLK_TARGET = / mnt / ssd / core / blocks#先にスラッシュを入れずに置き換えます
  
find . -name '*.dat' -type f -printf '%f\n' > tomove
+
見つける。 -name '* .dat' -type f -printf '%f \ n'>無効にする
while read line; do
+
一方、読取りライン。行う
         echo $line
+
         エコー$
         mv "$line" "$BLK_TARGET/$line"
+
         mv "$ line" "$ BLK_TARGET / $ line"
         ln -s "$BLK_TARGET/$line" "$line"
+
         ln -s "$ BLK_TARGET / $ line" "$ line"
done <tomove
+
完了<戻る
 
rm tomove
 
rm tomove
echo Done</pre>
+
エコー完了</ pre>
  
Windows (save as <tt>move.bat</tt> or something):
+
Windows(<tt> move.bat </ tt>などで保存):
<pre>@echo off
+
<pre> @echo off
REM Change the following line to your destination, no trailing slash
+
REM次の行を目的地に変更します。末尾にスラッシュはありません
SET BLK_TARGET=F:\core\blocks
+
SET BLK_TARGET = F:\ core \ blocks
for /f %%f in ('dir /A-L /b *.dat') do (
+
'dir / A-L / b * .dat')の/ f %% fに対してdo(
move %%f %BLK_TARGET%\%%f
+
移動%% f%BLK_TARGET%\ %% f
if exist %%f (
+
存在するなら%% f(
echo Something went wrong
+
エコー何かが間違っていた
pause
+
一時停止する
exit
+
出口
)
+
mklink %%f %BLK_TARGET%\%%f
+
mklink %% f%BLK_TARGET%\ %% f
)
+
echo Done
+
エコー完了
pause</pre>
+
一時停止</ pre>
  
These scripts expect to be inside of the <tt>blocks</tt> directory in the [[data directory]], next to the blk and rev files. They do only minimal error handling -- use with care.
+
これらのスクリプトは、blkファイルとrevファイルの隣にある[[data directory]]の<tt> blocks </ tt>ディレクトリの内側にあると想定しています。彼らは最小限のエラー処理しか行いません - 注意して使用してください。
  
To undo the script, just move all of the files back to where they were originally, overwriting the symlinks.
+
スクリプトを元に戻すには、すべてのファイルを元の場所に戻して、シンボリックリンクを上書きします。
  
[[Category:Guides]]
+
[[カテゴリ:ガイド]]

2018年4月13日 (金) 12:46時点における最新版

Bitcoin Coreは通常、すべてのデータを1つの[data directory]に格納しますが、これらのファイルの一部が他の場所に移動するように調整することは便利なことがよくあります。

あなたのデータディレクトリが磁気ディスク上にある場合:速度向上のためにチェインステートを動かす[編集]

Bitcoin Coreの全体的な速度は、chainstateディレクトリの内容のランダムアクセス速度に大きく影響されます。データディレクトリが磁気ディスク上にある場合は、チェーン状態のアクセス速度がパフォーマンスの最大のボトルネックになります。したがって、チェーンステートディレクトリ(わずか数GB)だけをSSDドライブに移動することで、パフォーマンスを大幅に向上させることができます。チェーンステートディレクトリをUSBフラッシュドライブに移動しても、特にUSBフラッシュドライブが特に高速であると宣伝されている場合は、パフォーマンスが大幅に向上します。

移動するには:

#Bitcoin Coreをシャットダウンする #data directoryから、チェインステートディレクトリ(内容だけでなくディレクトリ自体)を切り取り、ターゲットドライブのどこかに貼り付けます。 Linuxでは、Bitcoin Coreがディレクトリとそのファイルを新しい場所で読み書きするための許可が許可されていることを確認してください。 #データディレクトリの端末を開きます。 Linuxでは、 ln -s / absolute / path / to / chainstate </ tt>を実行します(Windowsの場合はShiftキーを押しながらdata directoryをクリックし、 "ここでコマンドウィンドウを開く"を選択します)。たとえば、新しい場所が/ mnt / ssd / core / chainstateになるようにチェーンステートを移動した場合(つまり、そのディレクトリ内にldbファイルがたくさんある場合)、<tt> ln -s / mnt / ssd / core / chainstate </ tt>をデータディレクトリ内からすぐに取得します。 Windowsでは、<tt> mklink / D chainstate?:\ path \から\ chainstate </ tt>を実行します。たとえば、新しい場所がF:\ core \ chainstateになるようにチェーンステートを移動した場合(つまり、そのディレクトリ内に複数のldbファイルがある場合)、<tt> mklink / D chainstate F:\ core \ chainstate </ tt>をデータディレクトリ内からすぐに取得します。

リムーバブルドライブを使用している場合は、実際のチェーンステータスへのパスが変更されていないことを確認してください。

あなたのデータディレクトリがSSD上にある場合:ブロックデータベースを移動してスペースを節約する[編集]

前のセクションで述べたchainstateディレクトリとは異なり、dataディレクトリのblocksディレクトリにあるblk *とrev *ファイルはほとんどアクセスされず、アクセスされると非常にシーケンシャルなアクセスパターンでアクセスされるため、パフォーマンスに大きな影響を与えて磁気ディスクに移動させ、SSD上に100GB以上の空き容量を確保します。

Bitcoin Coreをプルーニングを有効にして実行する(つまり、<tt> prune = 550 </ tt>をbitcoin.confに追加する)ことによってブロックデータベースを保存する必要がなくなりますが、いくつかの機能を失います。ネットワークにはあまり役立ちません。セキュリティはこれによって影響を受けず、あなたは完全なノードのままです。

chainstateの場合とは異なり、ブロックディレクトリ全体を移動する必要はありません。これは、パフォーマンス関連の<tt>ブロック/インデックス</ tt>ディレクトリも移動するためです。代わりに、blocksディレクトリに次のスクリプトを置いて定期的に 'Bitcoin Coreをシャットダウンして' blk *とrev *ファイルを個別に移動することができます。 Bitcoin Coreが動作している間にスクリプトを実行しないでください。そうしないと、0から同期する必要があります。BLK_TARGET = ...をスクリプト内で変更して、目的の場所を指定します。

Linux:

#!/ bin / bash
セット-e
BLK_TARGET = / mnt / ssd / core / blocks#先にスラッシュを入れずに置き換えます

見つける。 -name '* .dat' -type f -printf '%f \ n'>無効にする
一方、読取りライン。行う
        エコー$行
        mv "$ line" "$ BLK_TARGET / $ line"
        ln -s "$ BLK_TARGET / $ line" "$ line"
完了<戻る
rm tomove
エコー完了</ pre>

Windows(<tt> move.bat </ tt>などで保存):
<pre> @echo off
REM次の行を目的地に変更します。末尾にスラッシュはありません
SET BLK_TARGET = F:\ core \ blocks
( 'dir / A-L / b * .dat')の/ f %% fに対してdo(
移動%% f%BLK_TARGET%\ %% f
存在するなら%% f(
エコー何かが間違っていた
一時停止する
出口
)
mklink %% f%BLK_TARGET%\ %% f
)
エコー完了
一時停止</ pre>

これらのスクリプトは、blkファイルとrevファイルの隣にあるdata directoryの<tt> blocks </ tt>ディレクトリの内側にあると想定しています。彼らは最小限のエラー処理しか行いません - 注意して使用してください。

スクリプトを元に戻すには、すべてのファイルを元の場所に戻して、シンボリックリンクを上書きします。

カテゴリ:ガイド