2009年5月13日水曜日

Scalr公式のFAQ

Scalr(スケィラー)公式サイトにあるFAQの和訳を試みる。
ついでに解答を粉飾してみる。私の方で付け加えた情報は※の部分です。
■Frequently Asked Questions
間違ってたら指摘してくれると、泣いて喜びます。


Q1.Scalr使うのにAWSのAccountって必要なの?
A1.必須だよ。
Do I need an AWS account to use SCALR?
Yes, you do need to have an AWS account.


Q2.自分のAWSのAccountIDってどこみれば解る?
A2.AWSにアクセスしてログイン、その後「Your Account > Personal Information 」と移動。その後の画面の右上にある「Account Number」が「AccountID」。
※よく間違える人いるけどログインの時に使うIDじゃないよ。
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.


Q3.「Farm」て何?
A3.特定のApplicationを提供するのに必要な何個かのInstanceの集まりの事を「Farm」と呼ぶ。典型的な例でいえば下記のようなInstanceのSetを指す。
・LoadBalancerが入ったInstance・・・1~2個
・Applicationが入ったInstance・・・2~個
・DBが入ったInstance・・・1~個
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.


Q4.「Role」て何?
A4.「Role」は「とある特定の機能を提供する為のAMI」。Scalrの方で幾つかの「共有Role」を用意してあるよ。
・www - LoadBalancerが入ってる
・app - Apacheがはいってる
・mysql - MySQLが入ってる
・base - 何も手をつけていない綺麗なAMI。これを元に独自のRoleが作ってね。
これらのRoleを元に独自の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.


Q5.「Application」て何?
A5.「Farm」を利用して提供するWebサイト、或いはWebServiceの事。
What is "application"?
Application is basically a website that is running on a farm.


Q6.「Farm」が再構成された際、DNSって自動で書き換わるの?
A6.ネームサーバの設定をns1.scalr.net, ns2.scalr.net and ns3.scalr.netにしてくれれば、Scalrが巧くやってくれるよ。
※Scalr.netに登録した場合の話。自力で環境作る場合は自分で用意する必要あり。
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.


Q7.AppInstanceで仮想ホストって使える?
A7.まだ使えません。1Farm上で複数個のアプリ使いたい時は自己責任で☆
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.


Q8.MySQLのReplicationってどうなるの?
A8.ScalrはMySQLのReplicationとか設定変更も監視してる。突然MySQL-Instanceが落ちても、他のMySQL-Instanceは動的にMaster/Slaveを切り替えてくれるよ。
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.


Q9.おk。俺のアプリ完成、Farmも立ち上げた。次は?
A9.立ち上げたFarmの中のApplicationInstanceに作ったアプリをアップロードしれ。
OK, I created application, built and launched a farm. Now what?
Upload your application on app instances.


Q10.自分でファイル起きたいんだけど、どこに置けばいいの?
A10.AppRoleのInstanceなら「/var/www」。WWWRoleのInstanceなら「/var/www/nginx-default」。
まぁWWWRoleのInstanceになんか置くことないだろうけどね。
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)


Q11.InstanceにSSH接続したいな
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.


Q12.ダウンロードした暗号鍵をPuttyで使うにはどうしたらええの?
A12.ここ見れ。Follow this manual
How do I use downloaded private key in Putty?
Follow this manual


Q13.「Synchronize to all」ってやるとどうなるの?
A13.とあるInstanceに加えた変更を、同一Roleの他のInstanceにも反映させたい時に使えばいい。押すとScalrがそのInstanceをAMIとして保存し直して、順次他の古いInstanceを落とし、新しいAMIを元にしたInstanceに切り替えてくれる。
※すいません。ここよく分からないです。
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.


Q14.App-InstanceとWWW-Instanceとの間のコンテンツの同期ってScalrは面倒見てくれるの?
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.


Q15.Instanceを制御するのにScalrとElasticFoxみたいのを組み合わせて使えない?
A15.Instance、EBS、ElasticIP等をScalr以外から操作する事は推奨出来ません。例えばElasticFoxからElasticIPの変更をした場合、Scalrはこの操作を殆ど追跡できないので意図しない結果を招く事になります。
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」って何?
A16.LAは「LoadAverage」の略。Scalrは全Instanceの最後15分の負荷を元にInstanceの数を調整する。平均負荷が上限設定を超えたら新しいInstanceを立ち上げるし、下限設定を下回ったら一個Instanceを落とすよ。
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」って何?
A17.Scalrは、LAの制限なんて無視してその二つで指定された範囲内でInstanceの数を調整するよ。
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.


Q18.Scalr.netから退会したら俺の作ったFarmとかInstanceって止まってくれるの?
A18.いいえ。Scalrから監視もされないでそのまま放置されます。
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.


Q19.HTTPRequestなげると、全WWW-Instanceに伝わるの?
A19.ScalrはWWW-InstanceそれぞれにPublicIPを割り当てます。これはDNSラウンドロビンと呼ばれる機能です。別の利用者からのRequestは別のWWW-Instanceに届くでしょう。
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.


Q20.WWWのRoleに入ってるロードバランサーって何?
A20.nginx
What software is running on www role instances?
nginx.


Q21.俺のAMIとかInstanceをScalrに登録出来る?
A21.ごめん。今だとScalrが提供してる「Base」Roleから作った奴じゃないと登録出来ないんだ。次のVersionからはどんなAMIでも登録出来る様になるよ。
※1.0RC5をInstallしたけど、Base以外のも登録できた気がする。
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.


Q22.独自でRoleを作るには?
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.


Q23.
A23.
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


Q24.独自で作ったRoleのInstanceでapt-getしたいだけど、絶対に上書きしちゃいけないProgramってある?
A24.apt-getした後、SNMPデーモンが動いてる事は確認してね。あと触らない方がいいDirectoryは「/etc/aws」と「/usr/local/aws」。後「/etc/rc.local」を編集する時は気を付けてね。
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.


Q25.ファイルを利用してSession管理するアプリなんだけど、複数個App-Instanceある時に動作がおかしくならないかな?
A25.その心配はいらないよ。Nginxが利用者のIPとかUser-Agent等を元に特定して利用するServer割り当ててるからね。
※ここもよく分からん。
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).


Q26.DNSゾーン編集しなきゃいけなくなんだけど?
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.


Q27.あるInstanceから、同じFarmで動いてる他のInstanceのIPしりたい時はどうしたらいい?
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.


Q28.Roleの外部IP知りたい
A28.「ext-{ROLENAME}.domain」でアクセス出来るよ。
How do I know external IP adresses of my roles?
You can use ext-ROLENAME.domain


Q29.App-InstanceからMySQL-InstanceのDBに接続するには?
A29.
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


Q30.nginxの設定をいぢりたいんだけど?
A30.「/etc/nginx/nginx.conf」を編集して。で「killall -HUP nginx」を投げて動いているnginxを全部止め。
※次から起動するnginxは新しい設定を読む。
How do I reconfigure nginx?
Edit /etc/nginx/nginx.conf and issue "killall -HUP nginx" command.


Q31.
A31.
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).


Q32.InstanceのOSって何?
A32.Ubuntu 7.04 GNU/Linux
What OS is running on instances?
Ubuntu 7.04 GNU/Linux


Q33.Scalr.netをやめるには?
A33.PayPalの支払いを停止すればOK。やめても最後の支払いの有効期限までは使えるよ。
How do I cancel my account?
Just cancel your PayPal subscription. You account will remain active until due date.

0 件のコメント: