事前確認事項 †instanceをStopするとPublic DNSが変わります(root deviceに関係なく)。 ハマりどころ †1 instanceには1 IPしか紐づけできない。SSLが2つ以上ある場合は、別のinstanceを作る必要がある 帯域 †250Mb/s max throughput per small instance 設定箇所 †
AMI情報 †Debian/Microinstance/EBS --> ami-0c638165 確認方法 †EBS †
S3 †s3fsの使い方 †
アンマウントする †umount -l /var/www/src 参考URL †AutoScale?する方法 †EC2を使っていればAutoscaleする準備はできている。 s3cmd †S3-phpの使い方 †aptitude install php5-curl /etc/init.d/apache2 restart private AMIの作り方 †
CloudFront?に登録されたObjectを削除する方法 †一番簡単なのは、AWSから出ているSDKを使った簡単アプリを作る事
AMI †エラー時には †The specified bucket is not S3 v2 safe †The specified bucket is not S3 v2 safe (see S3 documentation for details): これはS3の命名規則にそってないから。場所によっては_とか使えるんだけれど、基本は_は使えない [解決済み]error reading certificate: nested asn1 error †ERROR: error reading certificate file ./.ssh/authorized_keys: error reading certificate: nested asn1 error この問題はX509でもう一度鍵ペアを作って使えば解決する [解決済み]Problem: Error: unsupported locale setting †hoge:/home/hogehoge/s3cmd-0.9.9.91# ./s3cmd --configure !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please report the following lines to: s3tools-bugs@lists.sourceforge.net !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Problem: Error: unsupported locale setting S3cmd: 0.9.9.91 Traceback (most recent call last): File "./s3cmd", line 1736, in <module> main() File "./s3cmd", line 1474, in main preferred_encoding = locale.getpreferredencoding() or "UTF-8" File "/usr/lib/python2.5/locale.py", line 514, in getpreferredencoding setlocale(LC_CTYPE, "") File "/usr/lib/python2.5/locale.py", line 478, in setlocale return _setlocale(category, locale) Error: unsupported locale setting !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please report the above lines to: s3tools-bugs@lists.sourceforge.net む、と思って hoge:/home/hogehoge/s3cmd-0.9.9.91# locale で確認 hoge:/home/hogehoge/s3cmd-0.9.9.91# export LANG=C; で解決 [解決済み]make: pkg-config: Command not found †s3fs コンパイルしようと思ったらこんなエラーが。 example:/home/aya/s3fs# make make: pkg-config: Command not found make: pkg-config: Command not found make: xml2-config: Command not found g++ -ggdb -Wall -lcrypto s3fs.cpp -o s3fs s3fs.cpp:23:18: error: fuse.h: No such file or directory s3fs.cpp:34:23: error: curl/curl.h: No such file or directory s3fs.cpp:35:27: error: libxml/parser.h: No such file or directory s3fs.cpp:36:25: error: libxml/tree.h: No such file or directory s3fs.cpp:393:25: error: openssl/bio.h: No such file or directory s3fs.cpp:394:28: error: openssl/buffer.h: No such file or directory s3fs.cpp:395:25: error: openssl/evp.h: No such file or directory s3fs.cpp:396:26: error: openssl/hmac.h: No such file or directory s3fs.cpp:527:25: error: openssl/md5.h: No such file or directory s3fs.cpp:124: error: 'CURL' was not declared in this scope s3fs.cpp:124: error: template argument 1 is invalid s3fs.cpp:124: error: template argument 2 is invalid s3fs.cpp:124: error: invalid type in declaration before ';' token s3fs.cpp:128: error: 'CURL' was not declared in this scope s3fs.cpp:128: error: template argument 1 is invalid s3fs.cpp:128: error: template argument 3 is invalid s3fs.cpp:128: error: template argument 4 is invalid s3fs.cpp:128: error: invalid type in declaration before ';' token s3fs.cpp:129: error: 'CURL' was not declared in this scope s3fs.cpp:129: error: template argument 1 is invalid s3fs.cpp:129: error: template argument 3 is invalid s3fs.cpp:129: error: template argument 4 is invalid s3fs.cpp:129: error: invalid type in declaration before ';' token s3fs.cpp: In function 'int my_curl_progress(void*, double, double, double, double)': s3fs.cpp:134: error: 'CURL' was not declared in this scope s3fs.cpp:134: error: 'curl' was not declared in this scope s3fs.cpp:134: error: expected type-specifier before 'CURL' s3fs.cpp:134: error: expected `>' before 'CURL' s3fs.cpp:134: error: expected `(' before 'CURL' s3fs.cpp:134: error: expected primary-expression before '>' token s3fs.cpp:134: error: expected `)' before ';' token s3fs.cpp:151: error: 'CURLE_ABORTED_BY_CALLBACK' was not declared in this scope s3fs.cpp: At global scope: s3fs.cpp:157: error: expected initializer before '*' token s3fs.cpp:51: warning: 'connect_timeout' defined but not used s3fs.cpp:124: warning: 'curl_handles' defined but not used s3fs.cpp:133: warning: 'int my_curl_progress(void*, double, double, double, double)' defined but not used make: *** [all] Error 1 むむむ、と思って以下のパッケージを入れたらmake出来たよ! aptitude install pkg-config libxml2-dev libfuse-dev libcurl4-openssl-dev [解決済み]warning: Unable to get device geometry for /mnt/image †コマンドラインでAMIを作っている時に出たエラー 〜略〜 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.00974847 s, 108 MB/s mke2fs 1.41.11 (14-Mar-2010) warning: Unable to get device geometry for /mnt/image umount: /mnt/img-mnt: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) ERROR: execution failed: "umount -d /mnt/img-mnt" で、umountしようと思ったら root@xxxx:~# umount -d /mnt/img-mnt/ umount: /mnt/img-mnt: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) アンマウントしたくないんだよっ!!と暴れられたので、 root@xxxx:~# lsof | grep img-mnt rsync 983 root cwd DIR 7,0 4096 2 /mnt/img-mnt rsync 984 root cwd DIR 7,0 4096 2 /mnt/img-mnt rsync 984 root 1u REG 7,0 229376 16804 /mnt/img-mnt/var/cache/apt/archives/.libxml2-dev_2.7.6.dfsg-1ubuntu1.1_i386.deb.tRaQXM ↑お前か!> root 871 0.0 0.1 4704 1892 pts/0 Ss 03:32 0:00 \_ -bash root 946 0.0 0.0 4264 1284 pts/0 T 03:34 0:00 \_ /bin/bash /home/ec2/bin/ec2-bundle-vol -d /mnt --privatekey .pk-hogehoge.pem --c root 947 0.0 0.4 19464 8608 pts/0 T 03:34 0:00 | \_ ruby -I /home/ec2/lib /home/ec2/lib/ec2/amitools/bundlevol.rb -d /mnt --privatekey .pk-hogehoge root 981 0.0 0.0 1852 564 pts/0 T 03:34 0:00 | \_ sh -c rsync -rlpgoD -t -r -S -l --exclude /sys/kernel/debug --exclude /sys/kernel/security --exclude /sys root 982 0.3 1.5 36376 26768 pts/0 T 03:34 0:06 | \_ rsync -rlpgoD -t -r -S -l --exclude /sys/kernel/debug --exclude /sys/kernel/security --exclude /sys - root 983 0.0 0.1 29988 3132 pts/0 T 03:34 0:00 | \_ rsync -rlpgoD -t -r -S -l --exclude /sys/kernel/debug --exclude /sys/kernel/security --exclude /s root 984 0.6 0.2 50400 4244 pts/0 T 03:34 0:10 | \_ rsync -rlpgoD -t -r -S -l --exclude /sys/kernel/debug --exclude /sys/kernel/security --exclud root 1797 0.0 0.0 3948 896 pts/0 R+ 04:02 0:00 \_ ps afux なので、一度プロセスを抜けて、再度ログイン、 root@xxxx:~# umount -d /mnt/img-mnt/ するとすんなりumountしてくれた warning: Unable to get device geometry for /mnt/image は依然出るが、AMIは作れる [解決済み]Client.InvalidManifest?: HTTP 301 (Moved Permanently) response for URL †さてAMIファイルをS3にアップロードしたので登録させようとコマンドを打ったら root@xxxx:~# ec2-register hogehoge/image.manifest.xml -n CloudStockAmi --private-key .pk-hogehoge.pem --cert .cert-hogehoge.pem Client.InvalidManifest: HTTP 301 (Moved Permanently) response for URL http://s3.amazonaws.com:80/hogehoge/image.manifest.xml: check your manifest path is correct and in the correct region. なんだと!?S3の権限設定を見ても問題なさげ。 参考URL † |