1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

NEMのノードをアップグレードする方法をまとめてみました。

Last updated at Posted at 2021-11-08

The English text of this article is below.
https://qiita.com/Solve/items/e190e7c7b530a87392d0

NEMのノードを最新バージョン(v0.6.98 Harlock)にアップグレードしましたので、その方法をまとめてみました。
rootにUPしている場合を記しますので、sudoを付けるなど、適宜変更してください。

##1.ノードを停止します

systemctl stop nem-nis.service
systemctl stop nem-servant.service

上記はsystemdに登録している場合です。始動や停止の方法はどのような方法でも構いません。なお、自動起動の方法を追記しました。

##2.バックアップします

フォルダnemServerの名前を変更します(バックアップしたことになる)。
フォルダnemServerは後で新しく作成されます。

mv nemServer nemServer_backup

nemフォルダのバックアップを取ります(数分かかる)。

cp -rpi nem/ nem_backup/

##3.新バージョンのダウンロード

wget https://github.com/NemProject/nis/releases/download/v0.6.98/nis-0.6.98.tgz

必要なら、servantもダウンロードします。
wget http://bob.nem.ninja/servant_0_0_4.zip

##4.解凍します

tar xzf nis-0.6.98.tgz
unzip -q servant_0_0_4.zip

##5.それらをnemServerという1つのフォルダにまとめます

mv servant package
mv package nemServer
chmod -R g-w nemServer

##6.下記の4つのファイルをバックアップからnemServerへコピーします

cp -i nemServer_backup/nis/config.properties nemServer/nis
cp -i nemServer_backup/servant/config.properties nemServer/servant

cp -i nemServer_backup/nix.runNis.sh nemServer
cp -i nemServer_backup/servant/startservant.sh nemServer/servant

##7.実行権限を付けておきます

chmod u+x nemServer/nix.runNis.sh
chmod u+x nemServer/servant/startservant.sh

##8.起動します

systemctl daemon-reload

systemctl enable nem-nis.service
systemctl enable nem-servant.service

systemctl start nem-nis.service
systemctl start nem-servant.service

##9.2重起動していないか確認します

pgrep -fa org.nem

##10.最新バージョンになっているか、起動の最終確認をします

下記リンクで、heightが増えているなら起動に成功しています!
http://(IPアドレス):7890/chain/height

5,6時間後に同期が完了します。
下記リンクで、バージョンが"version":"0.6.98"となっていればUpgrade成功です。
http://(IPアドレス):7890/node/info

その後、しばらくして、NEMのノードリストが更新されます。
https://nemnodes.org/nodes/

以上です。

この方法でアップグレードできましたので、まとめておきました。

##追記:自動起動の設定は次の通りです

《viの使い方》
esc・・・コマンドモード
i・・・挿入モード
:wq・・・書き込み終了

(1)NISサーバーの自動起動の設定

vi /etc/systemd/system/nem-nis.service

下記をi(挿入モード)で張り付け、:wqで書き込みします。

↓↓↓↓↓↓↓↓↓↓
[Unit]
Description = NEM NIS Server
After = network.target

[Service]
WorkingDirectory = /root/nemServer
ExecStart = /root/nemServer/nix.runNis.sh
Restart = always

[Install]
WantedBy = multi-user.target
↑↑↑↑↑↑↑↑↑↑

:wq

(2)Servantサーバーの自動起動の設定

vi /etc/systemd/system/nem-servant.service

下記をi(挿入モード)で張り付け、:wqで書き込みします。

↓↓↓↓↓↓↓↓↓↓
[Unit]
Description = NEM Servant program
After = network.target nem-nis.target

[Service]
WorkingDirectory = /root/nemServer/servant
ExecStart = /root/nemServer/servant/startservant.sh
Restart = always

[Install]
WantedBy = multi-user.target
↑↑↑↑↑↑↑↑↑↑

:wq

(3)それから、NISサーバーとServantサーバーをsystemdに登録します

systemctl daemon-reload
systemctl enable nem-nis.service
systemctl enable nem-servant.service
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?