2011年5月4日星期三

亚马逊公布宕机事故报告 zz

亚马逊公布了Amazon EC2云服务器宕机的事故报告。太平洋夏令时4月21日凌晨12:47,位于美国东区的一个可用区(数据中心)执行了一次正常的Amazon Web Services伸缩活动,为了完成升级需要临时转移网络流量,标准的做法是将流量卸载到Elastic Block Store(EBS)主网络中的冗余路由器。然而流量转移未被正确执行,流量没有被路由到EBS主网络的冗余路由器中,而是被路由到了冗余EBS次网络的低容量路由器中,它无法处理如此高的流量。导致的结果是,受影响数据中心的许多EBS节点与其它节点完全孤立开来,主网络和次网络同时断开连接。用通俗的话说,亚马逊在进行高速公路扩建工作,它不是关闭了建设中的高速公路的一条通道,而是不小心关闭了整个高速公路,迫使所有汽车穿过容量有限的城镇公路,结果导致了严重的交通堵塞,所有人都被迫停在原地。类似去年中国发生的绵延100公里的大塞车

标签:


2011年4月25日星期一

试用Amazon EC2云计算服务

Ubuntu 10.10 版本发布以后,口号是 “10 out of 10″,Canonical联合 Amazon 免费为尝鲜者提供1小时的 Ubuntu 10.10 Server 版本的试用,有点像当初 Ubuntu 桌面版免费寄光盘的味道,现在光盘驱动器安装操作系统的方式已经过时了,云时代流行 iso 和模板安装。

可以通过 Try Ubuntu 10.10 Server in Amazon EC2 链接申请免费试用1个小时的Amazon EC2云计算服务,不要被 “云” 吓到,实际上就是1个 Xen VPS 而已。

1、 Try Ubuntu 10.10 Server in Amazon EC2 —>Try Ubuntu 10.10—>Sign in to Ubuntu AWS Trial,用Ubuntu One帐号登录试用。

登录成功后显示

 

Sign in to Ubuntu AWS Trial

If you proceed, the following information will be available to Ubuntu AWS Trial:

Yes, sign me in or cancel

点击Yes, sign me in.

2、经过一番初始化配置,并且选择应用为Wordpress,最后会得到页面如下。

无标题

可以通过SSH对该服务器进行管理,ip地址是50.16.72.11,管理帐户ubuntu:Z4uufJMHK,同时提示在初次登录后必须修改口令,并提供云服务器的SSH Key 指纹。

3、可以通过http://ec2-50-16-72-11.compute-1.amazonaws.com/访问Wordpress服务,并通过点击Cloud-Config查看云服务器的配置。如下

#cloud-config

apt_update: true

#apt_upgrade: true

packages:
- wordpress
- mysql-server
- apache2-mpm-prefork
- php5
- php5-mysql
- libapache2-mod-php5
- curl
- postfix

fixroutingsilliness:
- &fix_routing_silliness |
   public_ipv4=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
   ifconfig eth0:0 $public_ipv4 up

configapache:
- &config_apache |
   public_hostname=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
   public_ipv4=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
   cat > /etc/apache2/sites-available/wordpress <
       UseCanonicalName off
       Options All
       ServerAdmin webmaster@localhost
       ServerName $public_hostname
       ServerAlias $public_ipv4

       VirtualDocumentRoot /var/www/%0
       RewriteEngine on
       RewriteRule ^/wp-uploads/(.*)$ /var/www/wp-uploads/%{HTTP_HOST}/\$1

       ErrorLog \${APACHE_LOG_DIR}/wordpress-error.log
       LogLevel warn
       CustomLog \${APACHE_LOG_DIR}/wordpress-access.log combined
  
   EOF
   a2enmod rewrite vhost_alias
   a2ensite wordpress

configpostfix:
- &config_postfix |
   public_hostname=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
   postconf -e myhostname=$public_hostname
   postconf -e mydestination=$public_hostname,localhost
   echo $public_hostname > /etc/mailname
   postfix reload

configmysql:
- &config_mysql |
   public_hostname=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
   /etc/init.d/mysql restart
   bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress $public_hostname

restartapache:
- &restart_apache |
   /etc/init.d/apache2 restart

runcmd:
- [ sh, -c, *fix_routing_silliness ]
- [ sh, -c, *config_postfix ]
- [ sh, -c, *config_mysql ]
- [ sh, -c, *config_apache ]
- [ sh, -c, *restart_apache ]
- touch /tmp/done

ok!

标签: ,


This page is powered by Blogger. Isn't yours?

订阅 博文 [Atom]