AWS 雑多なメモ

提供:雑多なメモ Wiki版

移動: 案内, 検索

Q: さくらのVPSで「Ubuntu」を利用していますが、回線速度が遅くアクセスに時間がかかります。

ec2 でも何かあるのかは調査中。いまのところはメモのみ

sudo aptitude install ethtool
sudo ethtool -k eth0
sudo ethtool -K eth0 tso off


/etc/network/interfaces に追加

post-up /usr/sbin/ethtool -K eth0 tso off

AWS Management Console で block device mapping が pop-up させるようになったんだが、どうも delete on termination の表示が違う気がするので確認してみた。

ec2-describe-instance-attribute i-XXXXXXXX -b -v
これ出力されるレスポンスの中で、<blockDeviceMapping> の配下の <deleteOnTermination> で確認
EBS Backed instance で
stop
boot volume detach
other bootable volume attach
start
EBS Backed instance で
create AMI
AMIが保持する snapshot から EBS volume 作成
volume attach
rsync
detach
snapshot

/etc/munin/munin-node に追加

[iostat]
env.SHOW_NUMBERED 1

iostat_ios を変更

#return 0 if ($tmpnam =~ /^\s*(?:sd|hd)[a-z]\d+\s*$/);

Ubuntu 10.04 LTS (Lucid Lynx) AMI

dpkg-reconfigure tzdata
aptitude update
aptitude safe-upgrade -y

apt-get install mysql-server
apt-get install wordpress-l10n

apt-get install emacs22-nox
apt-get install sysstat
apt-get install mysqltuner
/etc/sysctl.d/60-my-tunings.conf
vm.swappiness=0
net.ipv4.tcp_fin_timeout=3
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_synack_retries=2
net.ipv4.tcp_syn_retries=2
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
http://dtach.sourceforge.net/
いいかも
Amazonからメール送信制限に関するEC2 Account Notificationが来た | Shin x blog
ヘー メールの outbound もしっかり監視してるんだ...
kernel が OK なら、initrd 不要
Use ELB to Serve Multiple SSL Domains on One EC2 Instance
Using ELB to Serve Multiple Domains Over SSL on EC2 for Giggles and Unicorns « elwoodicious
How to use instance store on EBS-backed m1.small?
-b /dev/sdc=emphemeral0
EBS root の場合、instance を stop して、ec2-modify-instance-attribute で instance type を変更して、再度、start させるとよい。
Move a Running EBS Boot Instance to New Hardware on Amazon EC2 - Alestic.com
This above process can also be used when your instance is running fine, but you want to move to
a different instance type (size) of the same architecture. For example, you could move from
m1.small up to c1.medium, or from m2.4xlarge down to c1.xlarge. Update: I wasn’t thinking
clearly when I wrote that last sentence. It is possible to change the instance type much more
easily: Simply stop the instance, use ec2-modify-instance-attributes, and start it up again.
どうも、新しく Instance を起動する場合、Network が生きるのが遅いような気がする。
一度起動して、reboot する場合は、問題無し。
要調査
TCPKeepAlive
ServerAliveInterval 15
ServerAliveCountMax 3
man ssh_config
NAT環境で放置したSSH接続が切れる問題への対処
EC2はリモートにあるので、アクセス回線断に困らないように screen を使う癖をつける事 > 自分
.screenrc
defutf8 on
defkanji utf-8
encoding utf-8 utf-8
defencoding utf-8
#
vbell off
autodetach on
startup_message off
altscreen on
# for Emacsian
escape  ^Tt
#
defhstatus "^En:^Et"
hardstatus on
hardstatus alwayslastline "screen |%c %m/%d | %w"
# for Macintosh delete key
bindkey -k kD stuff \177
# for MacOSX Terminal.app enable scroll
termcapinfo xterm* ti@:te@
# avoid dangerous key bind
bind x
bind ^x
bind k
bind ^k
bind .
bind ^\
bind \\
bind ^h
bind h
.bash_login
if [ $TERM != "screen"  ]; then
    exec screen -xRR
fi
exit ではなく detach する事 > 自分
Amazon Web Services Developer Community : local instance storage on ebs booted ...
メモメモ
Amazon EC2のイメージ(AMI)をus-eastからus-westにコピーする方法 : Media Technology Labs (MTL) : メディアテクノロジーラボ ブログ
AMIこれで行くのね。EBSはどうしたら効率的に移動できるのかなぁ...(データ転送利用料をミニマムで)
Create EBS Boot AMI
2 scripts that can be used to create an bootable EBS from a running instance. ami-4205e72b created with this process
ec2-register --snapshot snap-xxxxxxxx --kernel aki-xxxxxxxx --ramdisk ari-xxxxxxxx --description="EBS Ubuntu Hardy" --name="ebs-ubuntu-hardy-8.04-i386-server-20109999" --architecture i386 --root-device-name /dev/sda1
ほう Root Device Type ebs では Instance Lifecycle に stop と start が追加されてるのね。
              - '<delete-on-termination>': indicates whether the Amazon EBS
               volume should be deleted on instance termination. If not
               specified, this will default to 'true' and the volume will be
               deleted.
それで、default が true なのか...
ebs volume ごと消したければ、明示的に Terminate しろということか
shutdown -h now だけでは、stop になるだけ。
Ubuntu 用の ec2-api, ec2-ami tools の最新版リポジトリ
deb http://ppa.launchpad.net/ubuntu-on-ec2/ec2-tools/ubuntu hardy main
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9EE6D873
Amazon Web Services Developer Community : Amazon S3 support for Versioning ...
うまい戦略ですね...
Ubuntu One : Home
って S3 つかってるんですね。
Amazon Relational Database Service (Amazon RDS)
あらら "What Amazon is introducing today is slightly different than what most people might have expected, it’s really MySQL5.1 as a service." (RightScale blog より)
フルマネージド MySQL という立て付けなのね...
Announcing Lower Amazon EC2 Instance Pricing
うれしい☆
Announcing Amazon EC2 High-Memory Instances
Amazon Web Services Developer Community : Auto Scaling groups can now span multiple availability zones
すばらしい。
Amazon Web Services Developer Community : EC2 Instance IP Black Listed at ...
"Reputation Fate Sharing" 問題ですな。
とはいえ、まだ RBL つかってるんですか????
Introducing Amazon EBS Shared Snapshots
shared AMI + shared EBS でうれしさ倍増
Solution Providers Program
RackSpace Cloud Tools の地味なヤツ (この地味さがAWSの良さかもしれず)
Amazon Web Services Blog: AWS Access Credential Rotation
Access Key の 差し替えを簡単に。
管理者がヤンゴトナキ事情で交代する場合に便利 ;)
hail cloud computing project - hail is a cloud computing umbrella project for several inter-related projects
RedHat 肝いりのプロジェクトです
ヲチしましょう。
Amazon CloudFront > Information in Japanese
へぇ CloudFront には日本語のページがあるのね
Multi-Factor Authentication
AWS Management Console - Now with Amazon CloudWatch Support
あそんでみるか
Introducing Amazon Virtual Private Cloud (VPC)
うーむ うーむ うーむ
Announcing Amazon EC2 Reserved Instances
うーむ もう一声ほしいなぁ (おとーさんの小遣いからの出費[一時出費ではあるが]ではつらい)
(もちろんランニングコストは1/3になるんだが...)
Ten observations about cloud computing | The Pervasive Datacenter - CNET News
Ten things I learned while writing Cloud Computing for Dummies « Judith Hurwitz’s Weblog
Pig Latin - High Level Data Processing with Elastic MapReduce
Adding the Export to AWS Import/Export
すご...
libcloud python library - a unified interface cloud server providers
統一 API ごにょごにょやるよりも実践!
Rackspace goes Open Source with API's
カンブリア爆発的な時期ですなぁ
Recover data from "Degraded Amazon EC2 Instance"?
へー こんなメールがくるんだ ;)
http://www.appleiphoneschool.com/2009/07/22/rackspace-cloud-10-for-iphone/
あはは、早いなぁ
Cloud Computing Part 1 – Amazon EC2 Zone Reaches Capacity | Wire Turf
無限という事は無いわけで...
Cloudkick now supports Rackspace Cloud Servers
RightScaleも対応してるし、RESTful な API も公開したし
YouTube - Cloud Wars
おいしいキーワード満載:)
(追記)
BEZOS : Jeff bezos - Amazon CEO
LORD WERNER : Werner Vogels [@werner] Amazon CTO http://www.allthingsdistributed.com/
Thorsten SKYWALKER : Thorsten Eicken, RightScale CTO 
RUV : Reuven Cohen [@ruv] Enomaly CTO http://www.elasticvapor.com/
the Red Monk, COTE : Michael Coté [@cote] RedMonk http://www.redmonk.com/cote/ http://www.redmonk.com/cote/it-management-podcast/
BOTCHAGALUPE : John Willis [@botchagalupe] http://www.johnmwillis.com/ http://www.johnmwillis.com/best-of/
URQUHART : James Urquhart [@jamesurquhart] http://blog.jamesurquhart.com/
PERRY : Geva Perry [@gevaperry] http://gevaperry.typepad.com/ http://overcast.typepad.com/overcast/
the GREAT LINTHICUM : David S. Linthicum [@davidlinthicum] http://davelinthicum.blogspot.com/ http://feeds.feedburner.com/CloudComputingPodcast


From Mosso To The Rackspace Cloud
Cloud Computing, Cloud Hosting & Online Storage by Rackspace Hosting. Mosso is now the Rackspace Cloud.
Cloud servers for your Perl app - Amazon's EC2 vs Mosso - Catalyzed.org: A Catalyst and Perl Blog
バランス・バランス :)
(追記)
mon petit blogue sans importance... - A look at rackspacecloud.com vs AWS (updated)
Cloud Developer Tips: EC2 Reserved Instance Billing Gotcha
次の月次請求タイミングかららしい
Data center update as of 8:58 pm CST
Mossoにも影響があったようだ
Cloud Sites | DFW | Online
ふぅぅぅぅぅ
ひと月の間に3回もっていってるユーザがいるな。IDCの電源周りの不備なんだろうなぁ。すぐには替えられないような...
(追記)
Dallas data center update as of 11:26 pm CST(link消滅)
電源設備の容量不足???
(さらに追記)
Dallas Data Center Update
INCIDENT REPORT - GRAPEVINE, DFW POWER INTERRUPTION - June, 29 2009
商用電源停止中に発電機が障がいをおこし停止した。
電源周波数の同期回路に問題か。ありがちだなぁ
(しかし、RackSpaceの情報開示のレベルは賞賛に値すると思う。さすが、Fanatical Support® !!!)
(またまた追記)
The Day After: A Brutal Week for Uptime « Data Center Knowledge
厄週間か...
(またまたまた追記)
Someone Needs To Stop Tripping Over The Power Cord At Rackspace
また DFW で電源断...
SUN は SUN であってほしいなぁ
Open Federated Clouds And Sun’s Cloud Announcement | CloudAve
Sun Rethinking Its Cloud Strategy? | CloudAve
ハイブリッド型のクラウドでババン
Rackspace lays out its cloud computing roadmap: Think hybrid
AWSの独占の気配をうけて、最近はみな Mosso を持ち上げてますね。(バランス感覚すごいです)
Lightning Strike Triggers Amazon EC2 Outage
うーむ インフラ屋は大変だなぁ しみじみ...
AWS Security Center
RADLab Above the Clouds の "Data Confidentiality and Auditability" に回答中... AWS気合いはいってるなぁ
The Rackspace Cloud Invites Feedback on Upcoming Cloud Servers API
debian, ubuntu 方面で厳密化している localhost と hostname の扱いを考えると、EC2 の プライベート IP アドレス空間での /etc/hosts は Canonical 版 ubuntu ami の /usr/sbin/ec2-set-hostname で設定しているやりかたが妥当な所かな
127.0.0.1 localhost
127.0.1.1 AMIのlocal-hostname(AMI instance Metadata から取得)

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
また、hostname は hostname --fqdn で取得したホスト名を DNS を引けば、現在の ローカル IP アドレス を引けるものを設定する事。つまり、AMIのlocal-hostname(AMI instance Metadata から取得)を hostname とする。
/opt が消えたし、/tmp の 権限で失敗 (あたりまえか)
mkdir /opt
chmod 1777 /tmp
おもしろい、private IP address が返ってくる。
深い意味があるなぁ
Instance Addressing Concepts
(追記) Elastic IP の AWSから割り当てられる外部DNS名も、EC2内部でひけば、private IP address がかえってくるので、必ず同一の Elastic IP を割り当てるのなら、簡単にインスタンス間でひも付けができる。
Using Elastic IP to Identify Internal Instances on Amazon EC2
RADLab Above the Clouds の "Data transfer bottlenecks" という指摘に素早く対応した。やるなぁ AWS
AWS Import/Export
AWS最強ですな。これで価格がもう少し下がったら、恐ろしいことになるなぁ。(まだチョイと高めな印象ですね)
Amazon CloudWatch Developer Guide
Elastic Load Balancing Developer Guide
Auto Scaling Developer Guide
Amazon EC2 API Tools version 2009-05-15
Amazon CloudWatch API Tools
Elastic Load Balancing API Tools
Auto Scaling API Tools
4月29日に550万ドル調達して事業化らしい。
すげ
Ubuntu採用オープンソースクラウド「Eucalyptus」を専門とする企業が発足
Eucalyptus Systems Inc
Eucalyptus Systems raises $5.5M for a hybrid approach to cloud computing » VentureBeat
amiによったら、デフォルトやばいのあるのかしら...
当たり前のことを当たり前にやっておく事だねぃ
Tips for Securing Your EC2 Instance
ec2-authorize
得難いレポート:)
非常事態宣言!! Amazon EC2、ホームページが消えました【 横浜のホームページ制作|スタジオFIXの社長ブログ 】
まぁ
PasswordAuthentication no
は、確認しておく事
(追記)

tcpwrapper された sshd なら(たいていそうなっている) /etc/hosts.allow で制限しておく事

sshd : 127.0.0.1 あなたがアクセスするIPアドレス もしくはドメイン名(たとえば .e-mobile.ne.jp) : allow
sshd : ALL : deny

ALL : localhost 127.0.0.1 : allow
ALL : [::1] : allow
Running an X desktop with VNC on Ubuntu on Amazon EC2
のところ、NX がいいぞと
New AMI in development: Ubuntu 7.10 Gutsy desktop AMI with NoMachine NX Free Server
NoMachine NX
EC2 で ubuntu の DeskTop 版を NX で使ってみたけど、反応が重いなりにつかえた。
ec2-run-instances
Instance Metadata
# tuning for Amazon EC2 m1.small instance
#
# uncomment, if you want.
#vm.swappiness=0
#
#kernel.random.poolsize = 2048
kernel.sem = 250 32000 128 1024
kernel.msgmni = 256
#kernel.shmmax=268435456
#kernel.shmmax=2147483648
#
net.ipv4.tcp_rmem = 4096 4194304 4194304
net.ipv4.tcp_wmem = 98304 4194304 4194304
net.ipv4.tcp_mem = 162624 4194304 4194304
net.core.rmem_default = 262144 
net.core.wmem_default = 262144 
net.core.rmem_max = 4194304 
net.core.wmem_max = 4194304 
#
net.ipv4.tcp_max_syn_backlog = 2500
net.core.somaxconn = 4096
#net.ipv4.tcp_max_orphans = 32768
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 5
インスタンスを立ち上げて、まもなく勝手にリブートする場合があるなぁ...
Elastic IP 割り当ててしばらくしてからかなぁ...
まったくこういった事象に遭遇しないインスタンスもあるなぁ...
ヲチしよう...
dpkg-reconfigure tzdata
apt-get update
apt-get upgrade
apt-get autoremove
apt-get install rcconf
apt-get install sysv-rc-conf
#apt-get install acct
apt-get install screen
apt-get install traceroute
apt-get install unzip
apt-get install emacs22-nox
apt-get install ddskk
apt-get install skkdic
apt-get install nkf
apt-get install python-boto
/etc/bashrc
/etc/sysctl.conf
/etc/rc.local
/etc/ssh/sshd_config
UseDNS no
/etc/hosts.allow
個人用ツール
名前空間
変種
操作
案内