Skip to content

Commit

Permalink
Merge pull request #193 from WeBankFinTech/dev
Browse files Browse the repository at this point in the history
Data Export branch merge request
  • Loading branch information
dalaocu authored May 22, 2020
2 parents 1fd9a26 + 4bc74c9 commit fd6a2c6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
8 changes: 4 additions & 4 deletions docs/WeBASE-Codegen-Monkey/appendix.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WeBASE-Codegen-Monkey用于生成[WeBASE-Collect-Bee](https://github.com/WeBankF

| 配置项 | 是否必输 | 说明 | 举例 | 默认值 |
| --- | --- | --- | --- | --- |
| server.port | N | 启动WeBASE-Collect-Bee组件实例的服务端口 | 8082 | 8080 |
| server.port | N | 启动WeBASE-Collect-Bee组件实例的服务端口 | 8082 | 5200 |

#### 1.2 FISCO-BCOS节点配置

Expand Down Expand Up @@ -127,7 +127,7 @@ sudo yum -y install git
sudo apt install git
```

#### 4. Mysql安装
### 4. Mysql安装

此处以Centos安装MariaDB为例。MariaDB数据库是 MySQL 的一个分支,主要由开源社区在维护,采用 GPL 授权许可。MariaDB完全兼容 MySQL,包括API和命令行。其他安装方式请参考[MySQL官网](https://dev.mysql.com/downloads/mysql/)

Expand Down Expand Up @@ -213,14 +213,14 @@ mysql > use webasebee;

**以上语句仅适用于开发环境,不能直接在实际生产中使用!!!以上设置会使数据库在所有网络上都可以访问,请按具体的网络拓扑和权限控制情况,设置网络和权限帐号**

#### 5. zookeeper 安装
### 5. zookeeper 安装
zookeeper 支持单机和集群部署,推荐使用集群部署的方式,请参考zookeeper官网的说明:

[集群部署](https://zookeeper.apache.org/doc/r3.4.13/zookeeperAdmin.html#sc_zkMulitServerSetup)

[单机部署](https://zookeeper.apache.org/doc/r3.4.13/zookeeperAdmin.html#sc_singleAndDevSetup)

#### 6. supervisor安装与部署
### 6. supervisor安装与部署

##### 安装脚本
> sudo yum -y install supervisor
Expand Down
10 changes: 6 additions & 4 deletions docs/WeBASE-Codegen-Monkey/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

```shell
#下载安装包
curl -LO https://github.com/WeBankFinTech/WeBASE-Codegen-Monkey/raw/V1.2.0/src/main/install_scripts.tar.gz
curl -LO https://github.com/WeBankFinTech/WeBASE-Codegen-Monkey/raw/master/src/main/install_scripts.tar.gz
#解压安装包
tar -zxf install_scripts.tar.gz
cd install_scripts
Expand Down Expand Up @@ -50,7 +50,7 @@ cd install_scripts

如果你的业务工程并非Java工程,那就先找到你所有的合约代码。不清楚如何将Solidity合约生成为Java文件,请参考: [利用控制台将合约代码转换为java代码](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/console.html)

请注意: **请勿使用数据库SQL语言的保留字来定义合约内部的变量、函数名定义**,否则会导致数据库无法成功建表。如定义一个变量名为key或定义一个函数为select或delete等。但是,如果你不幸地发现你的合约命名中已经有了这些关键词;那么,针对这种情况,我们为你考虑了数据库建表字段的转义配置的规则;你可以为数据库建表字段配置前缀和后缀,如配置『_』的前缀,那么你建立的"select"字段将会自动被转为"_select",以规避这种尴尬的问题。详细的配置方法请参考附录1.3 数据库配置。
请注意: **请勿使用数据库SQL语言的保留字来定义合约内部的变量、函数名定义**,否则会导致数据库无法成功建表。如定义一个变量名为key或定义一个函数为select或delete等。但是,如果你不幸地发现你的合约命名中已经有了这些关键词;那么,针对这种情况,我们为你考虑了数据库建表字段的转义配置的规则;你可以为数据库建表字段配置前缀和后缀,如配置『_』的前缀,那么你建立的"select"字段将会自动被转为"_select",以规避这种尴尬的问题。详细的配置方法请参考[附录1.3](appendix.html#id2) 数据库配置。


##### 2.2.2 配置证书文件
Expand All @@ -71,6 +71,8 @@ cd install_scripts
system.nodeStr=[NODE_NAME]@[IP]:[PORT]
## GROUP_ID必须与FISCO-BCOS中配置的groupId一致。
system.groupId=[GROUP_ID]
### 加密类型,根据FISCO BCOS链的加密类型配置,0-ECC, 1-gm。默认为非国密类型。
system.encryptType=0
# 数据库的信息,暂时只支持mysql; serverTimezone 用来设置时区
system.dbUrl=jdbc:mysql://[IP]:[PORT]/[database]?useSSL=false&serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8
Expand Down Expand Up @@ -118,7 +120,7 @@ tail -f *.log
supervisor还提供了一个功能,可以为supervisord或者每个子进程,设置一个非root的user,这个user就可以管理它对应的进程。
编译生成代码的部署同2.2.3.2

使用supervisor来安装与部署的步骤请参阅附录6
使用supervisor来安装与部署的步骤请参阅[附录6](appendix.html#supervisor)

#### 2.4 检查运行状态及退出

Expand Down Expand Up @@ -195,7 +197,7 @@ mysql -u[用户名] -p[密码] -e "use [数据库名]; select count(*) from bloc
bash stop.sh
```

恭喜您,到以上步骤,您已经完成了数据导出组件的安装和部署。如果您还需要额外获得可视化的监控页面,请参考2.3
恭喜您,到以上步骤,您已经完成了数据导出组件的安装和部署。如果您还需要额外获得可视化的监控页面,请参考3.3章节。

#### 2.4.5 注意事项

Expand Down
30 changes: 15 additions & 15 deletions docs/WeBASE-Collect-Bee/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ spring.shardingsphere.datasource.ds.username=
spring.shardingsphere.datasource.ds.password=
#将block_detail_info取模5路由到5张表
spring.shardingsphere.sharding.tables.block_detail_info.actual-data-nodes=ds.block_detail_info_$->{0..4}
spring.shardingsphere.sharding.tables.block_detail_info.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.sharding.tables.block_detail_info.table-strategy.inline.algorithm-expression=block_detail_info_$->{block_height % 5}
spring.shardingsphere.sharding.tables.block_detail_info.key-generator-column-name=pk_id
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.actual-data-nodes=ds.block_detail_info_$->{0..4}
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.table-strategy.inline.algorithm-expression=block_detail_info_$->{block_height % 5}
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.key-generator-column-name=pk_id
```

Expand Down Expand Up @@ -211,15 +211,15 @@ spring.shardingsphere.sharding.default-database-strategy.inline.sharding-column=
spring.shardingsphere.sharding.default-database-strategy.inline.algorithm-expression=ds$->{block_height % 2}
# 定义block_detail_info的分表策略,以block_height取模2来路由到ds0的block_detail_info0或ds1的block_detail_info1
spring.shardingsphere.sharding.tables.block_detail_info.actual-data-nodes=ds0.block_detail_info0,ds1.block_detail_info1
spring.shardingsphere.sharding.tables.block_detail_info.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.sharding.tables.block_detail_info.table-strategy.inline.algorithm-expression=block_detail_info$->{block_height % 2}
spring.shardingsphere.sharding.tables.block_detail_info.key-generator-column-name=pk_id
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.actual-data-nodes=ds0.block_detail_info0,ds1.block_detail_info1
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.table-strategy.inline.algorithm-expression=block_detail_info$->{block_height % 2}
spring.shardingsphere.rules.sharding-rule.tables.block_detail_info.key-generator-column-name=pk_id
spring.shardingsphere.sharding.tables.block_task_pool.actual-data-nodes=ds0.block_task_pool0,ds1.block_task_pool1
spring.shardingsphere.sharding.tables.block_task_pool.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.sharding.tables.block_task_pool.table-strategy.inline.algorithm-expression=block_task_pool$->{block_height % 2}
spring.shardingsphere.sharding.tables.block_task_pool.key-generator-column-name=pk_id
spring.shardingsphere.rules.sharding-rule.tables.block_task_pool.actual-data-nodes=ds0.block_task_pool0,ds1.block_task_pool1
spring.shardingsphere.rules.sharding-rule.tables.block_task_pool.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.rules.sharding-rule.tables.block_task_pool.table-strategy.inline.algorithm-expression=block_task_pool$->{block_height % 2}
spring.shardingsphere.rules.sharding-rule.tables.block_task_pool.key-generator-column-name=pk_id
# 打印sql日志的开关
spring.shardingsphere.props.sql.show=true
Expand Down Expand Up @@ -286,9 +286,9 @@ spring.shardingsphere.datasource.slave0.password=
spring.shardingsphere.sharding.master-slave-rules.ds0.master-data-source-name=master
spring.shardingsphere.sharding.master-slave-rules.ds0.slave-data-source-names=slave0
spring.shardingsphere.sharding.tables.activity_activity.actual-data-nodes=ds0.block_tx_detail_info$->{0..1}
spring.shardingsphere.sharding.tables.activity_activity.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.sharding.tables.activity_activity.table-strategy.inline.algorithm-expression=block_tx_detail_info$->{block_height % 2}
spring.shardingsphere.rules.sharding-rule.tables.activity_activity.actual-data-nodes=ds0.block_tx_detail_info$->{0..1}
spring.shardingsphere.rules.sharding-rule.tables.activity_activity.table-strategy.inline.sharding-column=block_height
spring.shardingsphere.rules.sharding-rule.tables.activity_activity.table-strategy.inline.algorithm-expression=block_tx_detail_info$->{block_height % 2}
```
Expand Down

0 comments on commit fd6a2c6

Please sign in to comment.