Webエンジニア susumuis の技術ブログ

このブログの内容は個人の見解であり、所属する組織の公式見解ではありません

Google Cloud Platform に Google Compute Engine を構築して、Wordpressを動かすまで(その2 - LAMP環境の構築)

前回 : Google Cloud Platform に Google Compute Engine を構築して、Wordpressを動かすまで(その1 - instance に SSHで接続するまで) - susumuis Info

それでは、昨日に引き続き、ビギナーの記録的日記を書きます。

GCE上のDebianにWordPressをインストール

ところで、MacでSSH使ってると、Broken Pipeでしょっちゅう切れませんか? そんな時はSSH接続前に、Macのターミナルで、あああああ下記の設定を入れましょう。

ishigami-air:~ susumuis$ vim .ssh/config 
ServerAliveInterval 15

ではDebianということで、aptを更新しましょう。

susumuis@instance-1:~$ sudo aptitude update
susumuis@instance-1:~$ sudo aptitude safe-upgrade

さて、LAMP環境をインストールしましょう。Ubuntuだったらここで、taskselで一発でしたね。 ということで、

susumuis@instance-1:~$ sudo aptitude tasksel

すると、下記の警告が。。。。

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "ja_JP.UTF-8"
    are supported and installed on your system.

さきに、日本語環境をインストールしましょう。

susumuis@instance-1:~$ sudo dpkg-reconfigure locales

[*] ja_JP.UTF-8 UTF-8 を選びます。

それでは気を取り直して

susumuis@instance-1:~$ sudo aptitude tasksel

すると、期待に反して、

パッケージの設定
                  ┌──────────────────────────────────┤ ソフトウェアの選択 ├──────────────────────────────────┐
                  │ 以下の定義済みソフトウェアコレクションからインストールするものを 1 つ以上選択できます。  │ 
                  │                                                                                          │ 
                  │ インストールするソフトウェアの選択:                                                      │ 
                  │                                                                                          │ 
                  │    [ ] Debian desktop environment                                                        │ 
                  │    [*] Web server                                                                        │ 
                  │    [ ] Print server                                                                      │ 
                  │    [ ] SQL database                                                                      │ 
                  │    [ ] DNS Server                                                                        │ 
                  │    [ ] File server                                                                       │ 
                  │    [ ] Mail server                                                                       │ 
                  │    [ ] SSH server                                                                        │ 
                  │    [ ] Laptop                                                                            │ 
                  │                                                                                          │ 
                  │                                                                                          │ 
                  │                                          <了解>                                          │ 
                  │                                                                                          │ 
                  └──────────────────────────────────────────────────────────────────────────────────────────┘ 

UbuntuみたいにLAMP環境みたいな便利なのは出てこないのですね。。。 SQL databaseを選んでも何が入るかわからないので、とりあえず、Web serverだけ入れて、 あとはaptから入れることにします。

<了解>を押して、しばらく待つと処理が終わったようです。本当にapacheが入ったか見てみましょう。

susumuis@instance-1:~$ ls /etc/init.d/
README       checkfs.sh              google                   hostname.sh  mountall-bootclean.sh  mountnfs.sh  rc         rsync     ssh        umountnfs.sh
acpid        checkroot-bootclean.sh  google-accounts-manager  hwclock.sh   mountall.sh            mtab.sh      rc.local   rsyslog   sudo       umountroot
apache2      checkroot.sh            google-address-manager   killprocs    mountdevsubfs.sh       networking   rcS        sendsigs  udev       urandom
bootlogs     cron                    google-startup-scripts   kmod         mountkernfs.sh         ntp          reboot     single    udev-mtab
bootmisc.sh  generate-ssh-hostkeys   halt                     motd         mountnfs-bootclean.sh  procps       rmnologin  skeleton  umountfs

3行目にapache2が入っていますね!再起動してみましょう。

susumuis@instance-1:~$ sudo service apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .

できました!アクセスしてみましょう。そのためには、GCEのfirewallの設定を変更しなければいけません。

Developers Consoleから プロジェクト > プロジェクト名 > Compute Engine > ネットワーク をクリックし、 すべてのネットワーク の下にある default リンクをクリックすると、出てくる画面で、 ファイアウォールルール新規作成 をクリックします。

名前は適当でよいですが "default-http"

ソース範囲は "0.0.0.0/0"

許可対象プロトコル/ポートは "tcp:80"

にしました。

f:id:s-ishigami:20140502215454p:plain

それでは、インスタンスのIPアドレスに対してブラウザからアクセスしてみます。 そうすると、

It works!

と表示されたと思います。ついでですので、本当に動いているか、ちょっと遊んでみましょう。

susumuis@instance-1:~$ sudo vim /var/www/index.html

ここで編集したとおりの内容が反映されると思います。

それでは引き続き、php, mysql(いわゆるLAMP環境)を入れてみます。

susumuis@instance-1:~$ sudo aptitude install mysql-server
以下の新規パッケージがインストールされます:
  heirloom-mailx{a} libaio1{a} libdbd-mysql-perl{a} libdbi-perl{a} libhtml-template-perl{a} libmysqlclient18{a} libnet-daemon-perl{a} libplrpc-perl{a}
  mysql-client-5.5{a} mysql-common{a} mysql-server mysql-server-5.5{a} mysql-server-core-5.5{a} psmisc{a}
更新: 0 個、新規インストール: 14 個、削除: 0 個、保留: 3 個。
10.2 M バイトのアーカイブを取得する必要があります。展開後に 98.5 M バイトのディスク領域が新たに消費されます。
先に進みますか? [Y/n/?] Y

MySQLのインストール後は、mysql_secure_installationを使うと良いようなので、やってみます。

susumuis@instance-1:~$ mysql_secure_installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

こうですか?わかりません>< 本番環境構築するときはもうちょっと深くMySQL勉強したほうが良さそうですね。

次に、PHPを入れてみます。

susumuis@instance-1:~$ sudo aptitude install php5 php-pear php5-mysql
以下の新規パッケージがインストールされます:
  apache2-mpm-prefork{ab} libapache2-mod-php5{a} libonig2{a} libqdbm14{a} libxml2{a} php-pear php5 php5-cli{a} php5-common{a} php5-mysql sgml-base{a}
  xml-core{a}
更新: 0 個、新規インストール: 12 個、削除: 0 個、保留: 3 個。
7,506 k バイトのアーカイブを取得する必要があります。展開後に 23.4 M バイトのディスク領域が新たに消費されます。
以下のパッケージには満たされていない依存関係があります:
 apache2-mpm-worker : 競合: apache2-mpm[仮想パッケージです]
 apache2-mpm-prefork : 競合: apache2-mpm[仮想パッケージです]
以下のアクションでこれらの依存関係の問題は解決されます:

     以下のパッケージを削除する:
1)     apache2-mpm-worker



この解決方法を受け入れますか? [Y/n/q/?]Y

こんな感じでしょうか。だんだん怪しくなってきたぞ (^^;

不要かもしれないけど、なんとなく、apacheを再起動してみます。

susumuis@instance-1:~$ sudo service apache2 restart

PHPが入ってるか、phpinfoを表示してみます。

susumuis@instance-1:~$ cd /var/www/
susumuis@instance-1:/var/www$ sudo vi test.php

test.phpには

<?php phpinfo() ?>

と書いておきます。ブラウザでhttp://IPアドレス/test.phpにアクセスすると。。。

f:id:s-ishigami:20140504203813p:plain

あ、ちゃんとphpinfoでますね!確認したらphpinfoはさっさと削除してしまいます。

susumuis@instance-1:/var/www$ sudo vi test.php

次にちゃんとmysqlが入ったかどうか遊んでみます。

susumuis@instance-1:/var/www$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.5.35-0+wheezy1 (Debian)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql> create database ishigami;
Query OK, 1 row affected (0.00 sec)

mysql> use ishigami;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> create table ishigami ( id integer primary key, name text );
Query OK, 0 rows affected (0.01 sec)

mysql> show tables;
+--------------------+
| Tables_in_ishigami |
+--------------------+
| ishigami           |
+--------------------+
1 row in set (0.00 sec)

mysql> select * from ishigami;
Empty set (0.00 sec)

mysql> insert into ishigami (id, name) values (1, 'susumu');
Query OK, 1 row affected (0.00 sec)

mysql> select * from ishigami;
+----+--------+
| id | name   |
+----+--------+
|  1 | susumu |
+----+--------+
1 row in set (0.00 sec)

mysql> quit;
Bye

問題なさそうです!

一度、この先も一回のエントリで書いたのですが、長くなったので分割します。 それでは次回に続きます。

次回: Google Cloud Platform に Google Compute Engine を構築して、Wordpressを動かすまで(その3 - wordpressらしきものが動いた!) - susumuis Info

Google Cloud Platform に Google Compute Engine を構築して、Wordpressを動かすまで(その1 - instance に SSHで接続するまで)

先日、GCEを使って遊んでみました。 基本的なことですが、自分用のログとして残します。

なお、事前にGoogle Cloud Platformの登録は済んでいてプロジェクト作成済みで、インスタンスも作成済み、さらにgcutilもインストール済みとします。(そこまでの記録は別エントリを書くかもしれませんが、今回は扱いません)*1

gcutil経由でSSH接続をする

まずは gcutil が使えることを確認します。

ishigami-air:Commands susumuis$ gcutil
You do not currently have an active account selected.
Please run:

  $ gcloud auth login

to obtain new credentials, or if you have already logged in with a
different account:

  $ gcloud config set account <account name>

to select an already authenticated account to use.

バージョンも見てみましょう。

ishigami-air:Commands susumuis$ gcloud --version
Google Cloud SDK 0.9.21

bq 2.0.18
bq-nix 2.0.18
core 2014.04.08
core-nix 2014.04.08
gcutil 1.15.0
gcutil-nix 1.13.0
gsutil 3.42
gsutil-nix 3.42
sql 2014.04.15


There are available updates for some Cloud SDK components.  To
install them, please run:
 $ gcloud components update

updateできるというので、早速やってみよう。

ishigami-air:Commands susumuis$ gcloud components update

The following components will be updated:
    ------------------------------------------------------------------------------
    | BigQuery Command Line Tool                           |     2.0.18 | < 1 MB |
    | BigQuery Command Line Tool (Platform Specific)       |     2.0.18 | < 1 MB |
    | Cloud SDK Core Libraries                             | 2014.04.24 | < 1 MB |
    | Cloud SDK Core Libraries (Platform Specific)         | 2014.04.24 | < 1 MB |
    | Cloud SQL Admin Command Line Interface               | 2014.04.24 | < 1 MB |
    | Cloud Storage Command Line Tool (Platform Specific)  |       3.42 | < 1 MB |
    | Compute Engine Command Line Tool (Platform Specific) |     1.15.0 | < 1 MB |
    ------------------------------------------------------------------------------
The following components will be installed:
    ----------------------------------------------------------------
    | Cloud DNS Admin Command Line Interface | 2014.04.24 | < 1 MB |
    ----------------------------------------------------------------

Do you want to continue (Y/n)?  Y

Creating update staging area...

Uninstalling: BigQuery Command Line Tool ... Done
Uninstalling: BigQuery Command Line Tool (Platform Specific) ... Done
Uninstalling: Cloud SDK Core Libraries ... Done
Uninstalling: Cloud SDK Core Libraries (Platform Specific) ... Done
Uninstalling: Cloud SQL Admin Command Line Interface ... Done
Uninstalling: Cloud Storage Command Line Tool (Platform Specific) ... Done
Uninstalling: Compute Engine Command Line Tool (Platform Specific) ... Done

Installing: BigQuery Command Line Tool ... Done
Installing: BigQuery Command Line Tool (Platform Specific) ... Done
Installing: Cloud DNS Admin Command Line Interface ... Done
Installing: Cloud SDK Core Libraries ... Done
Installing: Cloud SDK Core Libraries (Platform Specific) ... Done
Installing: Cloud SQL Admin Command Line Interface ... Done
Installing: Cloud Storage Command Line Tool (Platform Specific) ... Done
Installing: Compute Engine Command Line Tool (Platform Specific) ... Done

Creating backup and activating new installation...

Done!

それでは、早速作ったアプリにログインします。

ishigami-air:Commands susumuis$ gcloud auth login
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbigquery+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fndev.cloudman+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fsqlservice.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fprediction+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fprojecthosting&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&response_type=code&client_id=***********.apps.googleusercontent.com&access_type=offline



You can view your existing projects and create new ones in the Google
Developers Console at: https://console.developers.google.com. If you
have a project ready, you can enter it now.

ここで表示されたURLをクリックするように書いてありますが、僕の環境では、そもそもブラウザが勝手に立ち上がって、認証画面が表示されました。

f:id:s-ishigami:20140504203245p:plain

承認すると

You are now authenticated with the Google Cloud SDK.

The authentication flow has completed. You may close this window, or check out the Getting Started Guide for more information.

と表示されます。よく見ると、URLがlocalhostですね。gcutilがWebサーバーを立てているようです。

一方端末側では

Enter your Google Cloud project ID (or leave blank to not set):

と聞かれています。blankでも良いというのですが、僕はとりあえずプロジェクト名である。

API Project

と入れてみます。(これで後でハマります) すると、

You are logged in as ************@gmail.com.

There are available updates for some Cloud SDK components.  To
install them, please run:
 $ gcloud components update

これでログイン状態になったようです。それでは、早速コマンドを実行してみましょう。

ishigami-air:Commands susumuis$ gcutil listregions
CommandError: Characters in project name must be lowercase: API Project.

おかしいですね。プロジェクト名は全部lowercaseにしろとか。それで色々調べた結果、"gcloud config set project "でproject IDを変更できるようです。

ishigami-air:~ susumuis$ gcloud config set project 26*********
ishigami-air:~ susumuis$ gcutil listregions
+--------------+--------+----------+----------------+------------------+
| name         | status | cpus     | disks-total-gb | static-addresses |
+--------------+--------+----------+----------------+------------------+
| asia-east1   | UP     | 1.0/24.0 | 10.0/5120.0    | 0.0/7.0          |
+--------------+--------+----------+----------------+------------------+
| europe-west1 | UP     | 0.0/24.0 | 0.0/5120.0     | 0.0/7.0          |
+--------------+--------+----------+----------------+------------------+
| us-central1  | UP     | 0.0/24.0 | 0.0/5120.0     | 0.0/7.0          |
+--------------+--------+----------+----------------+------------------+

やれやれ、やっとできました。早速instance-1にSSHで繋いでみましょう。

ishigami-air:~ susumuis$ gcutil ssh instance-1
INFO: Zone for instance-1 detected as asia-east1-b.
WARNING: You don't have an ssh key for Google Compute Engine. Creating one now...
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

初めての接続なので、SSHの鍵を作るからパスフレーズを入れてくれと言われます。鍵を持ってるクライアントでしかアクセス出来ないようです。 初期状態で鍵認証なのでセキュリティ的には安心ですね! Macだとここで、key chainのダイアログが出てきてパスワードを聞かれます。

Linux instance-1 3.13-0.bpo.1-amd64 #1 SMP Debian 3.13.7-1~bpo70+1 (2014-03-29) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Debianにログインしていることがわかります。

一度鍵をつくれば、後は普通にssh接続することも可能です。

ssh ユーザー名@IPアドレス

上記同様のメッセージが表示され、Debianに接続されています。

それでは、色々試してみましょう。

susumuis@instance-1:~$ pwd
/home/susumuis
susumuis@instance-1:~$ whoami
susumuis
susumuis@instance-1:~$ df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                  9.8G  652M  8.6G   7% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                    60M   80K   60M   1% /run
/dev/disk/by-uuid/3816747c-4543-4118-9797-d429d1554032  9.8G  652M  8.6G   7% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   119M     0  119M   0% /run/shm

ルート10GBしかないですね。追加の容量はGoogle Cloud Strageを購入してマウントすると良いでしょう。 引き続き、ここにLAMP環境を構築して、Wordpressを動かした手順を紹介したいと思います。 もっとも、ここから先は、どの環境でやってもDebianなら同じになりますから、サーバーに慣れた方は、不要な情報になるでしょう。

続きはこちら:  Google Cloud Platform に Google Compute Engine を構築して、Wordpressを動かすまで(その2 - LAMP環境の構築) - susumuis Info

*1:なぜかって言うと、自分で取った手順ログがそこからだから

gcp ja night #27に参加してきました。(+Google Cloud Platformとクラウドプラットフォームの今をおさらい付き)

gcp ja night #27 - connpass
に参加してきました。

僕とgcpja night(旧称appengine ja night)

私事で恐縮ですが、僕は旧appengine ja nightの常連だと思っていました。一時期毎回のように参加をしていたと思います。しかしどうやら、僕が最後に参加したのはappengine ja night #19 : ATNDのようです。。。2年以上ブランク開けちゃってたのですね!
その間、僕は勤務先の会社での仕事で一杯一杯*1でしたが、外部へ視野を広げることをいかに怠っていたのかを反省します。

ここ最近のクラウド界隈の動きとか(予習)

その間にGoogle App Engine界隈、いや、Google Cloud Platformの状況がだいぶ変わっていました。例えば最近GoogleとAmazonでクラウドサービスの値下げ合戦がありましたね。
Google、クラウド・プラットフォームで全面攻勢―大幅値下げ、新サービスをローンチ | TechCrunch Japan
Googleに負けじとAmazonがS3, EC2, ElastiCache, Elastic MapReduce, RDSを大幅値下げ | TechCrunch Japan

そもそも、いつの間にか、GoogleはEC2の競合サービスを出していたのですね!昨年末に正式リリースされています。
Google Compute Engineが正式サービスへ。Docker、FreeBSD、CoreOSもサポート。ストレージは1GBあたり月額4円へ値下げ - Publickey

また、rebuild.fmを聞いていると、最近はImmutable Infrastructureとか Disposable Componentとかのキーワードがホットになっています。Immutable Infrastructureって何でしょうか。

Immutable Infrastructureとは「Immutable(不変な)」の意味通り「一度セットアップし運用中のサーバは変更をしない」という運用スタイルです。サーバの設定変更などをしたい場合は、現在運用している環境(サーバ群)を変更せずに、まったく新しい環境を用意し、環境の設定変更が終わったら、ルータやロードバランサ等で新しいサーバ群に切り替えるというものです。

今年流行りそうな「インフラエンジニア」向けトレンドのまとめ その1 (Blue-Green DeploymentとImmutable Infrastructure編)


Immutable Infrastructure を調べてみると、Dockerというキーワードがヒットします。
Docker: Linuxコンテナを使ってアプリケーションの配置を支援する

そして、上記記事にもありますが、CoreOS というディストリビューションが出てきます。みんながCentOSと見間違えるCoreOSについて調べると

CoreOS は Alex Polvi が設立した会社であり、OS、新しい Linux Distribution である。OSS で公開されている。
Polvi 氏といえば Rackspace に 買収された CloudKick を立ち上げ、その後も Rackspace 働いていたクラウドの専門家とも言えるだろう。
その Polvi 氏以外にも Googler や Linux 関連の人材、アドバイザーに Linux の stable branch のメンテナ
を迎えるなど、Linux に関する知識がかなり豊富なメンバーが集まっている。
その彼らが作っているのが CoreOS である。

CoreOS は Google や Facebook などの環境を参考にしており、柔軟にスケールし、さらにはインフラ構築その...

CoreOS 入門 - Qiita

そして、上の方の記事で、CoreOSはGoogle Compute Engineでもサポートされてるってありますね!

ふう、やっとつながった。


というのは、ここ1,2ヶ月で浦島太郎状態だった僕がようやく追いついた、にわかインフラ知識ですが、今、クラウド関連の世界はこうなっているんだっていう背景知識を持っていないと、今回の勉強会はキツイのではないでしょうか。

appengineとかslim3とか触ってた人たちが、旧に最近Dockerとか使い始めたのはなぜなのか知っておく必要があるようです。

勉強会報告

gcp ja night #27は、六本木ヒルズのグーグル 東京オフィスで開催されました。
発表内容知らなかったのですが、昼間にもイベントがあったようですね。Togetterは勝手に夜の部が始まる2ページ目をリンクしときます。(18:45くらいからnightの部になります)
2014.4.22 gcp ja night #27 & 「Google Cloud Platform セッション 最新技術と日本での展開について」 #gcpja - Togetterまとめ

発表内容と会場の反応はconnpassとtogetterを参照してください(てきとーだなw)

発表内容でオフレコを支持されたものが多く、参加できてよかったなあと思います。テレビ番組連動のリアルタイム通信の事例はただただ面白かったです!しかもGCPを使ったらめちゃくちゃ安かったとか!

@shin1ogawa さん+ @sinmetal さんのManaged VMの話も興味深かったです。Managed VMとは

これはGoogle App Engineの環境の下で仮想マシンを走らせることにより、仮想マシンの面倒をApp Engineが見てくれるというもの。仮想マシンの構成は開発者が自由に行えます。

[速報]Google、「Managed Virtual Machines」発表。Google App Engine内で仮想マシンを管理 - Publickey

shin1さんの説明では、GCEにappengineのプラットフォームを載せたようなものだって言っていました。その方がわかりやすい。

まだ、日本語での情報は上記記事を除いて殆ど無く、この発表のスライドも公開されないと思いますので、まだ一部の人達しか触れないヴェールに包まれた存在ですが、会場では、SSHとか使えない仮想マシンに対してSSHは使えるようです。*2、Webブラウザ越しであんなことやこんな(ry
Docker的なニュアンスがチラ見えしました。

これは面白いです。インフラの運用って大変ですから、我々Webエンジニアはあまりやりたくない、でも、従来のGoogle App Engineは、ファイルの保存ができなかったり、サーバーにパッケージをインストールできなかったりするので、融通が利かないという問題がありました。

これを使えば、今までできなかったサーバーのカスタマイズをしながら、ファイルに保存しながら、appengineアプリを開発できるんですね!

個人的には、需要があるかわかりませんが、JavaのMayaaテンプレートエンジンがManaged VMでまともに使えるようになるのではないかと期待しています。*3

ただ、会場の雰囲気だと、スピンアップに7秒くらいかかるJavaはどうなの?っていうコメントが多く、かつて、appengine ja night で slim3 とか追いかけていた人たちも、最近の興味はGoとかに行っているようです。

ここでも、Javaは不遇な子。。。。
かつて、GAE/J, GWT, Guiceなど、GoogleのJavaに対するアウトプットを僕は好きでした。

感想

このエントリの前半に書いたようなにわか知識でなんとか付いて行けましたが、正直自分の遅れっぷりに呆れました。しかし一方でこの勉強会で登壇されている方はかなり先進的な領域にいる方だと思います。

上記の「にわか知識」自体がかなり尖った領域で、Google検索してもまだ日本語の情報が足りない状況なので、今から勉強しても十分追いつけるような気がします。逆に今ついていかないと、途中から追いつくのはとても大変だったと思います。

GCP $500 無料券をもらったので、さっそく、自分も試してみようと思います。

写真

え、会場は銭湯?
f:id:s-ishigami:20140422223612j:plain

こんなものまでGoogle製
f:id:s-ishigami:20140422223537j:plain

このシャワーは使えるのだろうか?
f:id:s-ishigami:20140422223550j:plain

銭湯でピザ取り分けていますw
f:id:s-ishigami:20140422204037j:plain

$500 無料券(え、500円じゃない?すげー!!)
f:id:s-ishigami:20140423132501j:plain

*1:その間に会社は全サービスをオンプレミスからAWS等のクラウドに移行を済ませ、僕自身は一プログラマーから開発チームリーダーに転身し、事務所は秋葉原から飯田橋に移転し、15人くらいだったメンバーが40人を超え……

*2:https://twitter.com/sinmetal/status/458842820355166208

*3:Mayaaは、キャッシュファイルをファイルシステムにキャッシュする機能があるので、ファイルシステムを使えるManaged VMがあれば実用に耐えるのではないかと思っています。これまでは、ファイルシステムへのキャッシュができなかったので、メモリのみのキャッシュになりますが、スピンアウトしてしまうとキャッシュが消えてしまうので、致命的でした。もちろんキャッシュをmemcachedに格納するとかすればできるでしょうけど、まあそこまでしてまでってのもあって。。。