notebook

都内でWEB系エンジニアやってます。

rundeck のログをS3へ

古いメモが出てきたのでとりあえず上げておきます

rundeckの実行ログをS3へ送るように設定します

特に難しいことも無いのですが一応メモ

jarファイルの取得

$RUNDECK_BASE/libext以下にjarファイルを置きます

curl -L https://github.com/rundeck-plugins/rundeck-s3-log-plugin/releases/download/v1.0.0/rundeck-s3-log-plugin-1.0.0.jar -o /var/lib/rundeck/libext/rundeck-s3-log-plugin-1.0.0.jar

設定の変更

最終的に下記変更で動作確認までできました

  • /etc/rundeck/rundeck-config.properties
rundeck.execution.logs.fileStoragePlugin=org.rundeck.amazon-s3
  • /etc/rundeck/framework.properties
framework.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.AWSCredentialsFile=/etc/rundeck/awscredentials.properties
framework.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.bucket=app-rundeck-test
framework.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.path=logs/${job.project}/${job.execid}.log
framework.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.region=ap-southeast-1
framework.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.endpoint=s3-ap-southeast-1.amazonaws.com
  • /etc/rundeck/awscredentials.properties
accessKey=***
secretKey=***

エラー

SEVERE: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
AmazonS3Exception: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: 47C15BD86B87ACEA, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified
 endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: ZuS5rxqT4d/EMw2MAYq/pIh2erBy4kSeAIcjqfc/1lPTEifjA/OQM1UwL4ZXJdLCYAAACzxW1J8=

これはendpointを指定しなかった事によるもの、regionだけでなくendpointも指定してあげる必要があります