Top Nav

Archive | Cloud

Scalr 4.5 Install Notes For Cento 6.4

Last year we published an article on installing the open-source version of Scalr:

http://blogs.reliablepenguin.com/2013/08/29/scalr-install-notes

Now there’s a new 4.5 release of Scalr available so it’s time for an update.

We’re installing on Cento 6.4 hosted on a RackSpace Performance 1 Cloud Server.

The installation instructions have improved since the last time around but Scalr is till a complex install:

https://scalr-wiki.atlassian.net/wiki/display/docs/Installing+Scalr+4.5

Follow these instructions one section at a time and make sure you’ve got the section complete and working before moving to the next section. We’ve provided notes below about each section.

Before you start, select a hostname for the server and add a DNS A record. For this article we’ll use:

You’ll have problems later on if you don’t get the hostname setup in advance.

Also I like to add some swap to the server:

 Create UNIX Users and Group for Scalr

I setup a script at /root/env.sh with the environment variable as follows:

This makes it easy to get the environment right.

Notice that we’re using user “apache” instead of “www-data” since this is CentOS instead of Ubuntu.

Configure your firewall

Edit /etc/sysconfig/iptables and add lines shown:

And restart the service:

Install Scalr’s PHP Dependencies

The PHP dependencies are tricky. Tried using the IUS repository but kept having problems with errors like this:

So I started over with the Remi repository:

Now edit /etc/yum.repos.d/remi.repo and enable the “remi” and “remi-php55” repositories.

The instructions say to install the php-pecl-rrd extension now but it’s better to wait due to dependency issues that we’ll see later.

Also notice that we’re installing php-pecl-http1 instead of php-pecl-http. This is critical.

Install Scalr’s Python Dependencies

Python is installed by default so just a couple of additional packages to install:

As with PHP, we’ll defer installing the python-rrdtool package until a later step.

Configure PHP for Scalr

Edit /etc/php.ini and (a) enable “short_open_tags” and (b) set the “date.timezone” setting.

Update System SNMP MIBs

For CentOS there is no “snmp-mibs-downloader”. I ended up doing nothing for this step.

Download and Install Scalr 4.5

I choose to install Scalr in /opt/scalr with the following steps:

Notice that back in the first step, I set the SCALR_INSTALL environment variable. No run the installer:

Install and Configure MySQL

Install MySQL server and set to start on boot:

Set the mysql root login and secure:

http://blogs.reliablepenguin.com/2012/10/09/secure-mysql-installation

I like to add a .my.cnf file:

http://blogs.reliablepenguin.com/2012/10/09/create-my-cnf-file-for-mysql-authentication

Edit the /etc/my.cnf file and add this line to the “[mysqld]” section:

Now create the database and user for Scalr:

And load the database structure and data:

Create the Scalr Cache folder

Install and Configure rrdtool and rrdcached

The default version of rrdtool is too old …. we need at least 1.4:

And now we can get the PHP and Python dependencies that we skipped earlier:

Set rrdcached to start on boot:

Edit /etc/sysconfig/rrdcached and change the “RRDCACHED_USER” to “root” and add the following line:

Now create the graphics and data directories:

And start the service:

Install and Configure Apache

Install Apache “httpd” package and SSL support:

Edit /etc/httpd/conf.d/vhosts.conf and add:

Set Apache to start on boot and start it now:

Configure Scalr

Copy the sample config file:

Now edit the config file at /opt/scalr/app/etc/config.yml and set the following parameters:

Leave the other parameters at default settings.

Configure the Scalr Cronjobs

Edit “apache” cronjobs:

and add the following:

 Configure the Scalr Daemons

Edit /etc/init.d/scalr and copy/paste the following contents:

Now set the service to start on boot and start it for the first time:

Validate your Scalr installation

 Now run the validation script:

Log in to Scalr

Open a browser and go to:

http://scalr.domain.com

Login with user “admin” and password “admin”.

Go to the Admin -> admin -> edit and change the admin password.

All Done!

Scalr install is now complete. You can get started using Scalr by adding a user and building an environment.

 

1

Vyatta VPN User Management

Here are the basic commands needed for managing VPN users on the Brocade Vyatta vRouter available in RackSpace Cloud.

Add New User

Remove A User

Change User Password

Same as adding a new user.

 

0

Error 850 When Connecting to Vyatta VPN With Windows 8

While setting up a Windows 8 workstation to connect to a Brocade Vyatta firewall on RackSpace Cloud, I got the following error:

Error 850: The Extensible Authentication Protocol type required for authentication of the remote access connection is not installed on your computer.

Turns out the fix is pretty simple – on the Connections Properties -> Security tab we need to explicitly set the authentication protocols as shown in this image:

Credit goes to Brendan at SysadminSpot for providing this solution:

https://sysadminspot.com/server-administration/error-connecting-to-virtual-private-network-pptp-error-850-the-extensible-authentication-protocol-type-required-for-authentication/

0

Scale Out For SharkTank

Recently one of our clients was featured on SharkTank, the critically-acclaimed business-themed show, featuring the Sharks and their continuing the search to invest in the best businesses and products that America has to offer.

Fohawx is a line of cool accessories that can easily attach to any kind of safety helmet – instantly transforming annoying headgear into a fashion statement. The appearance on SharkTank was a great opportunity for Fohawx to showcase their product.

Based on past experience we know that their web site could get 5000 or more simultaneous users. The small RackSpace Cloud Server on which they were hosted would be vaporized by this traffic. Due to the proprietary nature of their application server (ColdFusion) we could not add additional web servers. So a couple of days before the event we outlined measures to temporarily scale out their hosting capacity:

1. Re-sized the web server to 16GB of RAM. We wanted to go to 30GB but there was not sufficient space available on the “huddle” so we could only go to 16GB. We could move to a diffierent huddle but this would require and IP address change.

2. Added a separate database server. We spun up a 60GB server in RackSpace’s new Performance flavor and moved the application database from the web server to this new database server. The goal was to offload the web server and allow for faster database operations.

3. Added a pair of Varnish cache servers in front of the web server. The Varnish servers were built on small RackSpace Cloud Servers. As a caching proxy, Varnish can be used to offload static content from the web server. We used two Varnish servers to provide redundancy and increase throughput.

4. Added a RackSpace Cloud Load Balancer in front of the Varnish servers. The Cloud Load Balancer was configured to distribute traffic evenly between the Varnish servers.

In total this configuration cost about $3 per hour to operate and it ran for 4 days so the total cost was less then $220 hour.

The Sharks were not big fans of Fohawx but viewers seemed to disagree. In the hour after the initial airing the site served more the 1 million hits with a peak of over 4100 simultaneous users. Amazingly the Varnish cache servers handled 99% of all request and only passed 1% through to the web server.

This case study demonstrates how Reliable Penguin can combine RackSpace Cloud services with open-source components to rapidly meet emerging hosting challenges.

Watch the SharkTank episode here:

http://watchabc.go.com/shark-tank/SH559076/VDKA0_pbz8umsy/week-11

Fohawx starts around 00:23.

And don’t forget to get your Fohawx at:

http://fohawx.com

0

Configure Vyatta To Allow Incoming MySQL Connections

VyattaMysql - New Page

This article demonstrates how to configure a Vyatta firewall to allow incoming requests from a group of clients to an internal MySQL server.

Assuming that you have three external MySQL clients with IPv4 addresses:

[A:y.y.y.y]
[B:y.y.y.y]
[C:y.y.y.y]

We’ll put these addresses in a group called [clientgroup]. You can name the group appropriately for your installation.

The external address of the firewall is [x.x.x.x] and the internal address of the MySQL server is [z.z.z.z].

0