Server Installation and Service » Historie » Revize 35
« Předchozí |
Revize 35/36
(rozdíl)
| Další »
Eliška Mourycová, 2021-06-13 12:46
Server Installation¶
The server runs on Debian 10 VM at https://nuada.zcu.cz/
The ip of the machine is 147.228.173.54
The application was tested on a machine with the following specs:
Hardware requirements¶
- RAM size
- 768 MB
- Disk size
- 4 GB
- CPU architecture
- x86_64
Software requirements¶
- OS, OS version
- OS: Debian GNU/Linux 10, version 10.9
Deploying the Server Application¶
Building the project¶
At the moment, the easiest way to build the project is to build it locally in Windows with the following commands:
open windows command line (cmd.exe) in the directory where the solution file is located. Please make sure you can run `dotnet` command from the cmd. Make sure you have the right SDK on your system:
dotnet --list-sdks
Version 5.0 is needed to build the project. If you have this version, you can build the project:
dotnet publish --runtime=linux-x64 ServerApp.sln
The built project files are in folder:
.\ServerApp\bin\Debug\net5.0\linux-x64\publish
Note¶
The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space.
Uploading the project to the remote machine¶
Upload the whole folder built with the commands below:
scp -r /pathToFolder/publish root@{machine_ip}:/<path>/
You can also upload the default configuration file:
scp /path/server_config root@{machine_ip}:/<path>/
Server Configuration File
(See also Project architecture)¶
The configuration file must contain the following lines:
- Site for OpenData (site)
- Data files naming convention (naming_convention)
- Root directory where data files are saved (data_root_dir)
- Port (port)
- Site for weather prediction (weather_site)
These lines must be followed by lines containing the desired values.
Default setting of the config file is as follows:
Site for opendata¶
The site configuration specifies the website where the UWB open data can be downloaded.
It is by default set to http://openstore.zcu.cz/
naming_convention¶
The naming convention specifies how the archives available for download are named.
It is by default set to OD_ZCU_{type}_{month}_{year}_{format}.zip
Variables in this string must keep their name, cannot be excluded and others cannot be added. They must be enclosed in {} brackets.
{} characters are treated as special characters and cannot be used as a part of the name.
data_root_dir¶
The data root directory specifies where the downloaded data will be stored. In this root directory subdirectories are automatically created for individual data types.
It is by default set to ./data/auto. The path is relative to the config file's path.
Note: It is preferable for you to use linux style directory separator characters when configuring this path, i.e. '/'. Windows style might not create the (sub)directories as you would expect, however it would not hinder the server's functionality in any way.
port¶
The port specifies the port number at which the part of the server listens for clients' connections.
It is by default set to 10000
site for weather prediction¶
Furthermore the configuration file can contain link to the site from which the weather prediction is downloaded. Used link must lead to a page with a json file in format that satisfies the format specified on page Data file structure
It is by default set to http://wttr.in/Plzen,czechia?format=j1
Running the server¶
- A .p12 certificate file named cert.p12 must exist in the directory where the app is launched
- We used this one, see the attached file: cert.p12
Firstly you most grant permission to run the executable:
chmod +x <path>/ServerApp
Then you can run the server:
<path>/ServerApp <args>
The path to the server configuration file must be passed as (the only) argument to the application.
Important Notes¶
- The shell from which the server application was started must remain open for as long as the server runs. The server does not get forked into background in any way.
- The server app must be launched from a directory where all the needed binaries (located in the publish directory when built) are located.
Admin Commands¶
List of Available Commands¶
While the server is running, you can type commands into the console. The available commands are as follow:- data [OPTION] [DATE]...
- Description: Capable of showing saved data files and downloading new ones.
- -list: Lists currently saved data files. This list does not have to match the files which any of the predictors is trained on!
- Example: data -list
- -dl [startDate] [endDate]: Downloads jis, login and weather files from a specified time span. Both [startDate] and [endDate] are inclusive. Date format must be entered as [month]-[year].
- Example: data -dl 1-2019 12-2020
- model [OPTION]
- Description: Capable of retraining the prediction model, going back to the previous version and listing files on which the predictor was trained.
- -files: Lists the data files on which the currently used model was trained.
- Example: model -files
- -retrain: Retrains the model using the files currently saved in the data directory.
- Example: model -retrain
- -rollback: Switches the model back to the previous version.
- Example: model -rollback
- help
- Description: Lists available commands and their description.
Input of Admin Commands¶
The commands can be input by simply typing into the shell where the server is running.
Logging¶
The server logs information about its activity to a file named server.log located in the director where the server was launched.
It also creates 2 backup log files.
The logging configuration can be modified in
<path>\Server\ServerApp\App.config
By default, the application does not print logs to the console, this can be changed by modifying the following attribute in the App.config file:
Change
<root> <level value="ALL" /> <appender-ref ref="LogFileAppender" /> </root>
To
<root> <level value="ALL" /> <appender-ref ref="LogFileAppender" /> <appender-ref ref="ConsoleAppender" /> </root>
Other parameters can also be configured, see https://logging.apache.org/log4net/release/manual/configuration.html for more details.
Aktualizováno uživatelem Eliška Mourycová před více než 3 roky(ů) · 35 revizí