附录

1. 问题及方案

一般问题

  • 问:执行shell脚本报下面错误:
  1. [app@VM_96_107_centos deployInputParam]$ bash start.sh
  2. start.sh: line 2: $'\r': command not found
  3. start.sh: line 8: $'\r': command not found
  4. start.sh: line 9: $'\r': command not found
  5. start.sh: line 10: $'\r': command not found

答:这是编码问题,在脚本的目录下执行转码命令:

  1. dos2unix *.sh

数据库问题

  • 问:服务访问数据库抛出异常:
  1. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

答:检查数据库的网络策略是否开通

  1. 下面以centos7为例:
  2. 查看防火墙是否开放3306端口: firewall-cmd --query-port=3306/tcp
  3. 防火墙永久开放3306端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent
  4. 重新启动防火墙:firewall-cmd --reload
  • 问:执行数据库初始化脚本抛出异常:
  1. ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (110)

答:MySQL没有开通该帐号的远程访问权限,登录MySQL,执行如下命令,其中TestUser改为你的帐号

  1. GRANT ALL PRIVILEGES ON *.* TO 'TestUser'@'%' IDENTIFIED BY '此处为TestUser的密码’' WITH GRANT OPTION;

WeBASE-Node-Manager服务搭建问题

  • 问:执行构建命令gradle build -x test抛出异常:
  1. A problem occurred evaluating root project 'WeBASE-Node-Manager'.
  2. Could not find method compileOnly() for arguments [[org.projectlombok:lombok:1.18.2]] on root project 'WeBASE-Node-Manager'.

答: 方法1、已安装的Gradle版本过低,升级Gradle版本到4.10以上即可。 方法2、直接使用命令:./gradlew build -x test,如果提示gradlew为非可执行文件,执行chmod +x ./gradlew再次执行build操作即可。

启动问题

  • 问:启动Node-Manager进程后,后台日志显示not found any front

答:此处为正常提示,表示后台没有可访问的节点前置。通过WeBASE-Web连接Node-Manager后台服务后,添加节点前置即可。

    1. 配置文件解析
参数默认值描述
server.port5001当前服务端口
server.servlet.context-path/WeBASE-Node-Manager当前服务访问目录
mybatis.typeAliasesPackagecom.webank.webase.node.mgrmapper类扫描路径
mybatis.mapperLocationsclasspath:mapper/.xmlmybatis的xml路径
spring.datasource.driver-class-namecom.mysql.cj.jdbc.Drivermysql驱动
spring.datasource.urljdbc:mysql://127.0.0.1:3306/webasenodemanagermysql连接地址
spring.datasource.usernamedefaultAccountmysql账号
spring.datasource.passworddefaultPasswordmysql密码
logging.configclasspath:log/log4j2.xml日志配置文件目录
logging.levelcom.webank.webase.node.mgr: info日志扫描目录和级别
constant.isDeleteInfotrue是否定时删除数据(区块、交易hash、审计数据);true-是,false-否
constant.transRetainMax10000表中交易hash保留的条数(开启constant.isDeleteInfo时有效)
constant.deleteInfoCron“0 0/1 ?”定时删除数据的频率,默认一分钟
constant.statisticsTransDailyCron“0 0/1 * ?”统计交易记录的执行频率,默认一分钟
constant.resetGroupListCycle600000刷新群组列表任务执行完后,下一个开始间隔(毫秒)
constant.groupInvalidGrayscaleValue1M群组失效灰度期长度,灰度期过后,如果还没查到失效状态的群组,就删除(y:年, M:月, d:天, h:小时, m:分钟, n:永远有效)
constant.notSupportFrontIplocalhost不支持的前置ip
constant.isBlockPullFromZerofalse是否从0开始同步区块信息(true-是,false-最新块开始同步)
constant.pullBlockInitCnts1000最新块的前1000个块之后开始同步(constant.isBlockPullFromZero=false时有效)
constant.pullBlockSleepTime200拉完一个区块,睡眠时间(毫秒)
constant.pullBlockTaskFixedDelay30000拉区块任务执行完后,间隔多久开始下一次(毫秒)
constant.blockRetainMax10000表中区块保留的条数(开启constant.isDeleteInfo时有效)
constant.verificationCodeMaxAge300y验证码有效时长(秒)
constant.authTokenMaxAge1800登录token有效时长(秒)
constant.isUseSecuritytrue是否启用登录鉴权
constant.aesKeyERTadb83f9ege39kaes加密key(16位),建议更改
constant.jwtSecretS3g4HtJyg7G6Hg0Ln3g4H5Jyg7H6f9dLjwt生成时用到的key,建议更改
constant.frontUrlhttp://%1s:%2d/WeBASE-Front/%3s前置服务的请求路径
constant.httpTimeOut5000http请求超时时间(毫秒)
constant.contractDeployTimeOut30000合约部署超时时间(毫秒)
constant.isPrivateKeyEncrypttrue前置私钥接口返回的私钥是否需要加密,true-加密,false-不加密
constant.maxRequestFail3请求前置(frot)被允许失败次数,达到配置值后,将会停止往该路径发送请求
constant.sleepWhenHttpMaxFail60000请求失败次数过多,熔断时间长度(毫秒)
constant.transMonitorTaskFixedRate60000交易审计开始执行后,下一个任务开始时间(毫秒)
constant.analysisSleepTime200审计完一条交易hash后,睡眠时间(毫秒)
constant.monitorInfoRetainMax10000表中审计数据保留的条数(开启constant.isDeleteInfo时有效)
constant.isMonitorIgnoreUserfalse审计逻辑是否忽略私钥用户
constant.isMonitorIgnoreContractfalse审计逻辑是否忽略合约
constant.monitorUnusualMaxCount20审计异常数据被允许最大值,到达后会停止审计
constant.auditMonitorTaskFixedDelay300000监控审计数据任务的运行间隔时间,异常时将发送告警邮件(毫秒)(注:此处为检查频率,告警配置中是告警频率)
constant.nodeStatusMonitorTaskFixedDelay60000监控节点状态任务的运行间隔时间,异常时将发送告警邮件(毫秒)(注:此处为检查频率,告警配置中是告警频率)
constant.certMonitorTaskFixedDelay300000监控证书任务的运行间隔时间,有效期结束7天前时将发送告警邮件(毫秒) (注:此处为检查频率,告警配置中是告警频率)
sdk.encryptType0sdk的加密类型,0:标准,1:国密;需要与链和Front的类型一致
executor异步拉取区块、刷新群组状态、监控群组数据的线程池配置
executor.corePoolSize3异步任务的核心线程数
executor.maxPoolSize10异步任务的最大线程数
executor.queueSize50异步任务的队列容量
executor.threadNamePrefixnode-mgr-async-异步拉取区块、刷新群组状态、监控群组数据的线程名字前缀
scheduler拉取区块、刷新群组状态、监控群组数据、交易解析、定时删除区块等定时任务的线程池配置
scheduler.poolSize50定时任务的线程池大小
scheduler.threadNamePrefixnode-mgr-task-定时任务的线程名字前缀
scheduler.awaitTerminationSeconds600定时任务的线程等待超时时长(秒)
scheduler.waitForTasksToCompleteOnShutdowntrue定时任务完成后再停止线程

3. 升级兼容性

请查看升级说明