Sergey Antropoff 7877590440 feat: Initial infrastructure setup for SensusAgent and SensusWorker
- Add Kafka with SSL support and KafkaUI with authentication
- Add PostgreSQL with initialization scripts
- Add ClickHouse cluster with 2 replicas and load balancer
- Add Nginx load balancer for ClickHouse
- Add comprehensive Makefile for infrastructure management
- Add SSL certificate generation for Kafka
- Add complete documentation and quickstart guide
- Add environment configuration with real values

Author: Сергей Антропов
Site: https://devops.org.ru
2025-09-10 11:20:47 +03:00

103 lines
3.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Автор: Сергей Антропов, сайт: https://devops.org.ru -->
<!-- Назначение: Конфигурация кластера ClickHouse для SensusAgent и SensusWorker -->
<!-- Настройка репликации между двумя репликами ClickHouse -->
<yandex>
<!-- Конфигурация кластера для репликации -->
<remote_servers>
<sensus_cluster>
<!-- Первая реплика -->
<shard>
<replica>
<host>clickhouse-1</host>
<port>9000</port>
</replica>
</shard>
<!-- Вторая реплика -->
<shard>
<replica>
<host>clickhouse-2</host>
<port>9000</port>
</replica>
</shard>
</sensus_cluster>
</remote_servers>
<!-- Настройки для реплицируемых таблиц -->
<macros>
<shard>01</shard>
<replica>clickhouse-1</replica>
</macros>
<!-- Настройки сети -->
<networks>
<ip>::/0</ip>
</networks>
<!-- Настройки логирования -->
<logger>
<level>information</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
</logger>
<!-- Настройки HTTP сервера -->
<http_server_default_response><![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]></http_server_default_response>
<!-- Настройки для работы с большими данными -->
<max_memory_usage>10000000000</max_memory_usage>
<max_bytes_before_external_group_by>20000000000</max_bytes_before_external_group_by>
<max_bytes_before_external_sort>20000000000</max_bytes_before_external_sort>
<!-- Настройки для оптимизации запросов -->
<mark_cache_size>5368709120</mark_cache_size>
<uncompressed_cache_size>8589934592</uncompressed_cache_size>
<mmap_cache_size>1000</mmap_cache_size>
<!-- Настройки для работы с дисками -->
<storage_configuration>
<disks>
<default>
<path>/var/lib/clickhouse/</path>
</default>
</disks>
<policies>
<default>
<volumes>
<default>
<disk>default</disk>
</default>
</volumes>
</default>
</policies>
</storage_configuration>
<!-- Настройки для работы с ZooKeeper (если потребуется) -->
<zookeeper>
<node>
<host>zookeeper</host>
<port>2181</port>
</node>
</zookeeper>
<!-- Настройки для работы с Kafka -->
<kafka>
<broker_list>kafka:29092</broker_list>
<security_protocol>plaintext</security_protocol>
<topic_list>
<topic>sensus.metrics</topic>
</topic_list>
</kafka>
<!-- Настройки для работы с PostgreSQL -->
<postgresql>
<host>postgres</host>
<port>5432</port>
<database>sensus</database>
<user>sensus</user>
<password>sensus_secure_password_2024</password>
</postgresql>
</yandex>