Back
Featured image of post Automated Alteryx Server Installation

Automated Alteryx Server Installation

For robust and reproducible cloud deployments, it’s important to have a system to automatically provision and configure the software running on the instances you are deploying. In this article we discuss deploying Alteryx Server in an automated fashion.

This may be the age of automation, but love is still being made by hand. - Evan Esar

For robust and reproducible cloud deployments, it’s important to have a system to automatically provision and configure the software running on the instances you are deploying. In this article we discuss deploying Alteryx in an automated fashion.

The defining factor of using public cloud resources is the flexibility of deployment. We eliminate constraints of available hardware, procurement cycles, and having to provide resources for the worst-case scenarios by adding “more” as it fits our tech and budget needs.

This is the promise of the cloud, but reality deems that this is not as simple as a nebulous “make it bigger” command typed into a console. No, bringing resources into and out of existence as needed should be one of the primary processes in cloud deployments.

A key part of this is automating software installation. Alteryx doesn’t have many resources on how to automate installation, although it does have the capability. The process itself is fairly straightforward: Download the application Perform a silent installation License the software Add custom settings Start the software

Because of how Alteryx handles licensing, the following requirements exist to perform the install automatically: You must have downloaded the installer to a reachable location like S3 or another location on the network. You must either have the Internet available to get licensed or have a local licensing server capable of authorizing the installation.

In our examples, the installation script will do everything except downloading the Alteryx installer.

Instance Installation

Begin by provisioning a Windows instance that meets the usual Alteryx installation requirements. AWS has it’s best practices noted in its own article (https://d1.awsstatic.com/whitepapers/best-practices-for-deploying-alteryx-server-on-aws.pdf). This instance should be either with a user-data that complies with the needs of Ubuntu’s cloud-init format (https://cloudinit.readthedocs.io/en/latest/topics/format.html) , or preferably, using a IaC tool like Terraform, or CloudFormation to encapsulate the installation.

I would recommend the instance have a data drive of at least 100GB to install Alteryx. All the examples here move Alteryx to D:. Add the install script Once your user-data is set up to your likings, we add 2 files to drop into a temporary directory. This first is the settings. It’s the general setup for Alteryx. This is a minimal installation. Other additions would be adding info for it to authenticate against AD, or to use an external MongoDB installation.

<?xml version="1.0" encoding="UTF-8"?>
<SystemSettings>
   <Authentication>
       <ServiceProviderEntityID>http://localhost/aas</ServiceProviderEntityID>
   </Authentication>
   <Controller>
       <EmbeddedMongoDBEnabled>True</EmbeddedMongoDBEnabled>
       <EmbeddedMongoDBRootPath>D:\Alteryx\Service\Persistence\MongoDB</EmbeddedMongoDBRootPath>
       <GalleryEnabled>True</GalleryEnabled>
       <LoggingEnabled>True</LoggingEnabled>
       <LoggingPath>D:\Alteryx\Service\AlteryxServiceLog.log</LoggingPath>
       <LoggingSeverityThreshold>7</LoggingSeverityThreshold>
       <SQLitePath>D:\Alteryx\Service\Persistence</SQLitePath>
       <WebInterfaceEnabled>True</WebInterfaceEnabled>
       <WebInterfaceStagingPath>D:\Alteryx\Service\Staging</WebInterfaceStagingPath>
   </Controller>
   <Engine>
       <DefaultTempFilePath>D:\Alteryx\Engine</DefaultTempFilePath>
       <LogFilePath>D:\Alteryx\Logs</LogFilePath>
       <NumThreads>3</NumThreads>
       <PackageStagingPath>D:\Alteryx\Engine\Staging</PackageStagingPath>
       <RunAtLowerPriority>True</RunAtLowerPriority>
       <SortJoinMemory>2027</SortJoinMemory>
   </Engine>
   <Environment>
       <Configured>True</Configured>
       <SetupType>Gallery</SetupType>
       <WorkingPath>D:\Alteryx</WorkingPath>
   </Environment>
   <Gallery>
       <BaseAddress>http://localhost/gallery</BaseAddress>
       <DefaultGalleryAdminUserName>noreply@keyrus.us</DefaultGalleryAdminUserName>
       <LoggingPath>D:\Alteryx\Gallery\Logs</LoggingPath>
       <SmtpEnabled>False</SmtpEnabled>
       <WorkingPath>D:\Alteryx\Gallery</WorkingPath>
   </Gallery>
   <Worker>
       <StagingPath>D:\Alteryx\Service\Staging</StagingPath>
   </Worker>
</SystemSettings>

This next file is the actual installation script.

# Edit these to fit your environment. Probably best to pull from
# your config management system
 
$InstallFile = ".\AlteryxServerInstallx64_2021.2.1.35394.exe"
$TargetFolder = "D:\Alteryx"
$AlteryxKey = "xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx"
$AlteryxEmail = "dan.afonso+alteryx@keyrus.us"
 
# We'll do our own error handling
$ErrorActionPreference = "Stop"
 
# Install alteryx to the shared folder
try {
   $TargetPrefix = Split-Path -Path $TargetFolder
   $TargetSuffix = Split-Path -Path $TargetFolder -Leaf
 
   Write-Host "Testing that destination folder can be created: $TargetFolder"
   New-Item -Path $TargetPrefix -Name $TargetSuffix -ItemType "directory"
 
} catch {
   write-host "Target installation folder unavailable: $_"
   Break
}
 
# Copy Baseline settings file
try {
   Write-Host "Copying baseline settings file to $TargetFolder"
   Copy-Item -Path ".\RuntimeSettings.baseline.xml" -Destination $TargetFolder
} catch {
   write-host "Copy of settings file failed: $_"
   Break
}
 
if (-not(Test-Path -Path $InstallFile -PathType Leaf)) {
   write-host "Installer not available. Terminating."
   Break
}
 
# Do the install of Alteryx, and handle logging
try{
   $TargetDirArg=-join('TARGETDIR="',$TargetFolder,'"')
   $LogFile = -join($TargetFolder,"\alteryx_install.log")
   $LogFileArg = -join('/l="',$LogFile,'"')
   if (Test-Path -Path "$LogFile.9" -PathType Leaf) {
       Remove-Item -Path "$LogFile.9"
   }
   foreach ($i in 8..0){
       # remove backup files and increment old ones
       if (Test-Path -Path "$LogFile.$i" -PathType Leaf) {
           $NewSuffix = $1 + 1
           Rename-Item -Path "$LogFile.$i" -NewName "$LogFile.$NewSuffix"
       }
   }
   if (Test-Path -Path "$LogFile" -PathType Leaf) {
       Rename-Item -Path "$LogFile" -NewName "$LogFile.0"
   }
   Write-Host "Running: $InstallFile /s $TargetDirArg $LogFileArg"
   Start-Process $InstallFile -Wait -ArgumentList "/s",$TargetDirArg,$LogFileArg
   $UninstallCount = Get-ItemProperty -Path "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object { $_.DisplayName -match "Alteryx" }| Measure-Object | ForEach-Object{ $_.count}
   if($UninstallCount -eq 0){
       Throw "Cannot find uninstall info for Alteryx"
   }
} catch {
   Write-Host "Installation failed: $_"
   Break
}
 
# License the software
Start-Process "$TargetFolder\bin\AlteryxActivateLicenseKeyCmd.exe" -Wait -ArgumentList $AlteryxKey,$AlteryxEmail
if ($?){
   # This is pointless, as the license command always returns success, but maybe someday
   Start-Process "$TargetFolder\bin\AlteryxService.exe" -Wait -ArgumentList "settingfile=D:\Alteryx\RuntimeSettings.baseline.xml"
} else {
   Write-Host "Installation failed: Licensing failure"
}
 
Start-Process "$TargetFolder\bin\AlteryxService.exe" -Wait -ArgumentList start

Performing the installation

In your cloud-init file, your runcmd section would then be a Powershell script that did the following actions: Download the Alteryx Installer to the temp folder you put the rest of the files in Change to the temporary installation folder Run the powershell script with powershell “.\AlteryxInstall.ps1”

Further changes

It is likely that you will need to make changes to what I have presented in this post. The simplest way to get those changes is to: Copy the RuntimeSettings.xml file to make a backup Make the changes manually Get a diff from the backup and the sitting RuntimeSettings.xml file Add the changes to your RuntimeSettings.template.xml

Built with Hugo
Theme Stack designed by Jimmy