Tag: data gathering

  • Get HDInsight Properties with PowerShell

    Small Bites of Big Data from AzureCAT

    You’ve created your HDInsight Hadoop clusters and now you want to know exactly what you have out there in Azure. Maybe you want to pull the key information into a repository periodically as a reference for future troubleshooting, comparisons, or billing. Maybe you just need to get a quick look at your overall HDInsight usage. This is something you can easily automate with PowerShell.

    Environment

    First, open Windows Azure PowerShell or powershell_ise.exe.

    Set some values for your environment:

    $SubName = "YourSubscriptionName"
    
    Select-AzureSubscription -SubscriptionName $SubName
    
    Get-AzureSubscription -Current
    
    $ClusterName = "HDInsightClusterName" #HDInsight cluster name
    
    
    

    HDInsight Usage for the Subscription

    Take a look at your overall HDInsight usage for this subscription:

    Get-AzureHDInsightProperties

    Get-AzureHDInsightProperties returns the number of clusters for this subscription, the total HDInsight cores used and available (for head nodes and data nodes), the Azure regions where HDInsight clusters can be created, and the HDInsight versions available for new clusters:

    ClusterCount    : 2
    
    CoresAvailable  : 122
    
    CoresUsed       : 48
    
    Locations       : {East US, North Europe, Southeast Asia, West Europe...}
    
    MaxCoresAllowed : 170
    
    Versions        : {1.6, 2.1, 3.0}

    You can also pick out specific pieces of information and write them to a file, store them as variables, or use them elsewhere. This example simply outputs the values to the screen.

    write-host '== Max HDInsight Cores for Sub: ' (Get-AzureHDInsightProperties).MaxCoresAllowed
    
    write-host '== Cores Available:             ' (Get-AzureHDInsightProperties).CoresAvailable
    
    write-host '== Cores Used:                  ' (Get-AzureHDInsightProperties).CoresUsed

    HDInsight Cluster Information

    Get-AzureHDInsightCluster provides information about all existing HDInsight clusters for this subscription:

    Get-AzureHDInsightCluster
    As you can see this cmdlet tells you the size, connection information, and version.
    ClusterSizeInNodes    : 4
    
    ConnectionUrl         : https://BigCAT.azurehdinsight.net
    
    CreateDate            : 4/5/2014 3:37:23 PM
    
    DefaultStorageAccount : sqlcatwomanwestus.blob.core.windows.net
    
    HttpUserName          : Admin
    
    Location              : West US
    
    Name                  : BigCAT30
    
    State                 : Running
    
    StorageAccounts       : {}
    
    SubscriptionId        : {YourSubID}
    
    UserName              : Admin
    
    Version               : 3.0.0.0.661685
    
    VersionStatus         : Compatible
    
    
    
    ClusterSizeInNodes    : 4
    
    ConnectionUrl         : https://cgrosstest.azurehdinsight.net
    
    CreateDate            : 5/5/2014 6:09:58 PM
    
    DefaultStorageAccount : cgrosstest.blob.core.windows.net
    
    HttpUserName          : Admin
    
    Location              : West US
    
    Name                  : cgrosstest
    
    State                 : Running
    
    StorageAccounts       : {sqlcatwomanwestus.blob.core.windows.net}
    
    SubscriptionId        : {YourSubID}
    
    UserName              : Admin
    
    Version               : 3.0.2.0.727283
    
    VersionStatus         : Compatible

    You can also get information about just one HDInsight cluster at a time:

    Get-AzureHDInsightCluster  -name $ClusterName

    Or you can get very granular and look at specific properties, even some that aren’t in the default values:

    write-host '== Default Storage Account:     ' `
    
    (Get-AzureHDInsightCluster -Cluster $ClusterName).DefaultStorageAccount.StorageAccountName.split(".")[0]
    
    write-host '== Default Container:           ' `
    
    (Get-AzureHDInsightCluster -Cluster $ClusterName).DefaultStorageAccount.StorageContainerName

    This information will be a valuable source of information for tracking past configurations, current usage, and planning. Enjoy your Hadooping!

    Sample Script

    # Cindy Gross 2014
    
    # Get HDInsight properties
    
    $SubName = "YourSubscriptionName"
    
    Select-AzureSubscription -SubscriptionName $SubName
    
    Get-AzureSubscription -Current
    
    $ClusterName        = "YourHDInsightClusterName" #HDInsight cluster name
    
    
    
    Get-AzureHDInsightProperties 
    
    Get-AzureHDInsightCluster 
    
    Get-AzureHDInsightCluster  -name $ClusterName
    
    write-host '== Default Storage Account:     ' `
    
    (Get-AzureHDInsightCluster -Cluster $ClusterName).DefaultStorageAccount.StorageAccountName.split(".")[0]
    
    write-host '== Default Container:           ' `
    
    (Get-AzureHDInsightCluster -Cluster $ClusterName).DefaultStorageAccount.StorageContainerName
    
    write-host '== Max HDInsight Cores for Sub: ' (Get-AzureHDInsightProperties).MaxCoresAllowed
    
    write-host '== Cores Available:             ' (Get-AzureHDInsightProperties).CoresAvailable
    
    write-host '== Cores Used:                  ' (Get-AzureHDInsightProperties).CoresUsed
  • Data Gathering – SQL Server Setup Problems

    Data Gathering – SQL Server Setup Problems

    Cindy Gross, Dedicated Support Engineer

     

    Gathering the right data during a problem can get you a long ways towards resolving the problem. When you ask the right questions and clearly define the problem it changes the way you approach the remaining steps. Sometimes the answer to a seemingly simple question leads you right to the solution. In this series of data gathering blogs I am NOT going to tell you how to solve the problem, but I am going to tell you how to get a good set of troubleshooting data you can use to do your own troubleshooting.

    Any time you have a SQL Server setup issue you will need to collect this information:

     

    • Date/time of the failed setup
    • Type of install and parameters used – GUI, unattended/command line, slipstream, sysprep
    • Number of attempts, any actions you took to cleanup or remove prior installs
    • Version/Edition/Exact build #/32bit or x64 or IA64 for
      • Windows
      • SQL Server
      • Virtualization software (Hyper-V, VMWare for example)
    • How many cluster nodes and SQL instances or state that it’s standalone
    • Whether the problem is with RTM, SP, and/or CU
    • Whether the problem is with a new install or an upgrade
    • What components you are installing (Client tools, SSIS, SQL, RS, AS, BOL, samples) and whether any succeed
    • Exact error message
    • Repro steps and/or failure scenario
    • All setup logs (i.e. %ProgramFiles%Microsoft SQL Serverx0Setup BootstrapLOG)
    • Which step in the build doc you are at when you see the setup failure
    • What permissions have been enabled/granted for MSDTC
    • Any steps you take to attempt to resolve the problem and the result
    • If on a cluster, have you re-run the cluster verification log and addressed all errors and warnings?
    • Did you run setup using “run as administrator”?
    • What account did you log into Windows with when you ran setup and what groups does it belong to?

    Armed with this information you are now ready to solve the problem!