■Frequently Asked Questions

Do I need an AWS account to use SCALR?
Yes, you do need to have an AWS account.

A2.AWSにアクセスしてログイン、その後「Your Account > Personal Information 」と移動。その後の画面の右上にある「Account Number」が「AccountID」。
Where do I get my AWS account ID?
It can be found in "Your AWS Profile" page inside http://aws-portal.amazon.com, find an "Account Number" field.

What is "farm"?
Farm is a set of instances that are serving one or more applications. Typical farm consists of one or more www instances, two or more app instances and one or more mysql instances.

・www - LoadBalancerが入ってる
・app - Apacheがはいってる
・mysql - MySQLが入ってる
・base - 何も手をつけていない綺麗なAMI。これを元に独自のRoleが作ってね。
What is "role"?
Role is AMI that is built for specific task. Currently Scalr comes with the following pre-built "shared" roles:
• www - frontend web servers that are proxying HTTP requests to all instances of app role. It can also serve static files with minimal overhead.
• app - instances originally running Apache
• mysql - MySQL master or slave instances.
• base - a clean AMI that can be used to create new roles.
You can also create your own roles based on existing "shared" ones.

What is "application"?
Application is basically a website that is running on a farm.

A6.ネームサーバの設定をns1.scalr.net, ns2.scalr.net and ns3.scalr.netにしてくれれば、Scalrが巧くやってくれるよ。
How do I get my domain DNS zone updated when farm is reconfigured?
Just set nameservers for your domain to ns1.scalr.net, ns2.scalr.net and ns3.scalr.net. Scalr will take care of the rest.

Does Scalr configure virtual hosts on app instances?
Not yet, if you are going to host more than one application of one farm, you are responsible for this.

How MySQL replication work?
Scalr takes care about MySQL replication and re-configuration. Instances of mysql role can become master or slave dynamically, if any of mysql instances suddenly crash.

OK, I created application, built and launched a farm. Now what?
Upload your application on app instances.

Where do I place my files? What are default directories?
/var/www for app
/var/www/nginx-default for www (you won't place anything here in most cases)

A11.Farmの一覧画面で、画面右のOptionの所から「Get Private Key」を押してダウンロードして。んでこの暗号鍵ファイルを使ってSSHClientとか、Puttyでつないでよ。
How do I SSH into my instance?
Go to the list of farms and click on Private key -> Download. Use this private key with OpenSSH client (-i switch) or Putty to authenticate on all instances in this farm.

A12.ここ見れ。Follow this manual
How do I use downloaded private key in Putty?
Follow this manual

Q13.「Synchronize to all」ってやるとどうなるの?
How "Synchronize to all" feature works?
Say you've made changes to files on some instance. Now you want to save them on all instances in this role, so they will not be lost upon instance crash and on newly created instances. You find the instance in the list and click "Synchronize to all".
• Scalr rebundles this instance
• Scalr terminates old instances one-by-one and replaces them with new ones.

A14.いいえ。自分でやってください。そういうScriptを準備するか、「Synchronize to all」を使ってね。
Does Scalr take care about synchronizing my content between my instances for www and app roles?
No, but you can either take care of this by yourself (a simple rsync script will do the job) or use "Synchronize to all" feature.

Can I use Scalr and other tools like Elasticfox simultaneously to control my instances?
You are strongly advised to not do any changes on your instances, EBS volumes, Elastic IPs etc outside Scalr. Scalr is unable to track these changes in most cases and you can end up with unexpected behavior. Good example is assign of Elastic IP to an instance via Elasticfox.

Q16.「Min LA」と「Max LA」って何?
What are "Min LA" and "Max LA" settings for roles?
LA is a common abbreviation for "Load Average". You can read more on this in this Wikipedia article . Scalr scales your role based on average LA on all instances for last 15 minutes. If LA grows higher than Max LA, new instance is started.If LA fails lower than Min LA, one instance is terminated.

Q17.「Min Instances」と「Max Instances」って何?
What are Min Instances and Max Instances?
Scalr will keep a number of running instances of particular role between Min and Max, regardless of LA limits.

Will my farms/instances be stopped if I unsubscribe?
No, but you will no longer be able to control them from Scalr web interface and they will not be monitored anymore.

How HTTP requests are spreaded across all www instances?
Scalr assigns public IP addresses of all www instances to your application domain name. This is called DNS round-robin. Different visitors/requests will go on different www instances.

What software is running on www role instances?

Can I add my existing AMI/instance into Scalr?
For now you can only use Scalr's "base" role AMI to create your custom one. A next version of scalr will allow you to "scalrize" any AMI.

A22.Base-Roleを一個含めて新規Farmを作成します。でそのBaseの所で「Synchronize to all」オプションを使います。するとどういう名前のRoleで保存するのか聞かれますからそこで作ってください。
How do I create my custom role/AMI out of "base" one?
Include a base role when starting a new farm. Go to a base AMI and use "Synchronize to all" option. You will be asked for a new role name. The new AMI will be owned by you.

I made changes on instance, clicked "Synchronize to all" and now it won't be recognized by Scalr or MySQL snaphsot not working or it hangs in "Synchronizing…..." state.
Make sure that you did not mess essential scalr programs on your instance.
Four things that you should never do when customizing your instance:
1. Deleting/disabling snmpd and snmptrapd
2. Disabling PermitRootLogin or PubkeyAuthentication, changing Port in sshd_config
3. Removing scalr public key from /root/.ssh/authorized_keys
4. Delete the following packages or invalidate their dependencies: ec2tools, s3cmd

I want to run apt-get upgrade on an instance of my custom role. Is there any essential software on scalr AMI that I must keep intact?
Make sure that SNMPd is running after the upgrade. Some important dirs that must not be touched: /etc/aws, /usr/local/aws. Finally, be careful when modifying /etc/rc.local.

My application uses file-based sessions. What if my visitor's requests will be proxied to a different app instances?
This wont happen. Nginx is configured to keep visitors bundled to a specific backend server (based on his IP, User-Agent etc).

A26.ログインした後、Applications->View->Edit DNS zoneって移動すれば編集画面あるよ
What if I need to edit my DNS zone?
You can do that in Applications->View->Edit DNS zone.

A27.そういった情報をScalrは「/etc/aws/hosts/」に保存してるよ。例えば「ls /etc/aws/hosts/www」ってコマンドを打つとWWW-Instance群のIP一覧が表示される。或いは「int-{ROLENAME}.domain」みたいな形でサブドメインを使ってもアクセス出来るよ。
How do I know IP adresses of all farm instances from any particular instance?
Scalr stores them in /etc/aws/hosts/ folder. For example
ls /etc/aws/hosts/www
will list all internal IPs of www instances. You can also access them as subdomains int-ROLENAME.domain.

How do I know external IP adresses of my roles?
You can use ext-ROLENAME.domain

How do I connect to MySQL servers from my application?
Like with any master-slave replication, it is important that your application writes only on master and reads from any. This is because slaves are only reading changes from master.
Here is a simple PHP code that will list your mysql master host (to write on) and all mysql hosts (to read from):
$mysql_masters = (array)@glob("/etc/aws/hosts/mysql-master/*");
$mysql_master_host = basename($mysql_masters[0]);
$mysql_all = (array) @glob("/etc/aws/hosts/mysql/*");
$mysql_all_hosts = array();
foreach ((array)$mysql_all as $h) {
array_push($mysql_all_hosts, basename($h));
Another, even simpler way is to use int-rolename.yourdomain dynamic hostnames that resolve to internal IP adresses. Say, you have launched application my.com. MySQL master in this case will be accessible as int-mysql-master.my.com and one random mysql instance will be int-mysql.my.com

A30.「/etc/nginx/nginx.conf」を編集して。で「killall -HUP nginx」を投げて動いているnginxを全部止め。
How do I reconfigure nginx?
Edit /etc/nginx/nginx.conf and issue "killall -HUP nginx" command.

My application tracks IP adresses of visitors. nginx substitutes visitor IP with it's own IP. How do I know client IP address?
nginx passes IPs in X-Real-IP HTTP header. Modify your application to use this header instead, or set up mod_rpaf Apache module (no code modifications will be needed in this case).

A32.Ubuntu 7.04 GNU/Linux
What OS is running on instances?
Ubuntu 7.04 GNU/Linux

How do I cancel my account?
Just cancel your PayPal subscription. You account will remain active until due date.