public override void Run()
        {
            try
            {
                var configTasks = new Task[] { javaManager.EnsureConfigured(), elasticsearchManager.EnsureConfigured(), pluginManager.EnsureConfigured() };
                Trace.TraceInformation("Attempting to configure node: {0}", nodeName);
                Task.WaitAll(configTasks, cancellationTokenSource.Token);

                //Copies the elastic search plugins to the plugin folder
                pluginManager.CopyAndExtractPluginsToElasticFolder();
                //Start discovery helper (non blocking)
                bridge.StartService();

                var javaHome = javaManager.GetJavaHomeFromReg();
                Trace.TraceInformation("Attempting to start elasticsearch as node: {0} with JAVA_HOME =  ", nodeName, javaHome);
                elasticsearchManager.StartAndBlock(cancellationTokenSource.Token, javaHome);
            }
            catch (AggregateException ae)
            {
                foreach (var ex in ae.InnerExceptions)
                {
                    Trace.TraceError(ex.Message + " : " + ex.StackTrace);
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.Message + " : " + e.StackTrace);
            }
            finally
            {
                this.runCompleteEvent.Set();
            }
        }
Пример #2
0
        public void RunAndBlock()
        {
            try
            {
                var configTasks = new Task[]
                {
                    _JavaManager.EnsureConfigured(),
                    _ElasticsearchManager.EnsureConfigured()
                };

                Trace.TraceInformation("Attempting to configure node: {0}", _Settings.NodeName);
                Task.WaitAll(configTasks, _CancellationTokenSource.Token);

                //Start discovery helper (non blocking)
                _Bridge.StartService();

                //Bootstrap data if configured (non blocking)
                _Bootstraper.StartService();


                var javaHome = _JavaManager.GetJavaHomeFromReg();
                Trace.TraceInformation("Attempting to start elasticsearch as node: {0} with JAVA_HOME = {1}", _Settings.NodeName, javaHome);
                _ElasticsearchManager.StartAndBlock(_CancellationTokenSource.Token, javaHome);
            }
            catch (AggregateException ae)
            {
                foreach (var ex in ae.InnerExceptions)
                {
                    Trace.TraceError(ex.Message + " : " + ex.StackTrace);
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.Message + " : " + e.StackTrace);
            }
            finally
            {
                this._RunCompleteEvent.Set();
            }
        }