static void Main(string[] args) { // Removes assembly loading warninga, default folder scanned for grains. Directory.CreateDirectory("Applications"); Console.WriteLine($"Running with arguments '{string.Join("/", args)}'"); var deploymentId = "main"; var port = 30023; var proxy = 40023; if (args.Length >= 3) { deploymentId = args[0]; port = Int32.Parse(args[1]); proxy = Int32.Parse(args[2]); } SiloFactory.InitializeSilo(deploymentId, port, proxy); Console.WriteLine("Silo running:"); Console.WriteLine($"Cluster '{deploymentId}'"); Console.WriteLine($"Silo port {port}'"); Console.WriteLine($"Proxy gateway port '{proxy}'"); Console.ReadLine(); }
public void ConfigureOrleans(IServiceCollection services) { services.Configure <OrleansClusterOptions>(Configuration.GetSection("Orleans:Cluster")); services.AddSingleton <IGrainFactoryResolver, GrainFactoryResolver>(); services.AddSingleton(provider => { var options = provider.GetService <IOptions <OrleansClusterOptions> >()?.Value; return(SiloFactory.InitializeSilo(DeploymentConstants.TWO, options.Defaults.Port, options.Defaults.ProxyGatewayEndpoint.Port)); }); }
public void ConfigureServices(IServiceCollection services) { services.Configure <OrleansClusterOptions>(Configuration.GetSection("Orleans:Cluster")); services.AddSingleton <IGrainFactoryResolver, GrainFactoryResolver>(); services.AddSingleton(provider => { var options = provider.GetService <IOptions <OrleansClusterOptions> >()?.Value; return(SiloFactory.InitializeSilo(options.Globals.DeploymentId, options.Defaults.Port, options.Defaults.ProxyGatewayEndpoint.Port, clusterConfig => { clusterConfig.Globals.SetGlobals(GlobalConfiguration.LivenessProviderType.ZooKeeper, "127.0.0.1:2181", "OrleansZooKeeperUtils"); })); }); services.AddMvc(); }
public void ConfigureOrleans(IServiceCollection services) { services.Configure <SiloOptions>(Configuration); services.AddSingleton <IGrainFactoryResolver, GrainFactoryResolver>(); services.AddSingleton <SiloHost>(provider => { var options = provider.GetService <IOptions <SiloOptions> >()?.Value; return(SiloFactory.InitializeSilo(options.DeploymentId, options.Port, options.ProxyPort, clusterConfig => { clusterConfig.Globals.SetGlobals(GlobalConfiguration.LivenessProviderType.SqlServer, "Data Source=.\\SQLExpress; Database=Orleans; Trusted_Connection=True;", null); })); }); }
public void ConfigureServices(IServiceCollection services) { services.AddTransient <Serilog.ILogger>(serviceProvider => { return(new LoggerConfiguration() .ReadFrom .ConfigurationSection(Configuration.GetSection("Serilog")) .CreateLogger()); }); services.Configure <OrleansClusterOptions>(Configuration.GetSection("Orleans:Cluster")); services.AddSingleton <IGrainFactoryResolver, GrainFactoryResolver>(); services.AddSingleton(provider => { var options = provider.GetService <IOptions <OrleansClusterOptions> >()?.Value; return(SiloFactory.InitializeSilo(DeploymentConstants.ONE, options.Defaults.Port, options.Defaults.ProxyGatewayEndpoint.Port)); }); services.AddMvc(); }