The program absolutely runs in copy paste

Build up td-agent server on the EC2 of aws




Hello everyone, It’s candle.
In this time we will build up td-agent environment on the ec2.


You have a EC2.


Install basic libraries

You install libraries for td-agent server.

sudo yum install -y git openssl openssl-devel readline readline-devel gcc

This is the minimum required library.

About ruby

Td-agent runs with ruby. So, we have to choose what kind of ruby version to use.

EC2 is installed ruby from the beginning.
If you want to use td-agent as easily, you use that ruby.

I recommend that you install ruby from rbenv, because you can change the version of ruby against various situations such as changing version of fluentd and other ruby applications.

Install rbenv

Bring the rbenv from the repository with the following command

sudo git clone git:// /usr/local/rbenv

Change the permissions of rbenv to ec2-user.

sudo chown -R ec2-user /usr/local/rbenv

“/usr/local/rbenv” is not set to the directory of the executable file like /bin or /usr/bin.

If you do not set the path, you can not run rbenv command globally even if rbenv is installed.
Let’s do it.

Open the /etc/profile and write this.

export RBENV_ROOT=/usr/local/rbenv
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"

You can not install ruby with rbenv only.
You need ruby-build plugin for install ruby.
Run this command.

git clone git:// /usr/local/rbenv/plugins/ruby-build

After installation, reload /etc/profile once and rehash rbenv.

source /etc/profile
rbenv rehash

Install ruby

I don’t know about what kind of ruby version is appropriate to td-agent or fluentd, anyway I think that it will work even at the latest.

rbenv install 2.3.3

Declare to use 2.3.3 for the whole of EC2 , and refresh.

rbenv global 2.3.3
rbenv rehash

OK, it finished to install ruby

Install td-agent

Next, let’s install td-agent.
Install it with the following command according to the official site.

curl -L | sh

If you don’t catch any error, it is success.

Launching of td-agent

The command which is launching of td-agent is this.

sudo service td-agent start

We set up the td-agent to launch automaticaly when starting up the server.

sudo chkconfig td-agent on

Set up td-agent-ui

We will use the system which is management to “plugin” and “log” in the web browser called td-agent-ui.
It is easy to launch td-agent-ui.

sudo td-agent-ui start

I caught some warning, but It is probably ok.

Let’s access to IP address which is allocated to EC2 with browser.

Td-agent-ui port is 9292, Before you access to it, you should open the port by security group.
Also you take care of restriction of IP address that can access to 9292.

Go to http: // 9292.

Account name is “admin”, password is “changeme”.

After login, the setup page will appear.
You can choose fluentd or td-agent. Let’s choose td-agent.

Set up is over.


I will write how to use it etc in another article.

 - サーバ , ,