Last active
December 27, 2016 05:14
-
-
Save momota10/b45da37c59aa536120d67f85a9a8932c to your computer and use it in GitHub Desktop.
Redshiftのクラスタを再構築せざるを得なかった話 ref: http://qiita.com/momotasasaki/items/6a5e23b1ccdae79c2ead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dear Customer, | |
Our systems have identified a potential hardware issue that may affect your | |
Amazon Redshift cluster {your_cluster_name} the {your_region_name} AWS region. | |
As a precaution, we recommend that you restore a new cluster from a snapshot | |
within the next 2-3 days and delete your existing cluster. | |
This will automatically provision you on healthy hardware and help you | |
avoid an unplanned outage. Please confirm receipt of this message. | |
We apologize for the inconvenience, please let us know if you have any questions or concerns. | |
Regards, | |
Redshift Service Team |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
潜在的なハードウェアの問題を特定したので2~3日以内に新しいクラスタをスナップショットから復元して既存のクラスタを削除してね |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CNAMEの確認 | |
$ dig redshift.production | |
# td-agent.confの変更 | |
$ vim /etc/td-agent/td-agent.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# td-agent再起動 | |
$ sudo service td-agent restart | |
# ログの確認 | |
$ sudo tail -f /var/log/td-agent/td-agent.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 新クラスタの対象のテーブルにcount数があることを確認 | |
production=# select count(*) from table_A; | |
count | |
------- | |
289(適当です) | |
(1 row) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UNLOAD ('select * from table_A') | |
TO 's3://{作ったバケット}/table_A/' | |
CREDENTIALS 'aws_access_key_id=hogehoge;aws_secret_access_key=hugahuga'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY action_logFROM 's3://{作ったバケット}/table_A/' | |
CREDENTIALS 'aws_access_key_id=hgoehgoe;aws_secret_access_key=hugahuga'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
truncate table_A; | |
-- 確認用(0だったらok) | |
select count(*) from table_A; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment