Skip to content

Commit

Permalink
Merge pull request #119 from aws-samples/bsc
Browse files Browse the repository at this point in the history
BSC Moved CloudWatch configuration closer to the end of the user-data…
  • Loading branch information
frbrkoala authored Aug 23, 2024
2 parents f9bb515 + a12ca33 commit 4da5e39
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/bsc/lib/assets/user-data/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ echo "Downloading assets zip file"
aws s3 cp $ASSETS_S3_PATH ./assets.zip --region $AWS_REGION
unzip -q assets.zip

echo 'Configuring CloudWatch Agent'
cp /opt/cw-agent.json /opt/aws/amazon-cloudwatch-agent/etc/custom-amazon-cloudwatch-agent.json

echo "Starting CloudWatch Agent"
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/custom-amazon-cloudwatch-agent.json -m ec2 -s
systemctl status amazon-cloudwatch-agent

aws configure set default.s3.max_concurrent_requests 50
aws configure set default.s3.multipart_chunksize 256MB

Expand Down Expand Up @@ -199,6 +191,14 @@ fi

chown bcuser:bcuser -R /data

echo 'Configuring CloudWatch Agent'
cp /opt/cw-agent.json /opt/aws/amazon-cloudwatch-agent/etc/custom-amazon-cloudwatch-agent.json

echo "Starting CloudWatch Agent"
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/custom-amazon-cloudwatch-agent.json -m ec2 -s
systemctl status amazon-cloudwatch-agent

sudo systemctl daemon-reload
sudo systemctl enable --now bsc

Expand Down

0 comments on commit 4da5e39

Please sign in to comment.