1.1.6.1. AWS CLIのインストール¶
注釈
- インターネット接続可能な環境で実行してください。
- 以下のコマンドを実行し、unzipをインストールします。
# yum install unzip
- 以下のコマンドを実行し、「awsxliv.zip」をダウンロードします。
# curl “https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip” -o “awsxliv2.zip”
- 以下のコマンドを実行し、「awsxliv.zip」を解凍します。
# unzip awsxliv2.zip
- 以下のコマンドを実行し、AWS CLIをインストールします。
# ./aws/install
- 以下のコマンドを実行し、バージョンが表示されることを確認します。
# /usr/local/bin/aws --version
1.1.6.2. AWS CLIの環境設定¶
注釈
- WasabiでAWS CLIを利用する際の情報につきましては、Wasabiの KnowledgeBase をご確認ください。
- 「アクセスキー」および「シークレットキー」、「リージョン名」は、ご利用の環境にあわせて設定してください。
以下のコマンドを実行し、アクセスキーおよびシークレットキーを設定します。
# aws configure AWS Access Key ID [None]: Wasabiユーザーのアクセスキー AWS Secret Access Key [None]: Wasabiユーザーのシークレットキー Default region name [None]: ap-northeast-1 Default output format [None]:
1.1.6.3. シェルスクリプトの作成¶
ログ収集サーバーに保存されているログファイルをWasabiに保存するためのシェルスクリプトを作成します。
/usr/local/sbin/local-to-wasabi.shの作成¶
以下のコマンドを実行し、シェルスクリプトを作成します。
# cd /usr/local/sbin # touch local-to-wasabi.sh # chmod 700 local-to-wasabi.sh # vi local-to-wasabi.sh #!/bin/bash /usr/local/bin/aws s3 sync /var/log/tmp/sdpf/ s3://sdpftestbed-log-backup/sdpf/ --exclude “sdpflog*” --incude “sdpflog*_*.log” --endpoint-url=https://s3.ap-northeast-1-ntt.wasabisys.com