หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Deploying the Application

Updated on 2023-01-16 GMT+08:00

This section describes how to deploy the application.

Deploying the Application

  1. To obtain the image, go to the BCS console and choose Use Cases. Download Bank_Image in the SDK Demo for a Bank Consortium Blockchain area.
  2. Ensure that the docker and unzip commands exist before logging in to ECS.

    Run the cd /root/bankuniondemo command to upload the downloaded image to the directory.

    Run the vi startserver.sh command to create the startserver.sh file. Add the following content to the startserver.sh file and save the file:

    #!/bin/sh
    # Obtain the current path.
    path=`pwd`
    # Obtain the IP address.
    localip=`ifconfig eth0 | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}'`
    
    # Check whether unzip and docker commands exist.
    if type unzip > /dev/null 2>&1; then
        echo "Unzip command is exists!"
    else
        echo "No unzip command, please install unzip before start this demo"
        exit 1
    fi
    
    if type docker > /dev/null 2>&1; then
        echo "Docker exists!"
    else
        echo "No docker, please install docker before start this demo"
        exit 1
    fi
    
    # Check whether the certificate directory exists.
    if [ -e ./crypto ];then
    rm -rf crypto
    fi
    
    # Decompress the certificate file.
    echo "Start unziping certificate ...."
    
    cerzip=$(ls|grep .zip)
    for i in $cerzip;
    do
    unzip -n $i -d crypto/
    done
    echo "Unzip certificate Done!!"
    
    # Configure the certificate path.
    Folder="$path/crypto"  
    for file in ${Folder}/*
    do  
        temp_file=`basename $file`  
    
        mv -f $path/crypto/$temp_file/* $path/crypto/
    done
    
    # Check whether the required certificate files are ready.
    echo "Start checking if the required files are ready"
    if [ -e $path/democraticBank.yaml ]&&[ -e $path/civilizationBank.yaml ]&&[ -e $path/harmoniousBank.yaml ];then
    echo "Check required yaml files OK!!"
    else
    echo "Please check if the required yaml files are ready!!"
    exit
    fi
    
    # Restart the system if the password is forgotten.
    read -p "Is this the first time you deploy the application? If yes please insert 'y', if you want to reset your password please insert 'n': " choice
    echo $choice
    if [ $choice = "n" ];then
    docker rm $(docker stop $(docker ps -a -q --filter ancestor=bank --format="{{.ID}}"))
    echo "Resetting password..."
    fi
    
    # Set the password.
    read -p "Please set your password: " test
    echo $test
    if [ ${#test} -lt 4 -o ${#test} -gt 24 ];then echo "password length should in [4, 24].";exit;fi
    
    #load images
    if [ -e $path/bankv3.tar.gz ];then
    echo "Start loading images..."
    docker load -i bankv3.tar.gz
    echo "Api-server images is exists,Skip load!"
    fi
    
    # Start the service.
    echo "Start server ....."
    docker run --env TESTPWD=$test -p 8080:8080 -d -it -v $path/crypto:/opt/bank/src/bank/conf/crypto -v $path/democraticBank.yaml:/opt/bank/src/bank/conf/democraticBank.yaml -v $path/harmoniousBank.yaml:/opt/bank/src/bank/conf/harmoniousBank.yaml -v $path/civilizationBank.yaml:/opt/bank/src/bank/conf/civilizationBank.yaml bank
    
    RET_CODE=`echo $?`
    if [ $RET_CODE -eq 0 ]; then 
         echo "Start server success!"
         echo -e "please login \033[32mhttp://EIP:8080/adminLogin \033[0mto visit Bank Management System"
         echo -e "or login \033[32mhttp://EIP:8080/userLogin \033[0mto visit Bank Customer System"
    else
         echo "Failed to start server! Please check if everything ok"
    fi

    Run the following script:

    bash startserver.sh

  3. After you see "Is this the first time you deploy the application?", enter y for yes, or enter n if you want to change the password. Then, insert your password (123456 is used as an example in the following figure).

    The command output is similar to the following:

    Figure 1 Command output

  4. Run the following command to check whether the container has started:

    docker ps

    If the following information is displayed, the container has started. Otherwise, check the configuration.

    Figure 2 Message displayed

Adding a Security Group

  • If you deploy the bankuniondemo application on your own server, skip this procedure.
  • If you deploy the bankuniondemo application on an ECS on Huawei Cloud, create a security group and then add security group rules to enable access to port 8080 of the server. For details, see Creating a Security Group. Table 1 describes the security group rule.
    Table 1 Parameters of a security group rule

    Parameter

    Setting

    Description

    Protocol

    Select TCP.

    Specifies the network protocol.

    Direction

    Set the inbound rules.

    Specifies the direction in which the security group rule takes effect. Inbound rules control external access to the ECS.

    Port number range

    Create a rule, and set the port to 8080.

    Specifies the port range for which a rule takes effect.

    Source

    Select IP Address, and enter 0.0.0.0/0.

    This parameter is required for inbound rules.

  • The EIP must be the IP address of the server where the bankuniondemo application is deployed or the EIP of the ECS.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback