【三胖聊区块链-EOS】(一)EOS填坑系列-Nodeos非正常关闭导致重启异常解决方案

1,162 阅读1分钟

github源码:我在这呢

1.当非正常关闭Nodeos时,下次启动Nodeos会报错:

Database dirty flag set (likely due to unclean shutdown): 
replay required

2.解决这种问题唯一的办法是 replay

添加这行命令  --replay-blockchain --hard-replay-blockchain /
执行完整的命令:
nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::producer_api_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
--plugin eosio::history_plugin \
--plugin eosio::history_api_plugin \
--filter-on="*" \
--access-control-allow-origin='*' \
--contracts-console \
--http-validate-host=false \
--replay-blockchain --hard-replay-blockchain \
--verbose-http-errors >> nodeos.log 2>&1 &

3.吐槽

但是这种方法不是很好,我们应当在每次关闭的时候都能让Nodos正常关闭,防止出现这种Error,因此需要安全结束nodeos进程

4.发送SIGTERM,SIGQUIT或SIGINT来结束进程,命令如下,切勿使用 kill -9来杀死进程,会出现以上错误

 pkill nodeos
 pkill -15 nodeos
 pkill -2 nodeos 
 pkill -TERM nodeos
 pkill -SIGTERM nodeos
 pkill -INT nodeos 
 pkill -SIGINT nodeos 

更多

想了解更多,请关注公众号哦!