joppot

The program absolutely runs in copy paste

Server

Setup of td-agent-ui and operation check

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

Pocket


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

SPONSORED LINK


Launching of td-agent

td-agent-ui is already installed when you install td-agent.
The launch command of td-agent-ui is this.

sudo td-agent-ui start

You may caught some warning, It’ probably no problem.


Set up td-agent-ui

After starting server, let’s access to td-agent-ui.
You access to own IP address + 9292.

For vagrant, the IP address written in Vagrantfile.
For EC2, let’s access the public IP address.

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

After login, the setup page will appear.



Chnage the password

First, You would change the password.
If anybody access to your server from anywhere, default password is dangerous.

Click the “Password” fron the left menu.

Enter “changeme” to the current password and set a new password

Set up td-agent

Back to the top page and set up td-agent.

In the top page, there are “Setup fluentd” and “Setup td-agent”.
Both can use the function of fluentd.
I recommend td-agent.
Click “Setup td-agent”.

The page to create configuration file display.
There are already files exists such as “/etc/td-agent/td-agent.conf” before pressing “Create” button.

Click “create” button.
After that, the following page will be displayed.
If logs are not displayed, let’s restart “td-agent”.

It’s over.

Td-agent log setting

Let’s try to set up to collect the log by the td-agent conf file.
There is the td-agent conf file.

/etc/td-agent/td-agent.conf

Of course, you can edit it in CUI,
Let’s edit it from td-agent-ui.

Choose “Config File” from the left menu.

Click the “Edit” button.

Considering security, it is better to delete the settings that are not used.
Delete all contents of the setting file and write the following.

<source>
 @type forward
</source>

<match debug.**>
  type stdout
</match>

Press “Update & Restart” button.

The above setting meaning is like this.directive is which logs will collecte.
In this case it will receive the log from type forward.

In , it means to display on the td-agent standard output what tagged with “debug.anything-string” received in source type forward.


Debugging with fluent-cat

Let’s try to get the tag of debug.**.

The fluent-cat command send data to fluentd (td-agent) with tcp.
The location of the fluent-cat command is in a place where PATH does not through.

/opt/td-agent/embedded/bin/fluent-cat

The following command, you can send data to fluentd.

echo '{"I say":"hello"}' | /opt/td-agent/embedded/bin/fluent-cat debug.ok

The contents of echo are json. You throw it to td-agent with a tag called debug.ok.

Nothing is displayed on the terminal,
Looking at the log on the browser, it certainly arrived.

It is success.

Conclusion

One last thing, even though td-agent-ui is useful, it is dangerous in security.
You should not launch td-agent as much as possible, even if you activate it, restrict access by IP address.

スポンサードリンク

If you think this article is good, share it please

-Server
-,

執筆者:


comment

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

関連記事

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.

Build up td-agent server on the EC2 of aws

English 日本語 Abstract Hello everyone, It’s candle. In this time we will build up td-agent environment on the ec2. Precondition You have a EC2.

Build up a td-agent server on centos 6.5

English 日本語 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.

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.

How to define environment variables for each virtual host in apache 2.4 and use it in php

English 日本語 Abstract Hello everyone, It’s candle This time I’ll show you how to define environment variables for each virtualhost in apache 2.4 and use it in php For example, when you are developing with wordpress, you don’t want to put password or access key or anything else under the control of git. So, you can define it on apache and require it with getenv for use. Premise apache2.4 anything php project you have already built some kind of virtual host.

Profile


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

twitter

スポンサードリンク

Archives