Guest User

Untitled

a guest
Mar 20th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. static ISiloHost CreateSilo() {
  2. var builder = new SiloHostBuilder()
  3. .Configure(options => options.ClusterId = NDGConfig.ClusterId)
  4. .Configure<ProcessExitHandlingOptions>(options => options.FastKillOnProcessExit = false)
  5. .ConfigureSiloName(NDGConfig.ClusterId + "-" + NDGConfig.SiloHostName)
  6. .ConfigureEndpoints(advertisedIP: NDGConfig.SiloIP, siloPort: NDGConfig.SiloPort, gatewayPort: NDGConfig.GatewayPort, listenOnAllHostAddresses: true)
  7. .ConfigureLogging(b => b.SetMinimumLevel(LogLevel.Error).AddConsole())
  8. .UseDashboard(options => {
  9. options.Port = NDGConfig.SiloDashboardPort;
  10. options.Username = NDGConfig.SiloDashboardUsername;
  11. options.Password = NDGConfig.SiloDashboardPassword;
  12. })
  13. .UseMongoDBReminders(options => {
  14. options.ConnectionString = NDGConfig.MongoDBConnectionString;
  15. options.DatabaseName = NDGConfig.ClusterId + "-Reminders";
  16. })
  17. .UseMongoDBClustering(options => {
  18. options.ConnectionString = NDGConfig.MongoDBConnectionString;
  19. options.DatabaseName = NDGConfig.ClusterId + "-Clustering";
  20. });
  21.  
  22. MongoDBSiloExtensions.AddMongoDBGrainStorageAsDefault(builder, options => {
  23. options.ConnectionString = NDGConfig.MongoDBConnectionString;
  24. options.DatabaseName = NDGConfig.ClusterId + "-Storage";
  25. });
  26. MongoDBSiloExtensions.AddMongoDBGrainStorage(builder, "PubSubStore", options => {
  27. options.ConnectionString = NDGConfig.MongoDBConnectionString;
  28. options.DatabaseName = NDGConfig.ClusterId + "-PubSubStorage";
  29. });
  30.  
  31. return builder.Build();
  32. }
Add Comment
Please, Sign In to add comment