我们正在使用 Akka.NET 创建一个新系统,并有一个带有分片和持久性的基本集群设置。
我们使用了官方文档以及一些 Petabridge 博客文章来让分片正常工作。但是,我们遇到了一个问题,即分片超出了 SQL Server 连接池允许的最大连接数。因此,我们收到以下消息...
2017-04-20 14:04:31.433 +01:00 [警告]“超时。在从池中获取连接之前已经过了超时时间。这可能是因为所有池连接都在使用中,并且最大池大小为到达。”
我们相信当分片更新分片日志时会发生这种情况。
为什么分片模块不能正确管理其 SQL 连接?这里有配置问题吗?
发生这种错误时是否可以重试?就目前而言,我们会丢失此错误的每个实例的消息。
这是相关的HOCON
cluster.sharding {
journal-plugin-id = "akka.persistence.journal.sharding"
snapshot-plugin-id = "akka.persistence.snapshot-store.sharding"
}
persistence {
journal {
plugin = "akka.persistence.journal.sql-server"
sql-server {
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
schema-name = dbo
auto-initialize = on
}
# a separate config used by cluster sharding only
sharding {
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
auto-initialize = on
plugin-dispatcher = "akka.actor.default-dispatcher"
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
connection-timeout = 30s
schema-name = dbo
table-name = ShardingJournal
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
metadata-table-name = ShardingMetadata
}
}
snapshot-store {
sharding {
class = "Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer"
plugin-dispatcher = "akka.actor.default-dispatcher"
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
connection-timeout = 30s
schema-name = dbo
table-name = ShardingSnapshotStore
auto-initialize = on
}
}
}