2013年5月2日木曜日

Python版AWSコマンドラインツールでRDSのログをダウンロード

スズキです。

ちょっと古い情報ですが、以前RDSのログファイルがコンソールで閲覧できたり、
ダウンロードできるようになったりしました。
Amazon RDS - より簡単にログファイルにアクセス可能に
この辺りは下記に詳しく記載されています。
Working with Database Log Files

実際にコンソールを確認してみると下記のようにログを確認することができます。


実際のログは次の通りです。


そして、このログをPython版AWSコマンドラインツールでダウンロードもしてみました。

実際のコマンドと結果は次の通りです。
# aws rds download-db-log-file-portion \
> --db-instance-identifier master \
> --log-file-name error/mysql-error-running.log.7 \
> | jq '.LogFileData' \
> | sed 's/^"//' \
> | sed 's/"$//' \
> | sed 's/\\n/\n/g'
130501  6:50:41 [Note] Plugin 'FEDERATED' is disabled.
130501  6:50:41 InnoDB: The InnoDB memory heap is disabled
130501  6:50:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130501  6:50:41 InnoDB: Compressed tables use zlib 1.2.3
130501  6:50:41 InnoDB: Using Linux native AIO
130501  6:50:41 InnoDB: Initializing buffer pool, size = 311.0M
130501  6:50:41 InnoDB: Completed initialization of buffer pool
130501  6:50:41  InnoDB: Log file /rdsdbdata/log/innodb/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /rdsdbdata/log/innodb/ib_logfile0 size to 128 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
130501  6:50:46  InnoDB: Log file /rdsdbdata/log/innodb/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /rdsdbdata/log/innodb/ib_logfile1 size to 128 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
130501  6:50:52 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130501  6:50:52  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130501  6:50:52  InnoDB: Waiting for the background threads to start
130501  6:50:53 InnoDB: 1.1.8 started; log sequence number 1606156
130501  6:50:53 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130501  6:50:53 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130501  6:50:53 [Note] Server socket created on IP: '0.0.0.0'.
130501  6:50:53 [Note] Event Scheduler: Loaded 0 events
130501  6:50:53 [Note] /rdsdbbin/mysql/bin/mysqld: ready for connections.
Version: '5.5.27-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

"jq"が、かなり得意になってしまった...
--------
http://www.suz-lab.com

2 コメント:

匿名 さんのコメント...

This might look like a silly factor, yet you are dealing with a total ignoramous
(me!) in these concerns. Do I comprehend properly that a printer drum is an alternative
to a toner cartridge but with a lot higher yield? This
does not seem to be explicit in your guide if it is the case.
Please clarify.
Kind regardsJim. Paper Jams Paper jams is just one of a lot of common trouble which encounters.

A paper jam could happen due to wide array of explanations.


Check out my blog post :: xerox phaser 8560 manual

匿名 さんのコメント...

Sir, pls send out that video to my email I.D. It will be support ful 2 make
pcb easy. Thankyou.

my site: xerox phaser 8560 driver