
FISCO BCOS離線無網路部署安裝系列教程之WeBase v1.4.1部署安裝
章節:
第一章 FISCO BCOS離線無網路部署安裝系列教程之底層鏈的部署安裝(思路一)
第二章 FISCO BCOS離線無網路部署安裝系列教程之底層鏈的部署安裝(思路二)
第三章 FISCO BCOS離線無網路部署安裝系列教程之WeBase部署安裝
第四章 FISCO BCOS離線無網路部署安裝系列教程之區塊鏈瀏覽器部署安裝
第XX章 FISCO BCOS離線無網路部署安裝系列教程之XX部署安裝
文章目錄
- FISCO BCOS離線無網路部署安裝系列教程之WeBase v1.4.1部署安裝
- 前言
- 一、思路?
- 二、正式開始
- 1.環境介紹
- 2.下載WeBase v1.4.1相關的安裝包
- 3.把WeBase v1.4.1相關的安裝包上傳至無網路的服務器中
- 4.安裝WeBase v1.4.1相關的安裝包
- 4.1解壓離線包
- 4.2 配置安裝WeBASE-Front
- 4.3配置安裝WeBASE-Sign
- 4.4配置安裝WeBASE-Node-Manager
- 4.5配置安裝WeBASE-Web
- 總結
前言
最近經常有小伙伴問到:生產環境沒有網路怎么部署FISCO BCOS以及各種中間件呢?在網上目前也找不到相關的資料,所以這里就抽空閑時間來做一下相關的教程,方便小伙伴們快速入坑,這里以centos7.5為例、其他作業系統類似,前面的章節已經離線部署的FISCO BCOS的底層,現在我們來離線部署我們的WeBase v1.4.1
一、思路?
WeBASE管理平臺分為四個部分:節點前置,簽名服務,節點管理,WeBASE管理臺,需要手動搭建以下4給部分:
1、節點前置搭建
節點前置使用Spring Boot的JAVA后臺服務
.2、簽名服務搭建
簽名服務使用Spring Boot的JAVA后臺服務
.3、節點管理搭建
節點管理使用Spring Boot的JAVA后臺服務
4、WeBASE管理平臺
WeBASE管理臺使用框架vue-cli
需要提前準備的環境(離線安裝以下環境教程點這里):
| 環境 | 版本 |
|---|---|
| Java | JDK8或以上版本 |
| MySQL | MySQL-5.6或以上版本 |
| Nginx | nginx1.6或以上版本(本文選擇1.17.8,不是硬性要求) |
所以我們要安裝區塊鏈瀏覽器之前得先離線安裝上表中的環境,
二、正式開始
1.環境介紹
開發機(有網路,windows/mac/linux都可以):

服務器:
10.21.36.166 (無網路)

2.下載WeBase v1.4.1相關的安裝包
官方CDN加速下載地址:
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.4.1/webase-front.zip
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.4.1/webase-sign.zip
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.4.1/webase-node-mgr.zip
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.4.1/webase-web.zip
彪哥整理好的:
webase1.4.1全套安裝包.zip
3.把WeBase v1.4.1相關的安裝包上傳至無網路的服務器中

4.安裝WeBase v1.4.1相關的安裝包
4.1解壓離線包
[root@qkl-10-21-36-166 fisco]# unzip webase-deploy.zip


4.2 配置安裝WeBASE-Front
PS: 需要將節點所在目錄nodes/${ip}/sdk下的ca.crt、node.crt和node.key檔案拷貝到當前conf目錄,供SDK與節點建立連接時使用,

修改/webase-front/conf/application.yml的配置:
nodePath改為自己的環境相關的節點路徑

修改后的配置如下:
# server version
version: v1.4.1
spring:
datasource:
url: jdbc:h2:file:../h2/webasefront;DB_CLOSE_ON_EXIT=FALSE
databaseName: db
driverClassName: org.h2.Driver
serverName:
username:
password:
jpa:
database-platform: org.hibernate.dialect.H2Dialect
database: H2
openInView: false
show_sql: false
generate-ddl: true
hibernate:
ddl-auto: update
naming-strategy: org.hibernate.cfg.EJB3NamingStrategy
session:
events:
log: false
properties:
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: false
h2:
console:
enabled: true
path: /console
settings:
web-allow-others: false
trace: true
rabbitmq:
host: 127.0.0.1
port: 5672
username:
password:
virtual-host:
publisher-confirm: true
ssl:
enabled: false
http:
multipart:
max-request-size: 30MB # request max size
max-file-size: 20MB # single file size
server:
port: 5002
context-path: /WeBASE-Front
connection-timeout: 30000
tomcat:
max-threads: 200
max-connections: 10000
sdk:
orgName: orgTest
corePoolSize: 50
maxPoolSize: 100
queueCapacity: 100
timeout: 10000
keepAlive: 60
ip: 10.21.36.166
channelPort: 20200
encryptType: 0 # 0:ecdsa, 1:guomi
logging:
config: classpath:log4j2.xml
constant:
keyServer: 10.21.36.166:5004 # webase-sign服務的IP:Port(單個)
transMaxWait: 30
monitorDisk: /
monitorEnabled: true
aesKey: EfdsW23D23d3df43
nodePath: /home/node_10.21.36.166_30300
http_read_timeOut: 100000
http_connect_timeOut: 100000
# event sync map task (unit: ms)
eventRegisterTaskFixedDelay: 5000
syncEventMapTaskFixedDelay: 60000
# sync stat log data task (unit: ms)
syncStatLogTime: 5000
syncStatLogCountLimit: 10000
statLogEnabled: false
// 給權限
[root@qkl-10-21-36-166 webase-front]# chmod +x *.sh
// 啟動
[root@qkl-10-21-36-166 webase-front]# ./start.sh
===============================================================================================
Server com.webank.webase.front.Application Port 5002 ...PID(33159) [Starting]. Please check message through the log file (default path:./log/).
===============================================================================================
訪問服務測驗:

4.3配置安裝WeBASE-Sign
進入資料庫控制臺創建webase-sign的資料庫
[root@qkl-10-21-36-166 webase-front]# mysql -uroot -p
Enter password:
mysql> create database webasesign;
Query OK, 1 row affected (0.01 sec)
進入webase-sign的檔案夾.修改conf/application.yml
server:
# 本工程服務埠,埠被占用則修改
port: 5004
context-path: /WeBASE-Sign
spring:
datasource:
# 資料庫連接資訊
url: jdbc:mysql://127.0.0.1:3306/webasesign?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8
# 資料庫用戶名
username: dbUsername
# 資料庫密碼
password: dbPassword
driver-class-name: com.mysql.cj.jdbc.Driver
constant:
# aes加密key(16位),如啟用,各互聯的子系統的加密key需保持一致
aesKey: EfdsW23D23d3df43
給權限,啟動專案
[root@qkl-10-21-36-166 webase-deploy]# cd webase-sign/
[root@qkl-10-21-36-166 webase-sign]# ls
apps conf lib start.sh status.sh stop.sh
[root@qkl-10-21-36-166 webase-sign]# chmod +x *.sh
[root@qkl-10-21-36-166 webase-sign]# ./start.sh
===============================================================================================
Starting Server com.webank.webase.sign.Application Port 5004 ...PID(10471) [Starting]. Please check message through the log file (default path:./log/).
===============================================================================================
4.4配置安裝WeBASE-Node-Manager
進入資料庫控制臺創建webase-node-mgr的資料庫
[root@qkl-10-21-36-166 webase-front]# mysql -uroot -p
Enter password:
mysql> create database nodemgr;
Query OK, 1 row affected (0.01 sec)
下載資料庫腳本
https://download.csdn.net/download/ws327443752/13110232
把下載的腳本上傳至無網路的服務器中

修改webase.sh檔案配置如下(重點改資料庫鏈接配置)::
#!/bin/sh
echo -e "\n init start...."
IP=${1}
PORT=${2}
if [[ ! $IP || ! $PORT ]] ; then
echo "Usage: sh ${0} ip port"
echo "eg: sh ${0} 127.0.0.1 8501"
exit 1
fi
#dbUser
DBUSER="root"
#dbPass
PASSWD="xxx"
#dbName
DBNAME="nodemgr"
#connect to database then execute init
cat webase-sql.list | mysql --user=$DBUSER --password=$PASSWD --host=$IP --database=$DBNAME --port=$PORT --default-character-set=utf8;
if [ "$?" == "0" ]; then
echo -e "init success... \n"
else
echo -e "init fail... \n"
fi
exit
給權限,并執行腳本
[root@qkl-10-21-36-166 webase-node-mgr]# chmod +x webase.sh
[root@qkl-10-21-36-166 webase-node-mgr]# bash webase.sh 127.0.0.1 3306
進入webase-node-mgr的檔案夾.修改conf/application.yml
重點修改資料庫連接配置和IP:
# server version
version: v1.4.1
#server config
server:
port: 5001
servlet:
context-path: /WeBASE-Node-Manager
#mybatis config
mybatis:
configuration:
map-underscore-to-camel-case: true
typeAliasesPackage: com.webank.webase.node.mgr
mapperLocations: classpath:mapper/*.xml
# database connection configuration
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/nodemgr?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
username: "root"
password: "xxxxxxxxxxxx"
initialSize: 10
minIdle: 5
maxActive: 30
aop:
proxy-target-class: true
#log config
logging:
config: classpath:log/log4j2.xml
level:
com.webank.webase.node.mgr: info
#constants
constant:
###http request
# login's authorization
isUseSecurity: true
# verification code expire time (s)
verificationCodeMaxAge: 300
# if disabled as false
enableVerificationCode: true
# verification code solid value, only when enableVerificationCode is false works
verificationCodeValue: "8888"
# auth token code expire time (s)
authTokenMaxAge: 1800
ignoreCheckFront: /account/login,/account/pictureCheckCode,/login,/user/privateKey,/front/new,/front/find,,/group/generate,/group/start
###front http request
frontUrl: http://%1s:%2d/WeBASE-Front/%3s
httpTimeOut: 5000
contractDeployTimeOut: 30000
isPrivateKeyEncrypt: true
maxRequestFail: 3
sleepWhenHttpMaxFail: 60000
###common
developerModeEnable: false
isDeleteInfo: true
transRetainMax: 10000
deleteInfoCron: "0 0/1 * * * ?"
statisticsTransDailyCron: "0 0/1 * * * ?"
resetGroupListCycle: 600000
groupInvalidGrayscaleValue: 1M # y:year, M:month, d:day of month, h:hour, m:minute, n:forever valid
notSupportFrontIp:
###block info (pulling data from chain)
isBlockPullFromZero: false
pullBlockInitCnts: 1000
pullBlockSleepTime: 200
pullBlockTaskFixedDelay: 30000
blockRetainMax: 10000
###transaction monitor
transMonitorTaskFixedRate: 60000 #How long does it take to start the next task after the end (second)
analysisSleepTime: 200
monitorInfoRetainMax: 10000
isMonitorIgnoreUser: false
isMonitorIgnoreContract: false
monitorUnusualMaxCount: 20
###alert mail monitor task interval: 5mins unit: ms
auditMonitorTaskFixedDelay: 300000
nodeStatusMonitorTaskFixedDelay: 60000 #must larger than @pullBlockTaskFixedDelay
certMonitorTaskFixedDelay: 300000
permitUrlArray: /account/login,/account/pictureCheckCode,/login,/user/privateKey/**,/encrypt,/version,/front/refresh
#### 1.4.0 visual deploy
#### deployType 部署方式:
# 0, 先使用 build_chain.sh 部署鏈并啟用 WeBASE-Front 服務,然后手動添加前置;
# 1, 使用可視化部署, 需要參考WeBASE檔案填寫下面引數
deployType: 0
#### if deployType = 0, ignore below properties ####
# 鏡像名
dockerRepository: "fiscoorg/fisco-webase"
# WeBASE-Sign 訪問地址
webaseSignAddress: "10.21.36.166:5004"
# 部署區塊鏈服務的節點主機存放節點組態檔和資料的目錄
rootDirOnHost: "/opt/fisco"
# SSH 免密登錄的賬號
sshDefaultUser: root
# SSH 服務的埠,默認 22
sshDefaultPort: 22
#### if deployType = 0, ignore upper properties ####
sdk:
# 加密型別:0: 非國密; 1: 國密
encryptType: 0
# executor config for async pulling data from chain
executor:
corePoolSize: 3
maxPoolSize: 10
queueSize: 50
threadNamePrefix: "node-mgr-async-"
# scheduler config for sync scheduled task
scheduler:
poolSize: 50
threadNamePrefix: "node-mgr-task-"
awaitTerminationSeconds: 600
waitForTasksToCompleteOnShutdown: true
給權限,啟動專案
[root@qkl-10-21-36-166 webase-deploy]# cd webase-node-mgr/
[root@qkl-10-21-36-166 webase-node-mgr]# ls
apps conf lib script start.sh status.sh stop.sh
[root@qkl-10-21-36-166 webase-node-mgr]# chmod +x *.sh
[root@qkl-10-21-36-166 webase-node-mgr]# ./start.sh
===============================================================================================
Server com.webank.webase.node.mgr.Application Port 5001 ...PID(33541) [Starting]. Please message check through the log file (default path:./log/).
===============================================================================================
4.5配置安裝WeBASE-Web
WeBASE-Web是基于vue的web,所以只需配置nginx即可跑起來
PS: 因為我們的服務器已有nginx,可在原組態檔nginx.conf增加一個server:
upstream node_mgr_server{
server 10.21.36.166:5001; # 節點管理服務ip和埠
}
server {
listen 5000 default_server; # 前端埠(埠需要開通策略且不能被占用)
server_name 10.21.36.166; # 服務器ip,也可配置為域名
location / {
root /fisco/webase-deploy/webase-web; # 前端檔案路徑(檔案需要有權限訪問)
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
include /etc/nginx/default.d/*.conf;
location /mgr {
proxy_pass http://node_mgr_server/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
檢查webase


檢查后發現正常,后續配置相關配置即可,本文重點是離線安裝而不是配置,所以不做過多的演示!
有需要的可以參考官方的檔案:https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE-Console-Suit/index.html#id16
總結
無網路離線安裝部署FISCO BCOS 中間件webase平臺,還是比較簡單 ,大家可以安裝教程一步一步的操作,希望可以幫助有需要的小伙伴快速入坑!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/224131.html
標籤:其他
