Skip to content

Instantly share code, notes, and snippets.

@sysulq
Last active August 29, 2015 14:04
Show Gist options
  • Save sysulq/98e3e3dcfbc9fe6a8d68 to your computer and use it in GitHub Desktop.
Save sysulq/98e3e3dcfbc9fe6a8d68 to your computer and use it in GitHub Desktop.
fluentd_agent
#!/bin/bash
if [ -f /etc/profile.d/rvm.sh ]; then
echo "rvm.sh exists"
source /etc/profile.d/rvm.sh
fi
if [ `which fluentd` ]; then
echo "fluentd already exists."
exit 0
fi
curl -sSL https://get.rvm.io | sudo bash -s stable
source /etc/profile.d/rvm.sh
apt-get install libssl-dev libyaml-dev -y
rvm autolibs disable
rvm install 1.9.3-p125
rvm use 1.9.3-p125
gem install fluentd --no-ri --no-rdoc
gem install fluent-plugin-mongo --no-ri --no-rdoc
gem install bson_ext --no-ri --no-rdoc
## 步骤一: 登陆root帐号 : sudo -s
## 步骤二: 将下面的命令贴到终端 #############################
cat > setup.sh << END2
#!/bin/bash
cat > install_flentd.sh << END
#!/bin/bash
apt-get install zlib1g zlib1g-dev curl
curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
export PATH=$PATH:/usr/local/rvm/bin/
rvm install 1.9.3
rvm use 1.9.3
gem source --remove "http://rubygems.org/"
gem source -a "http://ruby.taobao.org/"
gem install fluentd --no-ri --no-rdoc
END
chmod a+x install_flentd.sh
source install_flentd.sh
rm install_flentd.sh
END2
## run setup.sh
source setup.sh
## >> 将上面的命令贴到终端 #############################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment