- Notifications
You must be signed in to change notification settings - Fork7
BSN Spartan Data Center System
License
BSN-Spartan/Data-Center-System
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This document is a guide to install, configure and run the Data Center System of the BSN Spartan Network. This local system will help users manage their data centers and manage nodes and NTT. The system only interacts with installed full nodes of Non-Cryptocurrency Public Chains on Spartan Network, and never connects to any external third-party systems.
As a clear demonstration, all commands in this document are run with root permission. These commands can also be run under normal user permissions, please set the file storage and configure the parameters properly.
It is recommended to build the Data Center Management System on Linux Server with the following requirements:
- 2 CPU
- Memory: 4GB
- Disk: 25GB SSD
- Bandwidth: 20Mbps
- 4 CPU
- Memory: 16GB
- Disk: 50GB SSD
- Bandwidth: 20Mbps
Software | Version |
---|---|
Java | 1.8+ |
MySQL | 5.7+ |
Jar (Optional) | - |
Docker-ce (Optional) | 20.10.0+ |
Docker-compose (Optional) | 1.25.5+ |
Spartan-I Chain Default Node | - |
Make sure you have installed MySQL 5.7 or later version in your system. You can go toMySQL official website to learn how to install MySQL on Linux.
mysql -V
Getmysql script
Login to MySQL service, name and create the database:
CREATEDATABASEbsn_spartan_dc DEFAULT CHARACTERSET utf8 COLLATE= utf8_general_ci;
Execute sql script to initialize the table:
use bsn_spartan_dc;
Execute the rest commands in sequence. Then, check the table structure:
show tables;
Download thepackage of the Data Center Management System. You can also download the source code on this page and compile it by yourself.
Download the configuration files, includingapplication.yml,application-prod.yml andlogback-spring.xml.
Change the default login account information
If the database has never been initialized with any account before, the service will be initialized with this information when started:
system:adminName:adminadminEmail:spartan_example@hotmail.comdefaultPassword:password
Configure the data source
server:# Specify the port that runs the Data Center Systemport:8085mysql:# Specify the IP address, port number and the name of your databasewrite_url:jdbc:mysql://database-IP:port/db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&allowMultiQueries=true&useSSL=false# Enter the login name of the databasewrite_username:db_username# Enter the passwordwrite_password:db_password# Specify the IP address, port number and the name of your databaseread_url:jdbc:mysql://database-IP:port/db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&allowMultiQueries=true&useSSL=false# Enter the login name of the databaseread_username:db_username# Enter the passwordread_password:db_password
Example:
Configure the node information
chain:# Default Node's JSON-RPC interface (--http.port) of Spartan-I ChainnodeRpcAddress:"http://node-IP:node-rpc-port"# Default Chain's network ID, do not change this configurationchainId:9090# Query the transaction pool's waiting time: millisecond, recommended 1.5 secondstxPoolSleep:1500# Change the path of the Keystore file to a designated directorywalletFilePath:"your-directory/wallet"# The system will parse events from all blocks after this block height. This number is recommended to be set as the latest block height of the Default Chain before the Data Center System started. For example: blockHeight: 270441# You can get the block height from the blockchain explorer: https://spartanone.bsn.foundationblockHeight:block_height
Example:
Configure Kong gateway
Configure the username and password of Kong gateway
kongGateWayConfig:# Username configured in the operations and maintenance systemusername:username# Password configured in the operations and maintenance systempassword:password
Here we start the service in two ways, you may choose one of them that fits your requirement.
Make sure Java 1.8 or later version has been installed in your system.
java -version
PutData-Center-System-1.3.1.jar
,application.yml
,application-prod.yml
andlogback-spring.xml
files into the same directory and run the command below:
java -jar Data-Center-System-1.3.1.jar --spring.config.location=./application.yml --spring.config.location=./application-prod.yml --logging.config=./logback-spring.xml - LANG=zh_CN.UTF-8
After starting up the Data Center System, you may find the "the basic information of data center is not configured" error message in the process. You need to configure the information after logging into the system.
If you would like to run the node in the backend system, you can runnohup
command as follow:
nohup java -jar Data-Center-System-1.3.1.jar --spring.config.location=./application.yml --spring.config.location=./application-prod.yml --logging.config=./logback-spring.xml - LANG=zh_CN.UTF-8 > output.log 2>&1 &
You can also check the process from the log:
tail -f output.log
To stop the service innohup
mode, please refer to the below command:
# Check the PID of the serviceps -ef| grep java# Stop the service, change "PID" to the correct numberkill -9 PID
- Create a new directory
bsn/spartan
under the root directory:
mkdir /bsn/spartan
- Go to directory
bsn/spartan
:
cd /bsn/spartan
- Create and edit file
docker-compose.yaml
:
vim docker-compose.yaml
- Copy below content to file
docker-compose.yaml
:
version:'3'services:spartan-dc:container_name:spartan-dcimage:bsnspartan/jre1.8:centos7.9restart:alwaysports: -"8085:8085"volumes: -./pkg:/bsn/spartan/pkg -./logs:/bsn/spartan/logs#This directory must be the same with logPath in logback-spring.xml -./conf:/bsn/spartan/conf -./wallet:/bsn/spartan/wallet -/etc/hosts:/etc/hostsentrypoint:java -jar ./pkg/Data-Center-System-1.3.1.jar --server.port=8085 --spring.config.location=./conf/application.yml --spring.config.location=./conf/application-prod.yml --logging.config=./conf/logback-spring.xml --logging.logpath=./logs
Create a directory
/bsn/spartan/conf
and putapplication-prod.yml
,application.yml
,logback-spring.xml
into it.Create a directory
/bsn/spartan/pkg
and putData-Center-System-1.3.1.jar
into it.Return to the directory
/bsn/spartan
and start the service:
cd ..docker-compose up -d
After successfully starting the service, the Data Center Operator can access the system fromhttp://server_IP:server_port
. Theserver_port
is refering to the port inapplication-prod.yml
.
Before using the System, the Data Center Operator should go to theSpartan Official Website to register a new data center.
Please refer to theBSN Spartan Network User Manual for detailed instructions.
After deploying and running the Data Center Management System, Data Center Operators can deploy Kong Gateway service to manage end-user's network access. This is not a mandatory step if the Data Center Operator just wants to run the DC for his/her own system. However, for better protection of the node, we encourage all Data Center Operators to install and run the Kong Gateway. Click to see more information ofData Center Gateway Deployment.
Data Center Service Providers can build portals to serve their end-users. Here is a template of the deployment ofBSN Spartan Network Data Center Portal.
If you have already installed the Data Center Management System with the previous version, you can upgrade it to the latest one.
Please find the upgrade instructions intags that matches the version of your Data Center Management System.
About
BSN Spartan Data Center System
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.