应用数据清理异常

私有部署  收藏
7 / 567

参照文档配置了数据清理,但是看日志总是清理失败,请问是哪里配置不对吗
[应用数据清理 | 明道云私有部署 (mingdao.com)]

[root@localhost MDPrivateDeployment]# docker logs $(docker ps | grep dataclean | awk '{print $1}')
Start
定时清理任务,开始执行!! time :11/30/2023 02:00:00
执行时间 11/30/2023 02:00:00,删除7天之前的数据,删除应用范围: 11/23/2023 00:00:00 之前
AppActivityService_删除应用job执行异常,具体异常信息:
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "127.0.0.1:27017" }", EndPoint: "127.0.0.1:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.
---> System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
at MongoDB.Driver.Core.Connections.TcpStreamFactory.ConnectAsync(Socket socket, EndPoint endPoint, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.TcpStreamFactory.CreateStreamAsync(EndPoint endPoint, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnectionAsync(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2023-11-29T18:00:30.1127692Z", LastUpdateTimestamp: "2023-11-29T18:00:30.1127708Z" }] }.
at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)
at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterServerSelection(CancellationToken cancellationToken)
at MongoDB.Driver.MongoClient.AreSessionsSupported(CancellationToken cancellationToken)
at MongoDB.Driver.MongoClient.StartImplicitSession(CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.StartImplicitSession(CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.FindSync[TProjection](FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken) at MD.MongoDB.MongoBaseRepository`1.Find(FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)
at MD.AppActivityTask.Repositories.ApkRepository.GetAllApk(DateTime time) in /data/jenkins/workspace/private_schedulertool/MDSchedulerTools/MD.AppActivityTask/Repositories/ApkRepository.cs:line 85
at MD.AppActivityTask.Services.AppActivityService.Run(Nullable`1 startDate, Nullable`1 endDate, Boolean isPrivate) in /data/jenkins/workspace/private_schedulertool/MDSchedulerTools/MD.AppActivityTask/Services/AppActivityService.cs:line 122
定时清理任务,执行完成!! time: 11/30/2023 02:00:30

配置文件 appsettings.json

{
"WorksheetConnStr": "mongodb://127.0.0.1:27017/mdworksheet",
"MD_WSService1": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService2": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService3": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService4": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService5": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService6": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService7": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService8": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService9": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSService10": "mongodb://127.0.0.1:27017/mdwsrows",
"MD_WSLogService1": "mongodb://127.0.0.1:27017/mdworksheetlog",
"ApkConnStr": "mongodb://127.0.0.1:27017/mdapps",
"AppRoleConnStr": "mongodb://127.0.0.1:27017/mdapproles",
"MD.Worksheet.DbName": "mdworksheet",
"MD.WorksheetRow.DbName": "mdwsrows",
"DeleteDay": 7,
"DeleteRowByNomal": 1,
"DelateRowDay": 7,
"DelateRowTotal": 1000,
"Corn": "0 0 2 * * ? "
}

配置文件 dataclean.yaml

version: '3'

services:
app:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-dataclean-app:1.0.0
volumes:
- ./appsettings.json:/app/Config/appsettings.json