예제 #1
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");

            var config = AzureSilo.DefaultConfiguration();

            config.AddMemoryStorageProvider();
            config.Defaults.DefaultTraceLevel = Orleans.Runtime.Severity.Verbose;
            //options.ClientConfiguration.DefaultTraceLevel = Orleans.Runtime.Severity.Verbose3;
            //config.Defaults.TraceToConsole = true;

            // First example of how to configure an existing provider
            Example_ConfigureExistingStorageProvider(config);
            Example_ConfigureNewStorageProvider(config);
            Example_ConfigureNewBootstrapProvider(config);

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            orleansAzureSilo = new AzureSilo();
            bool ok = orleansAzureSilo.Start(config);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #2
0
        public override bool OnStart()
        {
            Trace.WriteLine("Starting Role Entry Point");

            silo = new AzureSilo();

            return(silo.Start());
        }
예제 #3
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            cloudSilo = new AzureSilo();
            var success = cloudSilo.Start();

            return(success);
        }
예제 #4
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-Run Starting Orleans silo", "Information");
            bool ok = orleansAzureSilo.Start(this.clusterConfiguration);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #5
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            Trace.WriteLine("Starting Role Entry Point");

            silo = new AzureSilo();

            return(silo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance));
        }
예제 #6
0
        public override void Run()
        {
            var config = AzureSilo.DefaultConfiguration();

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            silo = new AzureSilo();
            bool isSiloStarted = silo.Start(config);

            silo.Run(); // Call will block until silo is shutdown
        }
예제 #7
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

            silo = new AzureSilo();

            return(silo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance));
        }
예제 #8
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            orleansAzureSilo = new AzureSilo();
            bool ok = orleansAzureSilo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #9
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

            orleansAzureSilo = new AzureSilo();

            bool result = base.OnStart();

            if (result)
            {
                result = orleansAzureSilo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance);
            }

            Trace.TraceInformation("FDD.OrleansGPSTracker.OrleansSilo has been started (result={0})", result);

            return(result);
        }
예제 #10
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");

            var config = new ClusterConfiguration();

            config.LoadFromFile("OrleansConfiguration.xml");

            // insert the ClusterId based on the cloud configuration
            config.Globals.ClusterId = CloudConfigurationManager.GetSetting("ClusterId");

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            orleansAzureSilo = new AzureSilo();
            bool ok = orleansAzureSilo.Start(config);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #11
0
        public override void Run()
        {
            Trace.TraceInformation("OrleansWorker is running");

            try
            {
                var config = new ClusterConfiguration();
                config.StandardLoad();
                ConfigureStorageProvider(config);
                _silo = new AzureSilo();
                var isSiloStarted = _silo.Start(config);
                if (isSiloStarted == false)
                {
                    Trace.TraceError("OrleansWorker.Run() -Error in starting silo");
                }
                _silo.Run();
            }
            finally
            {
                this._manualResetEvent.Set();
            }
        }
예제 #12
0
        public override void Run()
        {
            Log.Trace();

            try {
                var siloConfig = AzureSilo.DefaultConfiguration();

                // Silo timeout is substantially longer than client timeout to allow sync to wait.
                siloConfig.Globals.ResponseTimeout = SiloRequestTimeout;

                // This allows App Services and Cloud Services to agree on a deploymentId.
                siloConfig.Globals.DeploymentId = _config.DeploymentId;

                // Add custom JSON.Net object serialization
                siloConfig.Globals.SerializationProviders.Add(typeof(JsonObjectSerializer).GetTypeInfo());

                // Ensure exceptions can be serialized
                siloConfig.Globals.FallbackSerializationProvider = typeof(ILBasedSerializer).GetTypeInfo();

                // Dependency Injection
                siloConfig.UseStartupType <ShipStartupProvider>();

                siloConfig.AddAzureTableStorageProvider("AzureStore", _config.DataConnectionString);

                // It is IMPORTANT to start the silo not in OnStart but in Run.
                // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
                _silo = new AzureSilo();
                _silo.Start(siloConfig);

                // Block until silo is shutdown
                _silo.Run();
            } catch (Exception e) {
                e.Report("Error while running silo. Aborting.");
            }

            Log.Info("Run loop exiting.");
        }
예제 #13
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");

            var config = new ClusterConfiguration();

            config.StandardLoad();

            // First example of how to configure an existing provider
            //ConfigureExistingStorageProvider(config);
            //ConfigureNewStorageProvider(config);
            //ConfigureNewBootstrapProvider(config);

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            orleansAzureSilo = new AzureSilo();
            bool ok = orleansAzureSilo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance, config);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #14
0
        public override void Run()
        {
            var env = RoleEnvironment.GetConfigurationSettingValue("Environment");

            if (string.IsNullOrEmpty(env))
            {
                throw new InvalidOperationException("Unable to determine environment.");
            }
            var config = ConreignSiloConfiguration.Load(Environment.CurrentDirectory, env);

            config.ClusterId  = RoleEnvironment.DeploymentId;
            config.InstanceId = RoleEnvironment.CurrentRoleInstance.Id;
            var app = ConreignSilo.Create(config);
            var orleansConfiguration = app.CreateOrleansConfiguration();

            _silo = new AzureSilo();
            var started = _silo.Start(orleansConfiguration, app.Configuration.SystemStorageConnectionString);

            if (!started)
            {
                throw new InvalidOperationException("Silo was not started.");
            }
            _silo.Run();
        }
예제 #15
0
        private void Run(CancellationToken cancellationToken)
        {
            try
            {
                var config = new ClusterConfiguration();
                //config.StandardLoad();

                if (RoleEnvironment.IsEmulated)
                {
                    config.LoadFromFile(@"OrleansLocalConfiguration.xml");
                }
                else
                {
                    config.LoadFromFile(@"OrleansConfiguration.xml");
                }

                var ipAddr = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["OrleansSiloEndPoint"].IPEndpoint.Address.ToString();
                Environment.SetEnvironmentVariable("MyIPAddr", ipAddr);

                var instanceCount = RoleEnvironment.CurrentRoleInstance.Role.Instances.Count;
                Environment.SetEnvironmentVariable("MyInstanceCount", instanceCount.ToString());

                this.instances = instanceCount;

                // TODO: Delete Orleans Tables
                // To avoid double delete, check for existence
                //CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("DataConnectionString"));
                //table = tableClient.GetTableReference("OrleansGrainState");
                //table.DeleteIfExists();
                // Create the table client.
                //CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

                //CloudTable table = tableClient.GetTableReference("OrleansSiloStatistics");
                //table.DeleteIfExists();

                //CloudTable  table = tableClient.GetTableReference("OrleansClientStatistics");
                //table.DeleteIfExists();

                // It is IMPORTANT to start the silo not in OnStart but in Run.
                // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
                orleansAzureSilo = new AzureSilo();
                var ok = orleansAzureSilo.Start(config);

                if (ok)
                {
                    Trace.TraceInformation("OrleansWorkerRole-OnStart Orleans silo started ok=" + ok, "Information");
                    Trace.TraceInformation("OrleansWorkerRole is running");

                    LogAnalysisVariables();

                    orleansAzureSilo.Run();                     // Call will block until silo is shutdown

                    Trace.TraceInformation("OrleansWorkerRole stop running");
                    WriteToTempFile("OrleansWorkerRole stop running");
                    //SaveErrorToBlob("Orleans Silo stops!");
                }
                else
                {
                    Trace.TraceError("Orleans Silo could not start");
                    WriteToTempFile("Orleans Silo could not start");
                    //SaveErrorToBlob("Orleans Silo could not start");
                }
            }
            catch (Exception ex)
            {
                while (ex is AggregateException)
                {
                    ex = ex.InnerException;
                }
                Trace.TraceError("Error during initialization of OrleansWorkerRole {0}", ex.ToString());
                var excString = ex.ToString();
                WriteToTempFile(excString);
                //SaveErrorToBlob(excString);
                throw ex;
            }
        }
예제 #16
0
 internal void Start()
 {
     host.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance, cluster.Configuration);
 }
예제 #17
0
 internal void Start()
 {
     host.Start(cluster.Configuration, deploymentId, connectionString);
 }
예제 #18
0
 internal void Start()
 {
     host.Start(cluster.Configuration);
 }