This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
giganet:sflow [2021/08/02 13:35] rb |
giganet:sflow [2021/08/03 13:28] (current) rb |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Схема мониторинга sflow статистики ====== | ||
- | |||
- | ===== Задействованные сервера ===== | ||
- | |||
- | * **goflow **- сервер на котором крутится kafka и goflow2 приложение по сбору статистики | ||
- | * **clickhouse **- сервер с базой данных clickhouse, хранение и обработка статистики | ||
- | ===== Задействованные приложения ===== | ||
- | |||
- | * **goflow2** | ||
- | * **kafka** | ||
- | * **clickhouse** | ||
===== Общая схема мониторинга ===== | ===== Общая схема мониторинга ===== | ||
Line 28: | Line 17: | ||
примеры конфигов для свитчей | примеры конфигов для свитчей | ||
+ | |||
+ | < | ||
+ | sampling.1G = 8192 | ||
+ | sampling.10G = 8192 | ||
+ | sampling.40G = 16384 | ||
+ | sampling.100G = 32768 | ||
+ | |||
+ | </ | ||
==== goflow2 ==== | ==== goflow2 ==== | ||
Line 39: | Line 36: | ||
==== kafka ==== | ==== kafka ==== | ||
+ | |||
+ | == Установка == | ||
+ | |||
+ | < | ||
+ | useradd kafka -m | ||
+ | passwd kafka | ||
+ | su -l kafka | ||
+ | cd | ||
+ | curl https:// | ||
+ | tar -xvzf kafka_2.13-2.8.0.tgz | ||
+ | ln -s / | ||
+ | |||
+ | </ | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | delete.topic.enable=true | ||
+ | |||
+ | </ | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | [Unit] | ||
+ | Requires=network.target remote-fs.target | ||
+ | After=network.target remote-fs.target | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | User=kafka | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | Restart=on-abnormal | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | </ | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | [Unit] | ||
+ | Requires=zookeeper.service | ||
+ | After=zookeeper.service | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | User=kafka | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | Restart=on-abnormal | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | </ | ||
+ | |||
+ | Запускаем сервисы | ||
+ | |||
+ | < | ||
+ | systemctl daemon-reload | ||
+ | systemctl start kafka | ||
+ | systemctl enable kafka | ||
+ | |||
+ | </ | ||
+ | |||
+ | Работаем с kafka | ||
< | < | ||
Line 54: | Line 120: | ||
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
- | https:// | + | [[https:// |
- | https:// | + | [[https:// |
=== таблица kafka === | === таблица kafka === | ||
Line 221: | Line 287: | ||
PARTITION BY toYYYYMMDD(Date) | PARTITION BY toYYYYMMDD(Date) | ||
ORDER BY Datetime | ORDER BY Datetime | ||
- | TTL Date + toIntervalDay(7) | + | TTL Date |
SETTINGS index_granularity = 8192 | SETTINGS index_granularity = 8192 | ||