日々のできごとと写真

2008年12月22日のアーカイブ

Aptana Cloudがとても簡単なのでかけ足で紹介

2008-12-22 01:46 | IT, エントリー | 1 コメント »

Aptana Cloudを利用してみました。
統合開発環境のAptana Studioで有名な米Aptana社が運営しているWebアプリケーションのホスティングサービスです。

AmazonのEC2よりも上位層のアプリケーションレベルのホスティングなので、Google App Engineと同等のホスティングと言えます。

Eclipseからサインアップをしてみる

EclipseにAptanaのプラグインをインストールして、My Aptanaを開きます。

My Aptanaトップ

サイト名(サブドメイン名)と利用方法を決めます。今回は、21日間無料トライアルを利用しました。

サインアップ1

Aptana IDを持っていない場合は、ここでアカウントを作ります。

サインアップ2

利用規約をよく読んで同意します。

サインアップ3

アプリケーションサーバーの環境構築処理が始まります。

サインアップ4

アプリケーションサーバーの構築が完了しました。

サインアップ5

生成されたURLにアクセスすると、なんと、すでに利用可能に。

環境構築後のトップページ

コントロールパネルから全容を把握してみる

Aptana Cloudの構築が終わると、My AptanaにMy Cloudとうタブが加わります。
Aptana Cloudへのアクセスは基本的にこのコントロールパネル上から行います。

Overview

コントロールパネル1

Settings

コントロールパネル2

Stats

コントロールパネル3

Services

コントロールパネル4

Logs

コントロールパネル5

less httpd access_log

コントロールパネル6

アプリケーションのデプロイ

構築はあっという間でした。
Aptana Cloudの最大のメリットはIDEとの連携、そのシームレスさにあります。
Eclipseで開発を行う場合は、そのプロジェクト単位でアプリケーションの開発をおこないますが、そのプロジェクトとCloudをシンクロさせることが可能です。

アップロード

フルスタックのWebアプリケーションフレームワークを利用して開発を行う場合は、フレームワークのプロジェクト=Ecliplseのプロジェクトとすることで、このツールでシンクロし、幾つかコマンドを叩くだけですぐにアプリケーションが利用可能となります。

このスムーズさは感動的です。

ネットワークの近さをみる

pingを使ってみてみましょう。

PING ms76.aptanacloud.com (207.7.120.111): 56 data bytes
64 bytes from 207.7.120.111: icmp_seq=0 ttl=240 time=134.128 ms
64 bytes from 207.7.120.111: icmp_seq=1 ttl=240 time=121.795 ms
64 bytes from 207.7.120.111: icmp_seq=2 ttl=240 time=124.219 ms
64 bytes from 207.7.120.111: icmp_seq=3 ttl=240 time=120.803 ms

今回割り当てられたIPを逆引きをすると、207-7-120-111.joyent.comとなるので
インフラはJoyentを利用しているようです。

tracerouteでは

#snip
10  xe-3-2-0.edge1.LosAngeles9.Level3.net (4.53.228.13)  137.081 ms  112.595 ms  113.381 ms
11  ge-2-1-0-69.bbr2.LosAngeles1.Level3.net (4.68.20.2)  119.894 ms ge-3-0-0-79.bbr1.LosAngeles1.Level3.net (4.68.20.65)  112.601 ms ge-6-2-0-99.bbr1.LosAngeles1.Level3.net (4.68.20.193)  112.317 ms
12  as-2-0.mp2.SanDiego1.Level3.net (64.159.1.138)  110.432 ms as-1-0.mp1.SanDiego1.Level3.net (64.159.1.29)  117.113 ms as-2-0.mp2.SanDiego1.Level3.net (64.159.1.138)  119.620 ms
13  so-8-0.hsa2.SanDiego1.Level3.net (4.68.112.138)  122.329 ms  122.332 ms  122.253 ms
14  sd-gw01-hsa2.nextlevelinternet.com (4.79.33.246)  123.228 ms  122.413 ms  121.994 ms
15  207-7-101-53.sd.nextlevelinternet.com (207.7.101.53)  116.279 ms  116.652 ms  117.598 ms
16  207-7-100-52.sd.nextlevelinternet.com (207.7.100.52)  110.002 ms  111.936 ms  110.253 ms
17  207-7-120-111.joyent.com (207.7.120.111)  115.965 ms  115.817 ms  115.724 ms

LosAngeles、SanDiego(ルートによってはSeattle)などの地名がみえるので
サーバーは北米西海岸にある模様。
EC2よりネットワーク的に速いのは地理の要因でしょうか。

ログインしてシステムをみる

なんとSSHでシェルにも入れます。

            __                       __             __
 ___ ____  / /____ ____  ___ _  ____/ /__  __ _____/ /
/ _ `/ _ \/ __/ _ `/ _ \/ _ `/ / __/ / _ \/ // / _  /
\_,_/ .__/\__/\_,_/_//_/\_,_/  \__/_/\___/\_,_/\_,_/
   /_/ Welcome to ms76.aptanacloud.com!               

/!\ Warning!
SSH access to Aptana Cloud is provided pursuant to the Aptana Cloud
Terms of Service.  See http://www.aptana.com/cloud/tos for important
information related to your access to various areas of your Cloud
Site.  

Aptana does not warrant any Services modified by you via SSH, nor will
we be obligated to support fixing problems that may arise as a result
of such modifications.

無事ログイン。

まずはunameをチェック。

-bash-3.2$ uname -a
SunOS 9a2640a1.joyent.us 5.11 snv_89 i86pc i386 i86pc

もうちょっと詳しく。

-bash-3.2$ cat /etc/release
Solaris Nevada snv_67 X86
Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
Use is subject to license terms.
Assembled 18 June 2007
-bash-3.2$ cat /var/sadm/system/admin/INST_RELEASE
OS=Solaris
VERSION=11
REV=0

Solaris Nevadaということがわかります。

続いてハードウェアをチェックしてみます。

メモリ

-bash-3.2$ /etc/prtconf
System Configuration:  Sun Microsystems  i86pc
Memory size: 32763 Megabytes
System Peripherals (Software Nodes):

CPU

-bash-3.2$ /usr/sbin/psrinfo -v
Status of virtual processor 0 as of: 12/18/2008 15:57:29
on-line since 10/03/2008 03:21:40.
The i386 processor operates at 2660 MHz,
and has an i387 compatible floating point processor.
Status of virtual processor 1 as of: 12/18/2008 15:57:29
on-line since 10/03/2008 03:21:42.
The i386 processor operates at 2660 MHz,
and has an i387 compatible floating point processor.

#snip

Status of virtual processor 6 as of: 12/18/2008 15:57:29
on-line since 10/03/2008 03:21:42.
The i386 processor operates at 2660 MHz,
and has an i387 compatible floating point processor.
Status of virtual processor 7 as of: 12/18/2008 15:57:29
on-line since 10/03/2008 03:21:42.
The i386 processor operates at 2660 MHz,
and has an i387 compatible floating point processor.

ディスク

-bash-3.2$ df -h
Filesystem             size   used  avail capacity  Mounted on
/                        0K   2.1G   4.9G    30%    /
/dev                     0K     0K     0K     0%    /dev
/lib                   2.0G   505M   1.4G    26%    /lib
/platform              2.0G   505M   1.4G    26%    /platform
/sbin                  2.0G   505M   1.4G    26%    /sbin
/usr                   3.9G   888M   3.0G    23%    /usr
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                    72G   176K    72G     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                       3.9G   888M   3.0G    23%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   256M    96K   256M     1%    /tmp
swap                    72G    12K    72G     1%    /var/run

8つのCPU、32GBのRAMを仮想サーバー(Solaris コンテナ)でシェアしている模様。
この当たりはもともとJoyentの仕様っぽいですね。

すぐに使える言語やサービスをみる

Webアプリケーションに利用する言語やミドルウェアをチェックしてみましょう。

Ruby

-bash-3.2$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-solaris2]
-bash-3.2$ gem -v
1.3.1
-bash-3.2$ rails -v
Rails 2.2.2

PHP

-bash-3.2$ php -v
PHP 5.2.5 (cli) (built: Feb  4 2008 23:39:26)
-bash-3.2$ pear info pear
Packaged With PEAR  1.5.4

Perl

-bash-3.2$ perl -v
This is perl, v5.8.8 built for i386-solaris-thread-multi
-bash-3.2$ cpan -v
cpan script version 1.03
CPAN.pm version 1.7602

Java

-bash-3.2$  java -Xmx32m -version
java version "1.6.0_06"
Java(TM) Platform, Standard Edition for Business (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

Python

-bash-3.2$ python -V
Python 2.4.4

Apache

-bash-3.2$ apachectl -v
Server version: Apache/2.2.8 (Unix)
Server built:   Feb  4 2008 23:16:59

MySQL

-bash-3.2$ mysql -V
mysql  Ver 14.12 Distrib 5.0.51, for sun-solaris2 (i386) using readline 5.2

PostgreSQL(未起動)

psql (PostgreSQL) 8.2.6
contains support for command-line editing

SQLite

-bash-3.2$ sqlite -version
2.8.16

この辺りはEC2と違ってはじめから全部入りの模様です。
Google App Engineが現在はPythonのみをサポートしていることを考えると、対象の開発者は絶対的に多いはずです。
しかし、逆にメモリが苦しいからPHP外したいとか、passengerではなくmongrelで動かしたいとかいうワガママは通らないようです。

自分のドメインで利用する

Aptana Cloudを構築するとサブドメインとグローバルなIPアドレスが振られます。
なので、DNSでAレコード、もしくはCNAMEレコードを設定するだけです。
この辺りはFAQに載っています。

追記
12/22 13:40 タイトル変更しました。