Graylog: различия между версиями
Материал из noname.com.ua
Перейти к навигацииПерейти к поискуSirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
Строка 102: | Строка 102: | ||
/etc/init.d/elasticsearch start |
/etc/init.d/elasticsearch start |
||
chkconfig elasticsearch on |
chkconfig elasticsearch on |
||
+ | </PRE> |
||
+ | |||
+ | |||
+ | ==Graylog2.rpm== |
||
+ | Сборка как обычно, спек конфиг и инит ниже: |
||
+ | <PRE> |
||
+ | %define real_name graylog2-server |
||
+ | %define version 0.9.6 |
||
+ | %define vers 096 |
||
+ | %define prefix /opt/%{real_name}/%{version} |
||
+ | |||
+ | |||
+ | Name: %{real_name}-%{vers} |
||
+ | Summary: Graylog2 is an log management solution that stores your logs in ElasticSearch. |
||
+ | Version: %{version} |
||
+ | Release: 1 |
||
+ | AutoReqProv: on |
||
+ | License: BSD |
||
+ | Group: Applications/Searchengines |
||
+ | URL: http://www.graylog2.org |
||
+ | #Source: https://github.com/downloads/Graylog2/graylog2-server/%{real_name}-%{version}.tar.gz |
||
+ | Source: %{real_name}-%{version}.tar.gz |
||
+ | Source1: graylogd2 |
||
+ | Source2: graylog2.conf |
||
+ | Buildarch: noarch |
||
+ | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
||
+ | |||
+ | %if 0%{?suse_version} >= 1100 |
||
+ | BuildRequires: -post-build-checks |
||
+ | %endif |
||
+ | |||
+ | |||
+ | %description |
||
+ | Graylog2 is an open source log management solution that stores your logs in ElasticSearch. It consists of a server written in Java that accepts your syslog messages via TCP, UDP or AMQP and stores it in the database. The second part is a web interface that allows you to manage the log messages from your web browser. |
||
+ | |||
+ | |||
+ | %prep |
||
+ | %setup -q -n %{real_name}-%{version} |
||
+ | |||
+ | |||
+ | %build |
||
+ | |||
+ | |||
+ | %install |
||
+ | %{__mkdir_p} %{buildroot}%{prefix} |
||
+ | %{__mkdir_p} %{buildroot}%{_sysconfdir}/rc.d/init.d |
||
+ | %{__install} -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/graylogd2 |
||
+ | %{__install} -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/graylog2.conf |
||
+ | |||
+ | %{__cp} -av ./* %{buildroot}%{prefix}/ |
||
+ | |||
+ | %post |
||
+ | cd %{prefix}/.. |
||
+ | %{__ln_s} -f %{version} 0.9.latest |
||
+ | |||
+ | |||
+ | %clean |
||
+ | %{__rm} -rf %{buildroot} |
||
+ | |||
+ | |||
+ | %files |
||
+ | %defattr(-,root,root) |
||
+ | %dir %{prefix} |
||
+ | %{prefix} |
||
+ | %{_sysconfdir}/rc.d/init.d/graylogd2 |
||
+ | |||
+ | %config(noreplace) %{_sysconfdir}/graylog2.conf |
||
+ | |||
+ | %changelog |
||
+ | * Mon Sep 24 2012 Max Mazur <sirmax123@gmail.com> |
||
+ | - Added init script, moved from DBA --> /opt, added config |
||
+ | |||
+ | * Fri May 11 2012 Holger Manthey <holger.manthey@bertelsmann.de> |
||
+ | - inital version |
||
</PRE> |
</PRE> |
Версия 16:23, 28 сентября 2012
Устновка Graylog2 на CentOS 6.3
Добавлю epel репозиторий. У меня он локальный
/etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 6 baseurl=http://172.16.250.1/cobbler/repo_mirror/epel/x86_64 failovermethod=priority enabled=1
или из сети
rpm -i http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
Установить mongodb
yum -y install mongodb.x86_64 mongodb-devel.x86_64 mongodb-server.x86_64
Ява и прочее необходимое барахло
yum -y install lsb gcc make java-1.6.0-openjdk curl-devel zlib-devel openssl-devel
Секрктничать с монго смысла пока не вижу, на всякий случай привожу как это сделать
Устанавливаем mongodb-server # yum -y install mongodb mongodb-server Создаем пользователя: # mongo MongoDB shell version: 1.8.2 connecting to: test > use admin switched to db admin > db.addUser('admin', 'Password') { "user" : "admin", "readOnly" : false, "pwd" : "Password" } > db.auth('admin', 'Password') 1 > use graylog2 switched to db graylog2 > db.addUser('grayloguser', 'Password') { "user" : "grayloguser", "readOnly" : false, "pwd" : "Password" } > db.auth('grayloguser', 'Password') 1 > exit bye Делаем Mongodb более безопастной /etc/mongodb.conf auth = true Перестартуем Mongodb # service mongod restart Добавляем в автозагрузку # chkconfig mongod on # chkconfig --list | grep mongod mongod 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rvm remove 1.9.2 rvm pkg install openssl rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr
Устанавливаем Elasticsearch
Я решил собрать РПМку. на сайте подробная инструкция.https://github.com/tavisto/elasticsearch-rpms У меня (я делал по шагам_ все собралось сразу и без проблем.
rpm -ivh elasticsearch-0.19.0-1.el6.x86_64.rpm /etc/init.d/elasticsearch start chkconfig elasticsearch on
Graylog2.rpm
Сборка как обычно, спек конфиг и инит ниже:
%define real_name graylog2-server %define version 0.9.6 %define vers 096 %define prefix /opt/%{real_name}/%{version} Name: %{real_name}-%{vers} Summary: Graylog2 is an log management solution that stores your logs in ElasticSearch. Version: %{version} Release: 1 AutoReqProv: on License: BSD Group: Applications/Searchengines URL: http://www.graylog2.org #Source: https://github.com/downloads/Graylog2/graylog2-server/%{real_name}-%{version}.tar.gz Source: %{real_name}-%{version}.tar.gz Source1: graylogd2 Source2: graylog2.conf Buildarch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} >= 1100 BuildRequires: -post-build-checks %endif %description Graylog2 is an open source log management solution that stores your logs in ElasticSearch. It consists of a server written in Java that accepts your syslog messages via TCP, UDP or AMQP and stores it in the database. The second part is a web interface that allows you to manage the log messages from your web browser. %prep %setup -q -n %{real_name}-%{version} %build %install %{__mkdir_p} %{buildroot}%{prefix} %{__mkdir_p} %{buildroot}%{_sysconfdir}/rc.d/init.d %{__install} -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/graylogd2 %{__install} -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/graylog2.conf %{__cp} -av ./* %{buildroot}%{prefix}/ %post cd %{prefix}/.. %{__ln_s} -f %{version} 0.9.latest %clean %{__rm} -rf %{buildroot} %files %defattr(-,root,root) %dir %{prefix} %{prefix} %{_sysconfdir}/rc.d/init.d/graylogd2 %config(noreplace) %{_sysconfdir}/graylog2.conf %changelog * Mon Sep 24 2012 Max Mazur <sirmax123@gmail.com> - Added init script, moved from DBA --> /opt, added config * Fri May 11 2012 Holger Manthey <holger.manthey@bertelsmann.de> - inital version