Scalarizr Installation

Scalarizr is Scalr’s management agent. It is optionally installed on every Scalr-managed Server, and used for orchestration and monitoring.

Scalarizr Functionality

The Scalarizr agent is optional, but without the agent the Scalr experience is limited, please see the following comparison chart:

Capability Agentless Agent Installed
Launch, Terminate, Suspend, Resume Yes Yes
Security Group management Yes Yes
Tagging Yes Yes
Autoscaling No Yes
Orchestration (script execution) No Yes
Monitoring No Yes
Storage Volume addition No Yes
Software Firewall/ iptables management No Yes

Supported Server/Instance Operating Systems

Scalarizr is supported on the following operating systems and versions.

Operating System Supported Versions
Ubuntu 14.04 - 18.04 LTS
Debian 6.x - 7.x
RHEL / CentOS 5.x - 7.x
Windows Server 2008 R2, 2012(all), and 2016
Suse 11.3, 11.4, and 12.x

Scalarizr Network Requirements

Scalarizr needs to be able to communicate bi-directionally with the Scalr server. This table shows the ports that need to be open to enable this and also shows additional ports required to be open when Scalr is deployed on multiple hosts.

Port Protocol Direction Usage
80 TCP Cloud Instance > Scalr Server Scalarizr Agent
443 TCP Cloud Instance > Scalr Server Scalarizr Agent
5671 TCP Cloud Instance > Scalr Server Scalarizr Agent (rabbitmq)
6275 TCP Between Scalr Server Nodes (excluding DB) RabbitMQ
6276 TCP Between Scalr Server Nodes (excluding DB) RabbitMQ
6291 TCP Between Scalr Server Nodes (excluding DB) InfluxDB
8008 TCP Scalr Server > Cloud Instance Scalarizr Agent (update service)
8010 TCP Scalr Server > Cloud Instance Scalarizr Agent (API)
8013 TCP Scalr Server > Cloud Instance Scalarizr Agent (control)
15671 TCP Between Scalr Server Nodes (excluding DB) RabbitMQ

Installing Scalarizr

How to Install Scalarizr on Linux Images

Open a shell and execute:

PLATFORM=ec2 && curl -L https://<YOUR_SCALR_URL>/public/linux/latest/$PLATFORM/install_scalarizr.sh | sudo bash

Set the PLATFORM variable to the cloud platform that you are using.

Value Cloud Platform
PLATFORM=ec2 Amazon EC2
PLATFORM=gce Google Compute Engine
PLATFORM=azure Microsoft Azure
PLATFORM=openstack For any OpenStack based platform
PLATFORM=cloudstack CloudStack
PLATFORM=rackspace Rackspace Legacy Cloud
PLATFORM=vmware VMware

How to Install Scalarizr on Windows Images

Open the administrator powershell and execute:

iex ((New-Object Net.WebClient).DownloadString('https://<YOUR_SCALR_URL>/public/windows/latest/install_scalarizr.ps1'))

Note

Scalarizr should not be set to automatically start on Windows servers. The Scalarizr update client will automatically start Scalarizr once it has completed the update.

Scalarizr Logs

The following are the Scalarizr log locations:

Log Location Description
/var/log/scalarizr.log (linux) or C:\optscalarizr\var\log\scalarizr.log (windows) The general log that shows Scalarizr events.
/var/log/scalarizr_debug.log (linux) or C:\opt\scalarizr\var\log\scalarizr_debug.log (windows) The debug version of the scalarizr.log
/var/log/scalarizr_update.log (linux) or C:\opt\scalarizr\var\log\scalarizr_update.log (windows) The log that shows the initial Scalarizr update when a server is launched as well as polling for updates to Scalarizr.
/var/log/scalrizr/scripting/* (linux) or C:\opt\scalarizr\var\log\scripting\* (windows) The location where Scalr orchestration output is saved.

How to Create Your Own Scalarizr Repo

Setting up a Scalr integrated custom repository is very easy. This capability allows for simple management of your custom repo, the available packages, and your custom release branches right from the Scalr server CLI! Below are a few key points to note about the “repos” service:

  • This service acts as a separate component from other services on the Scalr server. If desired, it can be put on a dedicated server just like other Scalr components.
  • The integrated repo service binds to port 6273 by default. The Scalr proxy component will forward requests to it if the URI starts with /repos/
  • The root dir of the repo is /opt/scalr-server/var/lib/repos, but this may be changed in config.

Enabling integrated repository tool

In order to configure the repos service on a multi server Scalr deployment, simply pick one of the app/proxy servers to also act as a repo-server.

Add the following to scalr-server-local.rb on ONE app server:

repos[:enable] = true

Add the following to scalr-server.rb on ALL servers. Be sure to change <ip-of-repo-server> to your selected app server IP:

proxy[:repos_upstreams] = ['<ip-of-repo-server>:6273']

repos[:bind_host] = '<ip-of-repo-server>'

repos[:bind_port] = 6273

Run scalr-server-ctl reconfigure to ensure the changes are applied.

Managing Scalr Integrated Repo Service

Once you have added the above to your scalr-server.rb and reconfigured, you will be able to access the service via the command line with “scalr-server-manage agent-repo”. If there are issues with your configuration, they will be noted when you run this command. If config is correct, the following options will be displayed:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo
Reading Scalr configuration...
scalr-server-manage agent-repo status                            - Shows available remote and local repos
scalr-server-manage agent-repo pull %version%                    - Downloads specified remote repo
scalr-server-manage agent-repo delete %version%                  - Delete specified local version
scalr-server-manage agent-repo link %local_name% %local_version% - Links specified local repo name to existing local version
scalr-server-manage agent-repo unlink %local_name%               - Unlinks specified local repo

Check the status of the service with agent-repo status:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo status
Reading Scalr configuration...
Fetching data from remote server...
Remote versions [linked repo]:
3.2.11
3.4.4
3.5.9
3.6.8
3.7.9
3.8.5
3.9.9
3.10.1
3.11.9
3.12.7
4.1.9
4.2.9
4.3.9
4.4.1
4.5.9
4.6.6
4.7.9
4.8.3
4.9.9
4.10.2
4.11.9
4.12.2
5.1.9
5.2.2
5.3.9
5.4.0 [stable]
5.5.5 [latest]

Local versions [linked repo]:

No local versions were found. Use 'scalr-server-manage agent-repo pull %version%' to download.

No local repos were found. Use 'scalr-server-manage agent-repo link %name% %version%' to create.

Download and Set Up a Custom Repo

As the previous command noted, we do not yet have any packages downloaded. We will do so now. The package for download may be referenced either by version number or by branch name:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo pull latest
Reading Scalr configuration...
Pulling 5.5.5 RPM packages... [ DONE ]
Pulling 5.5.5 DEB packages... [ DONE ]
Pulling 5.5.5 WIN packages... [ DONE ]

Now that we have a local package, we need to create a link between this package and the branch name we want to create and offer to our users. After successful link, we will be provided with the scalr-server.rb configuration required to enable the new repo:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo link TestRepo 5.5.5
Reading Scalr configuration...
Repo 'TestRepo' is now linked to version 5.5.5

Example scalr-server.rb config snippet to enable your repo:

app[:configuration] = {
"scalr" => {
  "scalarizr_update" => {
    "mode" => "solo",
    "default_repo" => "testrepo",
    "repos" => {
      "testrepo" => {
        "rpm_repo_url" => "http://111.111.111.111/repos/rpm/testrepo/rhel/$releasever/$basearch",
        "deb_repo_url" => "http://111.111.111.111/repos/apt-plain/testrepo /",
        "win_repo_url" => "http://111.111.111.111/repos/win/testrepo"
        }
      }
    }
  }
}

Be sure to merge the suggested configuration in to your scalr-server.rb and reconfigure.

Running agent-repo status once more will show the status of our newly configured custom repo service:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo status
Reading Scalr configuration...
Fetching data from remote server...
Remote versions [linked repo]:
3.2.11
3.4.4
3.5.9
3.6.8
3.7.9
3.8.5
3.9.9
3.10.1
3.11.9
3.12.7
4.1.9
4.2.9
4.3.9
4.4.1
4.5.9
4.6.6
4.7.9
4.8.3
4.9.9
4.10.2
4.11.9
4.12.2
5.1.9
5.2.2
5.3.9
5.4.0 [stable]
5.5.5 [latest] [beta]

Local versions [linked repo]:
5.5.5 [TestRepo]

Removing Custom Repo Branches and Packages

If we want to remove one of our custom repos we must first unlink the custom branch from the package:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo unlink TestRepo
Reading Scalr configuration...
Repo 'TestRepo' has been removed

We can then delete the repo files which will remove the files from the server:

root@ip-111-111-111-111:~# scalr-server-manage agent-repo delete 5.5.5
Reading Scalr configuration...
Version 5.5.5 has been deleted