• 附录
    • 1.问题及方案
      • 一般问题
      • 数据库问题
      • WeBASE-Node-Manager服务搭建问题
    • 2.配置文件解析

    附录

    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

    2.配置文件解析

    参数默认值描述
    server.port8080当前服务端口
    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/fisco-bcos-datamysql连接地址
    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,127.0.0.1,0.0.0.0不支持的前置ip
    constant.isBlockPullFromZerofalse是否从0开始同步区块信息
    constant.pullBlockSleepTime200拉完一个区块,睡眠时间(毫秒)
    constant.pullBlockTaskFixedDelay30000拉区块任务执行完后,间隔多久开始下一次(毫秒)
    constant.blockRetainMax10000表中区块保留的条数(开启constant.isDeleteInfo时有效)
    constant.cookieMaxAge1800登录cookie有效时长(妙)
    constant.isUseSecuritytrue是否启用登录鉴权
    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审计异常数据被允许最大值,到达后会停止审计