1 回答
- 最新
- 投票最多
- 评论最多
0
It turns out that even though the Elastic Beanstalk web console is showing my setup as having an nginx proxy, for multicontainer docker + docker compose, it doesn’t use an Elastic Beanstalk proxy, so I needed to have my own nginx container report this information.
There is helpful info in these:
- How to generally have container logs mounted properly: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.container.console.html#docker-env-cfg.healthd-logging
- How to set up your own nginx to log in the right format: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-serverlogs.html#health-enhanced-serverlogs.configure
After all that I had my own nginx logging healthd info to NGINXDIR="/var/log/eb-docker/containers/nginx/healthd"
and an empty directory HEALTHDDIR="/var/log/nginx/healthd"
, so I created an .ebextensions script that:
- Does
mkdir -p "$NGINXDIR" && chmod 777 "$NGINXDIR"
(would love to hear advice on a tighter perms and/or user/group owners for that directory) - Sets up a symlinks in the HEALTHDDIR pointing to my NGINXDIR:
if [ -L "$HEALTHDDIR" ]; then
echo "is symlink: $HEALTHDDIR"
else
mv "$HEALTHDDIR" "$BACKUPDIR"
echo "moved $HEALTHDDIR to $BACKUPDIR"
ln -s "$NGINXDIR" "$HEALTHDDIR"
echo "linked $NGINXDIR to $HEALTHDDIR"
fi
Seems to be working now and I’m now seeing data in the “Nxx Responses” and “PNN Latency” columns, which are reading from the last 10 seconds and updating regularly.
已回答 3 年前
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前