Beispiel #1
0
        public void HadoopRequirements(PowershellCommand ps, string host, int threadId)
        {
            //Console.WriteLine(host + " " + (threadId - Configuration.Hostnames.Count()).ToString());
            Console.WriteLine("Starting installation on host " + host);
            Global.AppInstallCursorPosition.Add(host, Console.CursorTop - 1);
            System.Threading.Thread.Sleep(Global.Hostnames.Count() + 2000);

            Console.SetCursorPosition(0, Global.AppInstallCursorPosition[host]);
            Console.WriteLine(host + " - Installing Python and setting Environmental variables                      ");
            ps.ExecuteRemote(host, PowershellCommandString.PythonInstall);

            Console.SetCursorPosition(0, Global.AppInstallCursorPosition[host]);
            Console.WriteLine(host + " - Installing Visual C++ Redistributable                                      ");
            ps.ExecuteRemote(host, PowershellCommandString.VisualCInstall);

            Console.SetCursorPosition(0, Global.AppInstallCursorPosition[host]);
            Console.WriteLine(host + " - Installing Java and setting Environmental variables                        ");
            ps.ExecuteRemote(host, PowershellCommandString.JavaInstall);

            Console.SetCursorPosition(0, Global.AppInstallCursorPosition[host]);
            Console.WriteLine(host + " - Installing HDP. This may take a minute or two                              ");
            ps.ExecuteRemote(host, PowershellCommandString.HDPInstall);
            Console.SetCursorPosition(0, Global.AppInstallCursorPosition[host]);
            ConsoleText.Green(host + " - Installation completed!                                                    ");
        }
Beispiel #2
0
 public static void Hadoop(PowershellCommand ps, string host)
 {
     try
     {
         ps.ExecuteRemote(host, PowershellCommandString.HDPPorts(false));
         ps.ExecuteRemote(host, PowershellCommandString.HDPUninstall);
         ps.ExecuteRemote(host, PowershellCommandString.RemoveJavaEnVar);
         ps.ExecuteRemote(host, PowershellCommandString.RemovePythonEnVar);
         ps.ExecuteRemote(host, PowershellCommandString.DeleteDirectory(Configuration.HDPDir));
         ps.ExecuteRemote(host, PowershellCommandString.DeleteDirectory(Global.ClusterProperties["HDP_LOG_DIR"]));
         ps.ExecuteRemote(host, PowershellCommandString.DeleteDirectory(Global.ClusterProperties["HDP_DATA_DIR"]));
         ps.ExecuteRemote(host, PowershellCommandString.RequiredApplicationUninstall);
     }
     catch (Exception ex)
     {
         Global.Log.Error(ex.ToString());
         throw;
     }
 }
Beispiel #3
0
 public static void ConfigurePorts(PowershellCommand ps, bool enable)
 {
     ConsoleText.Yellow("Configuring HDP ports...");
     try
     {
         foreach (string host in Global.Hostnames)
         {
             Console.WriteLine(host);
             string hosts = String.Join(",", Global.Hostnames.ToArray());
             StringBuilder s = ps.ExecuteRemote(host, PowershellCommandString.HDPPorts(true));
         }
     }
     catch (Exception ex)
     {
         Global.Log.Error(ex.ToString());
         throw;
     }
     ConsoleText.Green("Done");
 }
Beispiel #4
0
 public static void DisableIPv6(PowershellCommand ps)
 {
     try
     {
         ConsoleText.Yellow("Disabling IPv6...");
         foreach (string host in _hostnames)
         {
             Console.WriteLine(host);
             StringBuilder s = ps.ExecuteRemote(host, @"New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents -PropertyType DWord -Value 0xffffffff");
         }
         if (Configuration.RestartForIPV6)
         {
             Console.WriteLine("Restarting all Hosts for IPv4 resolution to take effect...");
             ps.ExecuteRemoteAsync("Restart-Computer -ComputerName "
                 + String.Join(",", Global.Hostnames.ToArray()) + " -Force -Wait -For WinRM -Timeout 180");
         }
         ConsoleText.Green("Done");
     }
     catch (Exception ex)
     {
         Global.Log.Error(ex.ToString());
         throw;
     }
 }
Beispiel #5
0
 public static void EnableFirewall(PowershellCommand ps)
 {
     if (Configuration.EnableFirewall)
     {
         ConsoleText.Yellow("Enabling all Firewall Profiles...");
         try
         {
             foreach (string host in _hostnames)
             {
                 Console.WriteLine(host);
                 StringBuilder sb = ps.ExecuteRemote(host, "netsh advfirewall set allprofiles state on");
             }
         }
         catch (Exception ex)
         {
             throw;
         }
         ConsoleText.Green("Done");
     }
 }
Beispiel #6
0
 public static void SetTrustedHosts(PowershellCommand ps, bool isLocal)
 {
     try
     {
         string hosts = String.Join(",", Global.Hostnames.ToArray());
         StringBuilder s = ps.ExecuteRemote(Environment.MachineName, @"Set-item wsman:localhost\client\trustedhosts -value """ + hosts +
             @""" -force;" +
             @"Get-item wsman:localhost\client\trustedhosts");
     }
     catch (Exception ex)
     {
         Global.Log.Error(ex.ToString());
         throw;
     }
 }
Beispiel #7
0
 public static void SetTrustedHosts(PowershellCommand ps)
 {
     ConsoleText.Yellow("Setting Trusted Hosts on all nodes...");
     try
     {
         foreach (string host in _hostnames)
         {
             Console.WriteLine(host);
             string hosts = String.Join(",", Global.Hostnames.ToArray());
             StringBuilder s = ps.ExecuteRemote(host, @"Set-item wsman:localhost\client\trustedhosts -value """
                 + hosts +
                 @""" -force;" +
                 @"Get-item wsman:localhost\client\trustedhosts");
         }
         ConsoleText.Green("Done");
     }
     catch (Exception ex)
     {
         Global.Log.Error(ex.ToString());
         throw;
     }
 }