Skip to content

Instantly share code, notes, and snippets.

@yashk
Last active June 1, 2018 15:04
Show Gist options
  • Save yashk/84d9bf65d7945e25de2940f903671dcc to your computer and use it in GitHub Desktop.
Save yashk/84d9bf65d7945e25de2940f903671dcc to your computer and use it in GitHub Desktop.
install-redhat-td-agent-bit.sh
echo "=============================="
echo " td-agent Installation Script "
echo "=============================="
echo "This script requires superuser access to install rpm packages."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
# add GPG key
rpm --import https://packages.treasuredata.com/GPG-KEY-td-agent
# add treasure data repository to yum
cat >/etc/yum.repos.d/td-agent-bit.repo <<'EOF';
[td-agent-bit]
name = TD Agent Bit
baseurl = http://packages.fluentbit.io/centos/7
gpgcheck=1
gpgkey=http://packages.fluentbit.io/fluentbit.key
enabled=1
EOF
# update your sources
yum check-update
# install the toolbelt
yes | yum install -y td-agent-bit
SCRIPT
# message
echo ""
echo "Installation completed. Happy Logging!"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment