0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

サーバーサイドエンジニアになってわからなかったこと(4週間目)

Posted at

お勉強の経緯

  • 最近転職しました。
  • 転職前はSESでミドルソフトを作ってました。
  • Webに関わる仕事はやったことはない。
  • PHPとPythonとJavaScript、C・C++がチョットワカル。

勉強したこと

  • ログ収集→fluentdなるものでできるらしい
  • データの可視化→ElasticSearch + Kibanaってのでできるらしい

ログ収集

fluentd

ログを集めるツール。
特にサーバ10台とか20台とかのログを集めるのに使う感じです。
特にLBとかで分散処理をした場合は、同じユーザのログが違うサーバに保存されたりするので、それをうまくまとめるえらい子らしいです。

  • APサーバに入れて、ログ集約サーバやAWSのS3に送ったりする
  • ログ集約サーバに入れて複数のログファイルを統合、またほかのサーバやS3におくる

とかで使うらしい。送る方にも送られる方にも入れるものなんですねーー

つまづきぽいんと

Amazon Linux2で環境構築してました。

install_fluentd.sh
# とりあえずyumはupdateしとこう
sudo yum -y update

# fluentd入れたいというお気持ち
sudo yum install fluentd
# ないって言われる

公式のドキュメントをを見ましょう。ちゃんと書いてある。 Amazon Linux2はRedHat系なので

install_fluentd.sh
curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.5.sh | sh

あとPermission関係とかは設定ファイルで実行者をrootにするとうまくいくよ

データの可視化

ElasticSearch

インストールは公式を見ろ(N回目)Java8を忘れちゃだめだぞ!!!

install_ElasticSearch.sh
# とりあえずyumはupdateしとこう
sudo yum -y update

# yumにレポジトリ?を追加するの
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
# 設定に追記?(内容は公式見てね)
sudo vim /etc/zypp/repos.d/elasticsearch.repo
# いんすとーーる
sudo yum install elasticsearch

公式さんをみると大体できる。

あと、稼働状況はちゃんと確認しましょうね

test.sh
systemctl status elasticsearch

あと設定ファイルはちゃんと見ましょうね。ポート開けとか

kibana

公式をみるのだ。。。。
ちゃんとやり方は書いてある・・・

ポートとホストの設定は忘れずに。

ポートが開いてるかは↓で確認するとよさげ??

port_check.sh
netstat -au

最後に

ちょっとずつ追記します。

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?