Azure Cloudera linux vm metrics logging with fluentd to azure storage
Перейти к файлу
Andy Luong b01eac0dc0 Add some details on running the scripts (#5)
* add some details on running the scripts

* add details on using the Clouder plugin
2018-03-08 14:23:38 -05:00
FluentD Start and instance of the fluentd agent 2018-03-08 13:40:02 -05:00
ansible Package and run td-agent config for metrics 2018-03-08 01:47:09 -05:00
scripts Add some details on running the scripts (#5) 2018-03-08 14:23:38 -05:00
.gitignore Package and run td-agent config for metrics 2018-03-08 01:47:09 -05:00
LICENSE Initial commit 2018-03-01 14:05:17 -08:00
README.md Add some details on running the scripts (#5) 2018-03-08 14:23:38 -05:00

README.md

Running and Install the Clouder and VM metrics fluentd agent

  1. Update the fluentd configurations under the FluentD folder
  2. Download the in_clouderametrics.rb from https://github.com/wesyao/fluent-plugin-clouderametrics.
  3. Run the packaging script to have a simple tar.gz file of all of the configuration files. Note: scripts/td-agent-config is a temporary folder
./package-tar-file.sh
  1. Upload these files to the VMs that need to be configured
  2. There is a README inside the tar file with some example steps on how to execute one of the two options to install the configuration on the VM.

Installing TD-Agent on CentOS RHEL 7.4

  1. Install the TD Fluentd agent
curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh
  1. Install plugins
td-agent-gem install fluent-plugin-azurestorage
  1. (Optional) Install Ruby for native plugins
sudo yum install ruby
sudo yum install gcc-c++
sudo td-agent-gem install fluent-plugin-clouderametrics
sudo td-agent-gem install fluent-plugin-azurestorage
  1. Basic commands
/etc/init.d/td-agent start
/etc/init.d/td-agent restart
/etc/init.d/td-agent stop
  1. Test
curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test
  1. View Logs
tail -f /var/log/td-agent/td-agent.log
  1. Edit Config
vi /etc/td-agent/td-agent.conf

Run Ansible playbook to configure td-agent

  1. Install Ansible (MacOS X)
pip install ansible
  1. Ping test
ansible all -m ping -u <username> -i hosts --ask-pass
  1. Run Ansible playbook
ansible-playbook playbook.setup.yml -i ansible_inventory --ask-pass --ask-pass --ask-become-pass

Splunk

  1. Install Splunk
  2. Setup Splunk paths and config
export SPLUNK_HOME=/Applications/Splunk
export PATH=$SPLUNK_HOME/bin:$PATH
  1. Run the Splunk Little Helper application to start Splunk. You will need to update /Applications/Splunk/etc/splunk-launch.conf on MacOS X.
OPTIMISTIC_ABOUT_FILE_LOCKING = 1

Splunk Commands

  1. Remove all of the data
splunk clean eventdata