当前位置:网站首页>长安链同步节点配置与启动
长安链同步节点配置与启动
2022-07-01 08:16:00 【帅气的梧桐述】
节点证书生成
1、默认脚本生成同步节点配置
在使用
./prepare_pk.sh
生成链配置的时候,默认
crypto-config\wx-org1.chainmaker.org\node
里边生成了两类节点的证书文件,一个是共识节点consensus1,一个是同步节点common1。
2、通过 chainmaker-cryptogen 或者自建的 CA证书服务 生成同步节点证书
同步节点配置生成
在启动节点配置文件中,只有共识节点的启动配置,如果需要启动同步节点,则需要自己新增一份同步节点配置,具体步骤如下:
1. 复制部署包
$ cd build/release
$ cp -rf chainmaker-v2.0.0-wx-org1.chainmaker.org chainmaker-v2.0.0-wx-org1.chainmaker.org_common1
2. 把chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/bin下所有的.sh脚本中所有wx-org1.chainmaker.org替换为wx-org1.chainmaker.org_common1
3. 重命名
$ cd build/release/chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config
$ mv wx-org1.chainmaker.org wx-org1.chainmaker.org_common1
4. 拷贝chainmaker-cryptogen扩展生成的crypto-config/wx-org1.chainmaker.org/node/common1 到 chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/certs/node下
5. 修改chainmaker.yml
把chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/chainmaker.yml中所有路径中包含的wx-org1.chainmaker.org替换为wx-org1.chainmaker.org_common1。注意这里是指所有的路径,千万别把node模块里边的org_id改了,这个org_id表示的是同步节点所属的组织。
修改node模块,把 certs/node/consensus1/consensus1.sign.key 修改为 certs/node/common1/common1.sign.key
修改node模块,把 certs/node/consensus1/consensus1.sign.crt 修改为 certs/node/common1/common1.sign.crt
修改net模块,把 certs/node/consensus1/consensus1.tls.key 修改为 certs/node/common1/common1.tls.key
修改net模块,把 certs/node/consensus1/consensus1.tls.crt 修改为 certs/node/common1/common1.tls.crt
修改net模块,把 listen_addr: /ip4/0.0.0.0/tcp/11301 修改为 listen_addr: /ip4/0.0.0.0/tcp/11306
修改rpc模块,把 certs/node/consensus1/consensus1.tls.crt 修改为 certs/node/common1/common1.tls.crt
修改rpc模块,把 certs/node/consensus1/consensus1.tls.key 修改为 certs/node/common1/common1.tls.key
修改rpc模块,把 port: 12301 修改为 port: 12306
修改monitor模块,把 port: 14321 修改为 port: 14326
修改pprof模块,把 port: 24321 修改为 port: 24326
6. 修改chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/chainconfig/bc1.yml中的trust_roots模块。
把所有 ../config/wx-org1.chainmaker.org 修改为 ../config/wx-org1.chainmaker.org_common1
7. 启动节点
$ cd build/release/chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/bin
$ ./start.sh
8. End异常解决
问题1:同步节点无法正常启动
[Blockchain] blockchain/chainmaker_server.go:192 init blockchain[chain1] failed, fail to initialize identity management service: [setup cert member failed, organization information in certificate and in input parameter do not match [certificate: wx-org1.chainmaker.org, parameter: wx-org1.chainmaker.org_common1]]此异常导致的原因就是在修改chainmaker.yml中所有路径中包含的wx-org1.chainmaker.org替换为wx-org1.chainmaker.org_common1时把node模块里边的org_id也替换为wx-org1.chainmaker.org_common1了,这个org_id表示的是同步节点所属的组织,节点的组织ID为wx-org1.chainmaker.org,所以将之还原为不带common1的后缀即可。
问题2:同步节点同步区块报错
2022-06-29 16:10:37.641 [ERROR] [Storage] @chain1 [email protected]/blockstore_impl.go:525 chain[chain1] failed to write log, block[1], err:out of order
2022-06-29 16:10:37.641 [ERROR] [Core] @chain1 common/committer.go:90 out of order
2022-06-29 16:10:37.641 [ERROR] [Core] @chain1 common/block_helper.go:961 cache add block err: out of order
2022-06-29 16:10:37.641 [ERROR] [Sync] @chain1 sync/routine.go:70 process msg failed, reason: failed add block to chain
2022-06-29 16:11:12.561 [ERROR] [Storage] @chain1 blockfiledb/blockfile.go:478 out of order, b.entry.index: 2 and l.lastIndex+uint64(1): 1
2022-06-29 16:11:12.561 [ERROR] [Storage] @chain1 blockfiledb/blockfile.go:481 your block file db is damaged or not use this feature before, please check your disable_block_file_db setting in chainmaker.yml
此异常的原因为第一次因错误配置导致启动后有部分区块数据已经写到文件或者db中了,后边修改配置文件重新启动后,会导致新同步节点无法从其他共识节点同步到区块数据,此时需要把前边不正确启动所产生的区块数据清理,清理方式为到节点配置文件的data目录,删掉下边的文件夹,如果有用到mysql的需要把mysql与节点相关的数据库全部删掉,重启节点即可恢复。
边栏推荐
- Maneuvering target tracking -- current statistical model (CS model) extended Kalman filter / unscented Kalman filter matlab implementation
- [getting started] intercepting strings
- Count number of rows per group and add result to original data frame
- 2022.2.15
- Utiliser Beef pour détourner le navigateur utilisateur
- String coordinates of number to excel
- Yolov5进阶之七目标追踪最新环境搭建
- Provincial election + noi Part VII computational geometry
- [深度剖析C语言] —— 数据在内存中的存储
- getInputStream() has already been called for this request
猜你喜欢

使用beef劫持用戶瀏覽器

MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析

軟鍵盤高度報錯

基于Gazebo的无人机管道检测

On several key issues of digital transformation
![[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)](/img/3e/75a1152f9cdf63c6779fdadec702a0.jpg)
[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)

机动目标跟踪——当前统计模型(CS模型)扩展卡尔曼滤波/无迹卡尔曼滤波 matlab实现
![[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order](/img/87/07783593dbabcf29700fa207ecda08.png)
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order

一套十万级TPS的IM综合消息系统的架构实践与思考

【华为机试真题详解】判断字符串子序列【2022 Q1 Q2 | 200分】
随机推荐
Set up file server Minio for quick use
Yolov5进阶之六目标追踪环境搭建
CPU设计实战-第四章实践任务一简单CPU参考设计调试
[getting started] intercepting strings
网关gateway-88
SPL-介绍(一)
Data analysis notes 11
01 NumPy介绍
[getting started] input n integers and output the smallest K of them
[Yu Yue education] Shandong Vocational College talking about railway reference materials
Find the nearest n-th power of 2
Codeworks round 803 (Div. 2) VP supplement
【入门】取近似值
华为机试真题专栏订阅指引
软键盘高度报错
7-26 word length (input and output in the loop)
Leetcode t34: find the first and last positions of elements in a sorted array
2022 examination summary of quality controller civil engineering direction post skills (quality controller) and reexamination examination of quality controller civil engineering direction post skills
Leetcode t40: combined sum II
Erreur de hauteur du clavier souple