joppot

The program absolutely runs in copy paste

Server

Build up a td-agent server on centos 6.5

投稿日:2017年3月17日 更新日:

Pocket


Abstract

Hello everyone, It’s candle.
In this time, we build up a td-agent server on the centos 6.5.

Td-agent is service based on fluentd.
It daemonizes fluentd and creates a GUI.


Premise

You have Centos 6.5 server.
I use Centos 6.5 on the vagrant for explanation.

SPONSORED LINK


Install basic libraries

You install libraries for td-agent server.

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

This is the minimum required library.

Install rbenv

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

Bring the rbenv from the repository with the following command.

sudo git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv

Change the permissions of rbenv to vagrant user.

sudo chown -R vagrant /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://github.com/sstephenson/ruby-build.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 centos as a whole, and refresh.

rbenv global 2.3.3
rbenv rehash

OK, it finish.


Install td-agent

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

curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | 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.

If you are using Centos 6.5 on the vagrant, open port 9292 in the vagrant setting.
Exit from the server and stop the vagrant.

vagrant halt

Open the Vagrantfile and write this to open the port.
Also allocate the IP address.

  config.vm.network :forwarded_port, guest: 9292, host: 9292
  config.vm.network "private_network", ip: "192.168.33.10"

Save the file, and launch the vagrant.

vagrant up

Launching of 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.

Access to http://192.168.33.10:9292 with Mac browser.

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.

Conclusion

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

スポンサードリンク

If you think this article is good, share it please

-Server
-, ,

執筆者:


comment

Your email address will not be published. Required fields are marked *

関連記事

Setup of td-agent-ui and operation check

English 日本語 Abstract Hello everyone, It’s candle. In this time, I will show you how to set up td-agent-ui and operation check. Td-agent is easier than fluentd to operate on the server. Precondition Td-agent is installed Please refer to the following article when building td-agent to Centos 6.5. Build up a td-agent server on centos 6.5 For EC2, here Build up td-agent server on the EC2 of aws

Install only mysql command for RDS in EC2

Abstract Hello everyone it’s me candle. This topic is a little thing but I note to self. If we use RDS, we don’t need Mysql server in the EC2. You may want to install only the mysql command. I will explain it. Precondition You use EC2 and RDS

Collect the Rails 4 production.log with td-agent

English 日本語 Abstract Hello everybody, It’s me candle. In this time, let’s get the rails 4 production.log by td-agent. I have been written same article, but there was lack of explanation and etc, I will rewrite it again. Also, I will show you how to get Rails 5 production.log at a later date. Precondition You must be able to execute ruby on rails in production mode. It is ok in any environment as long as it has executable. Such as webrick, nginx, puma and apache. td-agent or fluentd is instlled. It is assumed that td-agent or fluentd is installed.

Collect Rails 5 production.log with td-agent

English 日本語 Abstract Hello everybody It’s me candle. In this article I will show you how to collect rails 5 production.log with td-agent. Rails 5 was changed log format and it cause some problem. I will solve it and explain. relational article If you are using rails 4 please refer to the following article. td-agentでRails 4のproduction.logを取得する Precondition You can work ruby on rails in production mode Before read this article you setup the rails production environment such as webrick, apache, puma and nginx. You already installed td-agent or fluentd. You need td-agent or fluentd. It is installed on the ruby …

How to get nginx error.log and access.log with td-agent

English 日本語 Abstract Hello everyone, It’s candle. In this time, we collect nginx log with td-agent. I explain with td-agent, but basic configuration is similer with fluentd. Precondition Td-agent or fluentd is installed You have a nginx server.

Profile


I work in the venture company as a CTO. I start to write program in University, first I learned java, C++ and PHP. In the company, I'm developing web services by Rails. I do like to automation.

スポンサードリンク

Archives