4、部署后端代码
拷贝后端包压缩文件(命名为v3_linux_netcore.zip,要是完整的后端包,包含配置文件。问研发人员要。),放到服务器上目录/root下,
终端中执行如下命令
cd /root
unzip -o -d /root/publish v3_ linux_netcore.zip
通过命令部署,终端中执行:
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
cd /root/publish
vim appsettings.json
编辑配置文件,保证配置文件准确
dotnet Uanue.WebApi.dll --urls=http://*:8082 我执行了上面的步骤后,出现了下面的情况:root@Kylin-pc:~/publish# dotnet Uanue.WebApi.dll --urls=http://*:8082
SQL:SELECT DBSERVER_DBID as id,DBSERVER_CONN as text FROM DBSERVER
错误:Connect Timeout expired.
跟踪: at Uanue.Core.Dapper.SqlDapper.Execute[T](Func`3 func, Boolean beginTransaction, Boolean disposeConn) in D:\新SVNCode\UnattendedWeighing\国能陈家港\国产化\UTO-NetCore-Core_KB\Uanue.Core\Dapper\SqlDapper.cs:line 606
at Uanue.Core.Dapper.SqlDapper.QueryList[T](String cmd, Object param, Nullable`1 commandType, Boolean beginTransaction) in D:\新SVNCode\UnattendedWeighing\国能陈家港\国产化\UTO-NetCore-Core_KB\Uanue.Core\Dapper\SqlDapper.cs:line 216
内部错误:Connect Timeout expired.
内部跟踪错误: at MySqlConnector.Core.ServerSession.OpenTcpSocketAsync(ConnectionSettings cs, ILoadBalancer loadBalancer, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 1046
at MySqlConnector.Core.ServerSession.ConnectAsync(ConnectionSettings cs, MySqlConnection connection, Int64 startingTimestamp, ILoadBalancer loadBalancer, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 425
at MySqlConnector.Core.ConnectionPool.ConnectSessionAsync(MySqlConnection connection, Action`4 logMessage, Int64 startingTimestamp, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 428
at MySqlConnector.Core.ConnectionPool.ConnectSessionAsync(MySqlConnection connection, Action`4 logMessage, Int64 startingTimestamp, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 433
at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int64 startingTimestamp, Int32 timeoutMilliseconds, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 111
at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int64 startingTimestamp, Int32 timeoutMilliseconds, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 144
at MySqlConnector.MySqlConnection.CreateSessionAsync(ConnectionPool pool, Int64 startingTimestamp, Activity activity, Nullable`1 ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlConnection.cs:line 919
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://[::]:8082
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /root/publish
这是什么情况?怎么解决?
最新发布