Chaindata Change
💡 THIS GUIDE IS BASED ON Amazon Linux 2
CN Node Migration STEP
Create new disk
Preparing new disk (3,500GB disk) or creating new path on the current disk (It must have 3,500GB available.)
💡 Assuming that the new path is `/var/kcnd2`
Option 1 - New disk (more than 2500GB)
Attach the disk to EC2 and run the command below
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme2n1 259:0 0 3500G 0 disk **# New Disk**
nvme1n1 259:0 0 4000G 0 disk /var/kcnd
nvme0n1 259:2 0 8G 0 disk
├─nvme0n1p1 259:3 0 8G 0 part /
└─nvme0n1p128 259:4 0 1M 0 part
Mount it following the process below
$ sudo e2fsck -f /dev/nvme2n1
$ sudo mkfs -t ext4 /dev/nvme2n1
$ sudo mkdir /var/kcnd2
$ sudo mount /dev/nvme2n1 /var/kcnd2
$ sudo mkdir /var/kcnd2/data
$ sudo mkdir /var/kcnd2/log
Option 2 - Current Disk (not recommended)
Create New Folder
$ sudo mkdir /var/kcnd2/data
$ sudo mkdir /var/kcnd2/log
Download the latest chaindata
Download Chain Data to the data of the new Klaytn Data DIR. (You can check the details on Chain Data in https://packages.klaytn.net/cypress/chaindata/)
Download with the following command
# (Option 1: recommended) curl
$ curl -o klaytn-cypress-chaindata-2021???????????.tar.gz "https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/cypress/klaytn-cypress-chaindata-2021???????????.tar.gz"
# (Option 2) aws s3 command
$ aws s3 cp s3://klaytn-chaindata/cypress/klaytn-cypress-chaindata-2021???????????.tar.gz klaytn-cypress-chaindata-20211113011111.tar.gz
# (Option 3) axel (need to install axel)
sudo amazon-linux-extras install epel -y
sudo yum install axel pigz
$ axel -n8 https://s3.ap-northeast-2.amazonaws.com/klaytn-chaindata/cypress/klaytn-cypress-chaindata-2021???????????.tar.gz
Decompress
# (Option 1: recommended) tar
$ tar -xvf klaytn-cypress-chaindata-2021???????????.tar.gz
# (Option 2) pigz (need to isntall pigz)
$ tar -I pigz -xvf klaytn-cypress-chaindata-2021???????????.tar.gz
Configure DATA_DIR & LOG_DIR
Option 1 - Swap the old & new path
🚨 TBD
Stop klaytn daemon process before swap
IMPORTANT Remove CN node in Klaytn council if the node type is CN
💡 You can get packages for EN in the Startup the CN.
Swap the old and new path
New Disk
umount /var/kcnd # old path umount /var/kcnd2 # new path mount /dev/nvme2n1 /var/kcnd
💡 These commands should be executed with the appropriate privileges.
Current Disk
sudo mv /var/kcnd /var/kcnd_old # old_path sudo mv /var/kcnd2 /var/kcnd # new path
(Optional) Delete the old path if it is not required anymore
Option 2 - Update DATA_DIR & LOG_DIR in klaytn config file
Klaytn DIR Path Change
Option 1 - New disk
Change
fstab
value from old disk to new disk
Option 2 - Current disk
change the DIR Path from
kcnd.conf
Restart Process(or Reboot Instance)
💡 If reboot is required to add an additional disk, reboot the instance.
IMPORTANT Remove CN node in Klaytn council if the node type is CN
Restart process or reboot instance
Last updated
Was this helpful?