ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ื•ืงื˜ื•ืจ, ืฉื ื•ืขื“ ืœืืกื•ืฃ, ืœืฉื ื•ืช ื•ืœืฉืœื•ื— ื ืชื•ื ื™ ื™ื•ืžืŸ, ืžื“ื“ื™ื ื•ืื™ืจื•ืขื™ื.

โ†’ GitHub

ื‘ื”ื™ื•ืชื• ื›ืชื•ื‘ ื‘ืฉืคืช Rust, ื”ื•ื ืžืื•ืคื™ื™ืŸ ื‘ื‘ื™ืฆื•ืขื™ื ื’ื‘ื•ื”ื™ื ื•ืฆืจื™ื›ืช RAM ื ืžื•ื›ื” ื‘ื”ืฉื•ื•ืื” ืœืื ืœื•ื’ื™ื ืฉืœื•. ื‘ื ื•ืกืฃ, ืžื•ืงื“ืฉืช ืชืฉื•ืžืช ืœื‘ ืจื‘ื” ืœืคื•ื ืงืฆื™ื•ืช ื”ืงืฉื•ืจื•ืช ืœืชืงื™ื ื•ืช, ื‘ืคืจื˜, ื”ื™ื›ื•ืœืช ืœืฉืžื•ืจ ืื™ืจื•ืขื™ื ืฉืœื ื ืฉืœื—ื• ืœืžืื’ืจ ื‘ื“ื™ืกืง ื•ืœืกื•ื‘ื‘ ืงื‘ืฆื™ื.

ืžื‘ื—ื™ื ื” ืื“ืจื™ื›ืœื™ืช, ื•ืงื˜ื•ืจ ื”ื•ื ื ืชื‘ ืื™ืจื•ืขื™ื ืฉืžืงื‘ืœ ื”ื•ื“ืขื•ืช ืžืื—ื“ ืื• ื™ื•ืชืจ ืžืงื•ืจื•ืช, ืื•ืคืฆื™ื•ื ืœื™ ืœื”ื—ื™ืœ ืขืœ ื”ื•ื“ืขื•ืช ืืœื” ื˜ืจื ืกืคื•ืจืžืฆื™ื•ืช, ื•ืฉืœื™ื—ืชื ืœืื—ื“ ืื• ื™ื•ืชืจ ืžื ืงื–.

ื•ืงื˜ื•ืจ ื”ื•ื ืชื—ืœื™ืฃ ืœ-filbeat ื•-logstash, ื”ื•ื ื™ื›ื•ืœ ืœืคืขื•ืœ ื‘ืฉื ื™ ื”ืชืคืงื™ื“ื™ื (ืงื‘ืœื” ื•ืฉืœื™ื—ื” ืฉืœ ื™ื•ืžื ื™ื), ืคืจื˜ื™ื ื ื•ืกืคื™ื ืขืœื™ื”ื ืžืงื•ื•ืŸ.

ืื ื‘-Logstash ื”ืฉืจืฉืจืช ื‘ื ื•ื™ื” ื›ืงืœื˜ โ†’ ืคื™ืœื˜ืจ โ†’ ืคืœื˜ ืื– ื‘ื•ืงื˜ื•ืจ ื–ื” ื›ืŸ ืžืงื•ืจื•ืช โ†’ ื”ืชืžืจื•ืช โ†’ ื›ื™ื•ืจื™ื

ื“ื•ื’ืžืื•ืช ื ื™ืชืŸ ืœืžืฆื•ื ื‘ืชื™ืขื•ื“.

ื”ื•ืจืื” ื–ื• ื”ื™ื ื”ื•ืจืื” ืžืชื•ืงื ืช ืž ื•ื™ืืฆ'ืกืœื‘ ืจืงื™ื ืกืงื™. ื”ื”ื•ืจืื•ืช ื”ืžืงื•ืจื™ื•ืช ืžื›ื™ืœื•ืช ืขื™ื‘ื•ื“ geoip. ื‘ืขืช ื‘ื“ื™ืงืช geoip ืžืจืฉืช ืคื ื™ืžื™ืช, ื•ืงื˜ื•ืจ ื ืชืŸ ืฉื’ื™ืื”.

Aug 05 06:25:31.889 DEBUG transform{name=nginx_parse_rename_fields type=rename_fields}: vector::transforms::rename_fields: Field did not exist field=ยซgeoip.country_nameยป rate_limit_secs=30

ืื ืžื™ืฉื”ื• ืฆืจื™ืš ืœืขื‘ื“ geoip, ืขื™ื™ืŸ ื‘ื”ื•ืจืื•ืช ื”ืžืงื•ืจื™ื•ืช ืž ื•ื™ืืฆ'ืกืœื‘ ืจืงื™ื ืกืงื™.

ื ื’ื“ื™ืจ ืืช ื”ืฉื™ืœื•ื‘ ืฉืœ Nginx (Access logs) โ†’ Vector (Client | Filebeat) โ†’ Vector (Server | Logstash) โ†’ ื‘ื ืคืจื“ ื‘-Clickhouse ื•ื‘ื ืคืจื“ ื‘-Elasticsearch. ื ืชืงื™ืŸ 4 ืฉืจืชื™ื. ืœืžืจื•ืช ืฉืืชื” ื™ื›ื•ืœ ืœืขืงื•ืฃ ืืช ื–ื” ืขื 3 ืฉืจืชื™ื.

ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ื”ืชื›ื ื™ืช ื”ื™ื ืžืฉื”ื• ื›ื–ื”.

ื”ืฉื‘ืช ืืช Selinux ื‘ื›ืœ ื”ืฉืจืชื™ื ืฉืœืš

sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
reboot

ืื ื• ืžืชืงื™ื ื™ื ืืžื•ืœื˜ื•ืจ ืฉืจืช HTTP + ื›ืœื™ ืขื–ืจ ื‘ื›ืœ ื”ืฉืจืชื™ื

ื›ืืžื•ืœื˜ื•ืจ ืฉืจืช HTTP ื ืฉืชืžืฉ nodejs-stub-server ืž ืžืงืกื™ื ืื™ื’ื ื˜ื ืงื•

ืœ-Nodejs-stub-server ืื™ืŸ ืกืœ"ื“. ื›ืืŸ ืœื™ืฆื•ืจ ืขื‘ื•ืจื• ืกืœ"ื“. ืกืœ"ื“ ื™ื™ื‘ื ื” ื‘ืืžืฆืขื•ืช ืคื“ื•ืจื” ืงื•ืคืจ

ื”ื•ืกืฃ ืืช ื”ืžืื’ืจ antonpatsev/nodejs-stub-server

yum -y install yum-plugin-copr epel-release
yes | yum copr enable antonpatsev/nodejs-stub-server

ื”ืชืงืŸ nodejs-stub-server, benchmark Apache ื•ืžืจื‘ื‘ ืžืกื•ืฃ ืžืกืš ื‘ื›ืœ ื”ืฉืจืชื™ื

yum -y install stub_http_server screen mc httpd-tools screen

ืชื™ืงื ืชื™ ืืช ื–ืžืŸ ื”ืชื’ื•ื‘ื” ืฉืœ stub_http_server ื‘ืงื•ื‘ืฅ /var/lib/stub_http_server/stub_http_server.js ื›ืš ืฉื”ื™ื• ื™ื•ืชืจ ื™ื•ืžื ื™ื.

var max_sleep = 10;

ื‘ื•ืื• ื ืคืขื™ืœ ืืช stub_http_server.

systemctl start stub_http_server
systemctl enable stub_http_server

ื”ืชืงื ืช ื‘ื™ืช ืงืœื™ืง ื‘ืฉืจืช 3

ClickHouse ืžืฉืชืžืฉ ื‘ืขืจื›ืช ื”ื”ื•ืจืื•ืช SSE 4.2, ื›ืš ืฉืื ืœื ืฆื•ื™ืŸ ืื—ืจืช, ื”ืชืžื™ื›ื” ื‘ื• ื‘ืžืขื‘ื“ ื”ืžืฉืžืฉ ื”ื•ืคื›ืช ืœื“ืจื™ืฉืช ืžืขืจื›ืช ื ื•ืกืคืช. ื”ื ื” ื”ืคืงื•ื“ื” ืœื‘ื“ื•ืง ืื ื”ืžืขื‘ื“ ื”ื ื•ื›ื—ื™ ืชื•ืžืš ื‘-SSE 4.2:

grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"

ืจืืฉื™ืช ืขืœื™ืš ืœื—ื‘ืจ ืืช ื”ืžืื’ืจ ื”ืจืฉืžื™:

sudo yum install -y yum-utils
sudo rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64

ื›ื“ื™ ืœื”ืชืงื™ืŸ ื—ื‘ื™ืœื•ืช ืขืœื™ืš ืœื”ืคืขื™ืœ ืืช ื”ืคืงื•ื“ื•ืช ื”ื‘ืื•ืช:

sudo yum install -y clickhouse-server clickhouse-client

ืืคืฉืจ ืœ-clickhouse-server ืœื”ืื–ื™ืŸ ืœื›ืจื˜ื™ืก ื”ืจืฉืช ื‘ืงื•ื‘ืฅ /etc/clickhouse-server/config.xml

<listen_host>0.0.0.0</listen_host>

ืฉื™ื ื•ื™ ืจืžืช ื”ืจื™ืฉื•ื ืžืžืขืงื‘ ืœื ื™ืคื•ื™ ื‘ืื’ื™ื

ื‘ืื’ื™ื

ื”ื’ื“ืจื•ืช ื“ื—ื™ืกื” ืกื˜ื ื“ืจื˜ื™ื•ืช:

min_compress_block_size  65536
max_compress_block_size  1048576

ื›ื“ื™ ืœื”ืคืขื™ืœ ืืช ื“ื—ื™ืกืช Zstd, ื”ื•ืžืœืฅ ืœื ืœื’ืขืช ื‘ืชืฆื•ืจื”, ืืœื ืœื”ืฉืชืžืฉ ื‘-DDL.

ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ืœื ื”ืฆืœื—ืชื™ ืœืžืฆื•ื ื›ื™ืฆื“ ืœื”ืฉืชืžืฉ ื‘ื“ื—ื™ืกืช zstd ื‘ืืžืฆืขื•ืช DDL ื‘ื’ื•ื’ืœ. ืื– ื”ืฉืืจืชื™ ืืช ื–ื” ื›ืžื• ืฉื”ื•ื.

ืขืžื™ืชื™ื ืฉืžืฉืชืžืฉื™ื ื‘ื“ื—ื™ืกืช zstd ื‘-Clickhouse, ืื ื ืฉืชืคื• ืืช ื”ื”ื•ืจืื•ืช.

ื›ื“ื™ ืœื”ืคืขื™ืœ ืืช ื”ืฉืจืช ื‘ืชื•ืจ ื“ืžื•ืŸ, ื”ืจืฅ:

service clickhouse-server start

ื›ืขืช ื ืขื‘ื•ืจ ืœื”ื’ื“ืจืช Clickhouse

ืขื‘ื•ืจ ืืœ ืงืœื™ืงื”ืื•ืก

clickhouse-client -h 172.26.10.109 -m

172.26.10.109 - IP ืฉืœ ื”ืฉืจืช ืฉื‘ื• ืžื•ืชืงืŸ Clickhouse.

ื‘ื•ืื• ื ื™ืฆื•ืจ ืžืกื“ ื ืชื•ื ื™ื ื•ืงื˜ื•ืจื™

CREATE DATABASE vector;

ื‘ื•ื ื ื‘ื“ื•ืง ืฉืžืกื“ ื”ื ืชื•ื ื™ื ืงื™ื™ื.

show databases;

ืฆื•ืจ ื˜ื‘ืœืช vector.logs.

/* ะญั‚ะพ ั‚ะฐะฑะปะธั†ะฐ ะณะดะต ั…ั€ะฐะฝัั‚ัั ะปะพะณะธ ะบะฐะบ ะตัั‚ัŒ */

CREATE TABLE vector.logs
(
    `node_name` String,
    `timestamp` DateTime,
    `server_name` String,
    `user_id` String,
    `request_full` String,
    `request_user_agent` String,
    `request_http_host` String,
    `request_uri` String,
    `request_scheme` String,
    `request_method` String,
    `request_length` UInt64,
    `request_time` Float32,
    `request_referrer` String,
    `response_status` UInt16,
    `response_body_bytes_sent` UInt64,
    `response_content_type` String,
    `remote_addr` IPv4,
    `remote_port` UInt32,
    `remote_user` String,
    `upstream_addr` IPv4,
    `upstream_port` UInt32,
    `upstream_bytes_received` UInt64,
    `upstream_bytes_sent` UInt64,
    `upstream_cache_status` String,
    `upstream_connect_time` Float32,
    `upstream_header_time` Float32,
    `upstream_response_length` UInt64,
    `upstream_response_time` Float32,
    `upstream_status` UInt16,
    `upstream_content_type` String,
    INDEX idx_http_host request_http_host TYPE set(0) GRANULARITY 1
)
ENGINE = MergeTree()
PARTITION BY toYYYYMMDD(timestamp)
ORDER BY timestamp
TTL timestamp + toIntervalMonth(1)
SETTINGS index_granularity = 8192;

ืื ื• ื‘ื•ื“ืงื™ื ืฉื”ื˜ื‘ืœืื•ืช ื ื•ืฆืจื•. ื‘ื•ืื• ื ืฉื™ืง clickhouse-client ื•ืœื”ื’ื™ืฉ ื‘ืงืฉื”.

ื‘ื•ื ื ืœืš ืœืžืกื“ ื”ื ืชื•ื ื™ื ื”ื•ื•ืงื˜ื•ืจื™ื™ื.

use vector;

Ok.

0 rows in set. Elapsed: 0.001 sec.

ื‘ื•ืื• ื ืกืชื›ืœ ืขืœ ื”ื˜ื‘ืœืื•ืช.

show tables;

โ”Œโ”€nameโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ logs                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

ื”ืชืงื ืช elasticsearch ื‘ืฉืจืช ื”ืจื‘ื™ืขื™ ื›ื“ื™ ืœืฉืœื•ื— ืืช ืื•ืชื ื ืชื•ื ื™ื ืืœ Elasticsearch ืœืฆื•ืจืš ื”ืฉื•ื•ืื” ืขื Clickhouse

ื”ื•ืกืฃ ืžืคืชื— ืกืœ"ื“ ืฆื™ื‘ื•ืจื™

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

ื‘ื•ืื• ื ื™ืฆื•ืจ 2 ืžืื’ืจ:

/etc/yum.repos.d/elasticsearch.repo

[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md

/etc/yum.repos.d/kibana.repo

[kibana-7.x]
name=Kibana repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

ื”ืชืงืŸ ืืช elasticsearch ื•-kibana

yum install -y kibana elasticsearch

ืžื›ื™ื•ื•ืŸ ืฉื”ื•ื ื™ื”ื™ื” ื‘ืขื•ืชืง ืื—ื“, ืขืœื™ืš ืœื”ื•ืกื™ืฃ ืืช ื”ื“ื‘ืจื™ื ื”ื‘ืื™ื ืœืงื•ื‘ืฅ /etc/elasticsearch/elasticsearch.yml:

discovery.type: single-node

ื›ื“ื™ ืฉื”ื•ื•ืงื˜ื•ืจ ื”ื–ื” ื™ื•ื›ืœ ืœืฉืœื•ื— ื ืชื•ื ื™ื ืืœ elasticsearch ืžืฉืจืช ืื—ืจ, ื‘ื•ืื• ื ืฉื ื” ืืช network.host.

network.host: 0.0.0.0

ื›ื“ื™ ืœื”ืชื—ื‘ืจ ืœ-kibana, ืฉื ื” ืืช ื”ืคืจืžื˜ืจ server.host ื‘ืงื•ื‘ืฅ /etc/kibana/kibana.yml

server.host: "0.0.0.0"

ื™ืฉืŸ ื•ื›ื•ืœืœ elasticsearch ื‘-autostart

systemctl enable elasticsearch
systemctl start elasticsearch

ื•ืงื™ื‘ื ื”

systemctl enable kibana
systemctl start kibana

ื”ื’ื“ืจืช Elasticsearch ืขื‘ื•ืจ ืžืฆื‘ ืฆื•ืžืช ื™ื—ื™ื“ 1 ืจืกื™ืก, 0 ื”ืขืชืง. ืกื‘ื™ืจ ืœื”ื ื™ื— ืฉื™ื”ื™ื” ืœืš ืืฉื›ื•ืœ ืฉืœ ืžืกืคืจ ืจื‘ ืฉืœ ืฉืจืชื™ื ื•ืืชื” ืœื ืฆืจื™ืš ืœืขืฉื•ืช ื–ืืช.

ืขื‘ื•ืจ ืื™ื ื“ืงืกื™ื ืขืชื™ื“ื™ื™ื, ืขื“ื›ืŸ ืืช ืชื‘ื ื™ืช ื‘ืจื™ืจืช ื”ืžื—ื“ืœ:

curl -X PUT http://localhost:9200/_template/default -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"order": -1,"settings": {"number_of_shards": "1","number_of_replicas": "0"}}' 

ื”ืชืงื ื” ื•ืงื˜ื•ืจ ื›ืชื—ืœื™ืฃ ืœ-Logstash ื‘ืฉืจืช 2

yum install -y https://packages.timber.io/vector/0.9.X/vector-x86_64.rpm mc httpd-tools screen

ื‘ื•ืื• ื ื’ื“ื™ืจ ืืช ื•ืงื˜ื•ืจ ื›ืชื—ืœื™ืฃ ืœ-Logstash. ืขืจื™ื›ืช ื”ืงื•ื‘ืฅ /etc/vector/vector.toml

# /etc/vector/vector.toml

data_dir = "/var/lib/vector"

[sources.nginx_input_vector]
  # General
  type                          = "vector"
  address                       = "0.0.0.0:9876"
  shutdown_timeout_secs         = 30

[transforms.nginx_parse_json]
  inputs                        = [ "nginx_input_vector" ]
  type                          = "json_parser"

[transforms.nginx_parse_add_defaults]
  inputs                        = [ "nginx_parse_json" ]
  type                          = "lua"
  version                       = "2"

  hooks.process = """
  function (event, emit)

    function split_first(s, delimiter)
      result = {};
      for match in (s..delimiter):gmatch("(.-)"..delimiter) do
          table.insert(result, match);
      end
      return result[1];
    end

    function split_last(s, delimiter)
      result = {};
      for match in (s..delimiter):gmatch("(.-)"..delimiter) do
          table.insert(result, match);
      end
      return result[#result];
    end

    event.log.upstream_addr             = split_first(split_last(event.log.upstream_addr, ', '), ':')
    event.log.upstream_bytes_received   = split_last(event.log.upstream_bytes_received, ', ')
    event.log.upstream_bytes_sent       = split_last(event.log.upstream_bytes_sent, ', ')
    event.log.upstream_connect_time     = split_last(event.log.upstream_connect_time, ', ')
    event.log.upstream_header_time      = split_last(event.log.upstream_header_time, ', ')
    event.log.upstream_response_length  = split_last(event.log.upstream_response_length, ', ')
    event.log.upstream_response_time    = split_last(event.log.upstream_response_time, ', ')
    event.log.upstream_status           = split_last(event.log.upstream_status, ', ')

    if event.log.upstream_addr == "" then
        event.log.upstream_addr = "127.0.0.1"
    end

    if (event.log.upstream_bytes_received == "-" or event.log.upstream_bytes_received == "") then
        event.log.upstream_bytes_received = "0"
    end

    if (event.log.upstream_bytes_sent == "-" or event.log.upstream_bytes_sent == "") then
        event.log.upstream_bytes_sent = "0"
    end

    if event.log.upstream_cache_status == "" then
        event.log.upstream_cache_status = "DISABLED"
    end

    if (event.log.upstream_connect_time == "-" or event.log.upstream_connect_time == "") then
        event.log.upstream_connect_time = "0"
    end

    if (event.log.upstream_header_time == "-" or event.log.upstream_header_time == "") then
        event.log.upstream_header_time = "0"
    end

    if (event.log.upstream_response_length == "-" or event.log.upstream_response_length == "") then
        event.log.upstream_response_length = "0"
    end

    if (event.log.upstream_response_time == "-" or event.log.upstream_response_time == "") then
        event.log.upstream_response_time = "0"
    end

    if (event.log.upstream_status == "-" or event.log.upstream_status == "") then
        event.log.upstream_status = "0"
    end

    emit(event)

  end
  """

[transforms.nginx_parse_remove_fields]
    inputs                              = [ "nginx_parse_add_defaults" ]
    type                                = "remove_fields"
    fields                              = ["data", "file", "host", "source_type"]

[transforms.nginx_parse_coercer]

    type                                = "coercer"
    inputs                              = ["nginx_parse_remove_fields"]

    types.request_length = "int"
    types.request_time = "float"

    types.response_status = "int"
    types.response_body_bytes_sent = "int"

    types.remote_port = "int"

    types.upstream_bytes_received = "int"
    types.upstream_bytes_send = "int"
    types.upstream_connect_time = "float"
    types.upstream_header_time = "float"
    types.upstream_response_length = "int"
    types.upstream_response_time = "float"
    types.upstream_status = "int"

    types.timestamp = "timestamp"

[sinks.nginx_output_clickhouse]
    inputs   = ["nginx_parse_coercer"]
    type     = "clickhouse"

    database = "vector"
    healthcheck = true
    host = "http://172.26.10.109:8123" #  ะะดั€ะตั Clickhouse
    table = "logs"

    encoding.timestamp_format = "unix"

    buffer.type = "disk"
    buffer.max_size = 104900000
    buffer.when_full = "block"

    request.in_flight_limit = 20

[sinks.elasticsearch]
    type = "elasticsearch"
    inputs   = ["nginx_parse_coercer"]
    compression = "none"
    healthcheck = true
    # 172.26.10.116 - ัะตั€ะฒะตั€ ะณะดะต ัƒัั‚ะฐะฝะพะฒะตะฝ elasticsearch
    host = "http://172.26.10.116:9200" 
    index = "vector-%Y-%m-%d"

ืืชื” ื™ื›ื•ืœ ืœื”ืชืื™ื ืืช ื”ืงื˜ืข transforms.nginx_parse_add_defaults.

ื›ืžื• ื•ื™ืืฆ'ืกืœื‘ ืจืงื™ื ืกืงื™ ืžืฉืชืžืฉ ื‘ื”ื’ื“ืจื•ืช ืืœื” ืขื‘ื•ืจ CDN ืงื˜ืŸ ื•ื™ื›ื•ืœื™ื ืœื”ื™ื•ืช ืžืกืคืจ ืขืจื›ื™ื ื‘ืžืขืœื” ื”ื–ืจื_*

ืœื“ื•ื’ืžื”:

"upstream_addr": "128.66.0.10:443, 128.66.0.11:443, 128.66.0.12:443"
"upstream_bytes_received": "-, -, 123"
"upstream_status": "502, 502, 200"

ืื ื–ื” ืœื ื”ืžืฆื‘ ืฉืœืš, ืื– ื ื™ืชืŸ ืœืคืฉื˜ ืืช ื”ืกืขื™ืฃ ื”ื–ื”

ื‘ื•ืื• ื ื™ืฆื•ืจ ื”ื’ื“ืจื•ืช ืฉื™ืจื•ืช ืขื‘ื•ืจ systemd /etc/systemd/system/vector.service

# /etc/systemd/system/vector.service

[Unit]
Description=Vector
After=network-online.target
Requires=network-online.target

[Service]
User=vector
Group=vector
ExecStart=/usr/bin/vector
ExecReload=/bin/kill -HUP $MAINPID
Restart=no
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=vector

[Install]
WantedBy=multi-user.target

ืœืื—ืจ ื™ืฆื™ืจืช ื”ื˜ื‘ืœืื•ืช, ืชื•ื›ืœ ืœื”ืคืขื™ืœ ืืช ื•ืงื˜ื•ืจ

systemctl enable vector
systemctl start vector

ื ื™ืชืŸ ืœืจืื•ืช ื™ื•ืžื ื™ ื•ืงื˜ื•ืจ ื›ืš:

journalctl -f -u vector

ืฆืจื™ื›ื•ืช ืœื”ื™ื•ืช ืขืจื›ื™ื ื›ืืœื” ื‘ื™ื•ืžื ื™ื

INFO vector::topology::builder: Healthcheck: Passed.
INFO vector::topology::builder: Healthcheck: Passed.

ื‘ืœืงื•ื— (ืฉืจืช ืื™ื ื˜ืจื ื˜) - ืฉืจืช 1

ื‘ืฉืจืช ืขื nginx, ืืชื” ืฆืจื™ืš ืœื”ืฉื‘ื™ืช ืืช ipv6, ืžื›ื™ื•ื•ืŸ ืฉื˜ื‘ืœืช ื”ื™ื•ืžื ื™ื ื‘-clickhouse ืžืฉืชืžืฉืช ื‘ืฉื“ื” upstream_addr IPv4, ืžื›ื™ื•ื•ืŸ ืฉืื ื™ ืœื ืžืฉืชืžืฉ ื‘-ipv6 ื‘ืชื•ืš ื”ืจืฉืช. ืื ipv6 ืœื ื›ื‘ื•ื™, ื™ื”ื™ื• ืฉื’ื™ืื•ืช:

DB::Exception: Invalid IPv4 value.: (while read the value of key upstream_addr)

ืื•ืœื™ ืงื•ืจืื™ื, ื”ื•ืกืฃ ืชืžื™ื›ื” ื‘-ipv6.

ืฆื•ืจ ืืช ื”ืงื•ื‘ืฅ /etc/sysctl.d/98-disable-ipv6.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

ื”ื—ืœืช ื”ื”ื’ื“ืจื•ืช

sysctl --system

ื‘ื•ืื• ื ืชืงื™ืŸ ืืช nginx.

ื ื•ืกืฃ ืงื•ื‘ืฅ ืžืื’ืจ nginx /etc/yum.repos.d/nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

ื”ืชืงืŸ ืืช ื—ื‘ื™ืœืช nginx

yum install -y nginx

ืจืืฉื™ืช, ืขืœื™ื ื• ืœื”ื’ื“ื™ืจ ืืช ืคื•ืจืžื˜ ื”ื™ื•ืžืŸ ื‘-Nginx ื‘ืงื•ื‘ืฅ /etc/nginx/nginx.conf

user  nginx;
# you must set worker processes based on your CPU cores, nginx does not benefit from setting more than that
worker_processes auto; #some last versions calculate it automatically

# number of file descriptors used for nginx
# the limit for the maximum FDs on the server is usually set by the OS.
# if you don't set FD's then OS settings will be used which is by default 2000
worker_rlimit_nofile 100000;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

# provides the configuration file context in which the directives that affect connection processing are specified.
events {
    # determines how much clients will be served per worker
    # max clients = worker_connections * worker_processes
    # max clients is also limited by the number of socket connections available on the system (~64k)
    worker_connections 4000;

    # optimized to serve many clients with each thread, essential for linux -- for testing environment
    use epoll;

    # accept as many connections as possible, may flood worker connections if set too low -- for testing environment
    multi_accept on;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

log_format vector escape=json
    '{'
        '"node_name":"nginx-vector",'
        '"timestamp":"$time_iso8601",'
        '"server_name":"$server_name",'
        '"request_full": "$request",'
        '"request_user_agent":"$http_user_agent",'
        '"request_http_host":"$http_host",'
        '"request_uri":"$request_uri",'
        '"request_scheme": "$scheme",'
        '"request_method":"$request_method",'
        '"request_length":"$request_length",'
        '"request_time": "$request_time",'
        '"request_referrer":"$http_referer",'
        '"response_status": "$status",'
        '"response_body_bytes_sent":"$body_bytes_sent",'
        '"response_content_type":"$sent_http_content_type",'
        '"remote_addr": "$remote_addr",'
        '"remote_port": "$remote_port",'
        '"remote_user": "$remote_user",'
        '"upstream_addr": "$upstream_addr",'
        '"upstream_bytes_received": "$upstream_bytes_received",'
        '"upstream_bytes_sent": "$upstream_bytes_sent",'
        '"upstream_cache_status":"$upstream_cache_status",'
        '"upstream_connect_time":"$upstream_connect_time",'
        '"upstream_header_time":"$upstream_header_time",'
        '"upstream_response_length":"$upstream_response_length",'
        '"upstream_response_time":"$upstream_response_time",'
        '"upstream_status": "$upstream_status",'
        '"upstream_content_type":"$upstream_http_content_type"'
    '}';

    access_log  /var/log/nginx/access.log  main;
    access_log  /var/log/nginx/access.json.log vector;      # ะะพะฒั‹ะน ะปะพะณ ะฒ ั„ะพั€ะผะฐั‚ะต json

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

ื›ื“ื™ ืœื ืœืฉื‘ื•ืจ ืืช ื”ืชืฆื•ืจื” ื”ื ื•ื›ื—ื™ืช ืฉืœืš, Nginx ืžืืคืฉืจืช ืœืš ืœืงื‘ืœ ืžืกืคืจ ื”ื ื—ื™ื•ืช access_log

access_log  /var/log/nginx/access.log  main;            # ะกั‚ะฐะฝะดะฐั€ั‚ะฝั‹ะน ะปะพะณ
access_log  /var/log/nginx/access.json.log vector;      # ะะพะฒั‹ะน ะปะพะณ ะฒ ั„ะพั€ะผะฐั‚ะต json

ืืœ ืชืฉื›ื— ืœื”ื•ืกื™ืฃ ื›ืœืœ ืœ-logrotate ืขื‘ื•ืจ ื™ื•ืžื ื™ื ื—ื“ืฉื™ื (ืื ืงื•ื‘ืฅ ื”ื™ื•ืžืŸ ืื™ื ื• ืžืกืชื™ื™ื ื‘-.log)

ื”ืกืจ ืืช default.conf ืž-/etc/nginx/conf.d/

rm -f /etc/nginx/conf.d/default.conf

ื”ื•ืกืฃ ืžืืจื— ื•ื™ืจื˜ื•ืืœื™ /etc/nginx/conf.d/vhost1.conf

server {
    listen 80;
    server_name vhost1;
    location / {
        proxy_pass http://172.26.10.106:8080;
    }
}

ื”ื•ืกืฃ ืžืืจื— ื•ื™ืจื˜ื•ืืœื™ /etc/nginx/conf.d/vhost2.conf

server {
    listen 80;
    server_name vhost2;
    location / {
        proxy_pass http://172.26.10.108:8080;
    }
}

ื”ื•ืกืฃ ืžืืจื— ื•ื™ืจื˜ื•ืืœื™ /etc/nginx/conf.d/vhost3.conf

server {
    listen 80;
    server_name vhost3;
    location / {
        proxy_pass http://172.26.10.109:8080;
    }
}

ื”ื•ืกืฃ ืžืืจื— ื•ื™ืจื˜ื•ืืœื™ /etc/nginx/conf.d/vhost4.conf

server {
    listen 80;
    server_name vhost4;
    location / {
        proxy_pass http://172.26.10.116:8080;
    }
}

ื”ื•ืกืฃ ืžืืจื—ื™ื ื•ื™ืจื˜ื•ืืœื™ื™ื (172.26.10.106 ip ืฉืœ ื”ืฉืจืช ืฉื‘ื• ืžื•ืชืงืŸ nginx) ืœื›ืœ ื”ืฉืจืชื™ื ืœืงื•ื‘ืฅ /etc/hosts:

172.26.10.106 vhost1
172.26.10.106 vhost2
172.26.10.106 vhost3
172.26.10.106 vhost4

ื•ืื ื”ื›ืœ ืžื•ื›ืŸ ืื–

nginx -t 
systemctl restart nginx

ืขื›ืฉื™ื• ื‘ื•ืื• ื ืชืงื™ืŸ ืืช ื–ื” ื‘ืขืฆืžื ื• ื•ืงื˜ื•ืจ

yum install -y https://packages.timber.io/vector/0.9.X/vector-x86_64.rpm

ื‘ื•ืื• ื ื™ืฆื•ืจ ืงื•ื‘ืฅ ื”ื’ื“ืจื•ืช ืขื‘ื•ืจ systemd /etc/systemd/system/vector.service

[Unit]
Description=Vector
After=network-online.target
Requires=network-online.target

[Service]
User=vector
Group=vector
ExecStart=/usr/bin/vector
ExecReload=/bin/kill -HUP $MAINPID
Restart=no
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=vector

[Install]
WantedBy=multi-user.target

ื•ื”ื’ื“ืจ ืืช ื”ื—ืœืคืช Filebeat ื‘ืชืฆื•ืจื” /etc/vector/vector.toml. ื›ืชื•ื‘ืช ื”-IP 172.26.10.108 ื”ื™ื ื›ืชื•ื‘ืช ื”-IP ืฉืœ ืฉืจืช ื”ื™ื•ืžืŸ (Vector-Server)

data_dir = "/var/lib/vector"

[sources.nginx_file]
  type                          = "file"
  include                       = [ "/var/log/nginx/access.json.log" ]
  start_at_beginning            = false
  fingerprinting.strategy       = "device_and_inode"

[sinks.nginx_output_vector]
  type                          = "vector"
  inputs                        = [ "nginx_file" ]

  address                       = "172.26.10.108:9876"

ืืœ ืชืฉื›ื— ืœื”ื•ืกื™ืฃ ืืช ื”ืžืฉืชืžืฉ ื”ื•ืงื˜ื•ืจ ืœืงื‘ื•ืฆื” ื”ื ื“ืจืฉืช ื›ื“ื™ ืฉื™ื•ื›ืœ ืœืงืจื•ื ืงื‘ืฆื™ ื™ื•ืžืŸ. ืœื“ื•ื’ืžื”, nginx ื‘-centos ื™ื•ืฆืจ ื™ื•ืžื ื™ื ืขื ื–ื›ื•ื™ื•ืช ืงื‘ื•ืฆืช adm.

usermod -a -G adm vector

ื‘ื•ืื• ื ืชื—ื™ืœ ืืช ืฉื™ืจื•ืช ื”ื•ื•ืงื˜ื•ืจ

systemctl enable vector
systemctl start vector

ื ื™ืชืŸ ืœืจืื•ืช ื™ื•ืžื ื™ ื•ืงื˜ื•ืจ ื›ืš:

journalctl -f -u vector

ืฆืจื™ืš ืœื”ื™ื•ืช ืขืจืš ื›ื–ื” ื‘ื™ื•ืžื ื™ื

INFO vector::topology::builder: Healthcheck: Passed.

ืžื‘ื—ืŸ ืœื—ืฅ

ื”ื‘ื“ื™ืงื” ืžืชื‘ืฆืขืช ื‘ืืžืฆืขื•ืช ืจืฃ Apache.

ื—ื‘ื™ืœืช httpd-tools ื”ื•ืชืงื ื” ื‘ื›ืœ ื”ืฉืจืชื™ื

ืื ื• ืžืชื—ื™ืœื™ื ืœื‘ื—ื•ืŸ ื‘ืืžืฆืขื•ืช Apache benchmark ืž-4 ืฉืจืชื™ื ืฉื•ื ื™ื ื‘ืžืกืš. ืจืืฉื™ืช, ืื ื• ืžืคืขื™ืœื™ื ืืช ืžืจื•ื‘ื™ ืžืกื•ืฃ ื”ืžืกืš, ื•ืœืื—ืจ ืžื›ืŸ ืื ื• ืžืชื—ื™ืœื™ื ืœื‘ื“ื•ืง ื‘ืืžืฆืขื•ืช ื”-benchmark ืฉืœ Apache. ืื™ืš ืœืขื‘ื•ื“ ืขื ืžืกืš ืืชื” ื™ื›ื•ืœ ืœืžืฆื•ื ื‘ ัั‚ะฐั‚ัŒะต.

ืžื”ืฉืจืช ื”ืจืืฉื•ืŸ

while true; do ab -H "User-Agent: 1server" -c 100 -n 10 -t 10 http://vhost1/; sleep 1; done

ืžื”ืฉืจืช ื”ืจืืฉื•ืŸ

while true; do ab -H "User-Agent: 2server" -c 100 -n 10 -t 10 http://vhost2/; sleep 1; done

ืžื”ืฉืจืช ื”ืจืืฉื•ืŸ

while true; do ab -H "User-Agent: 3server" -c 100 -n 10 -t 10 http://vhost3/; sleep 1; done

ืžื”ืฉืจืช ื”ืจืืฉื•ืŸ

while true; do ab -H "User-Agent: 4server" -c 100 -n 10 -t 10 http://vhost4/; sleep 1; done

ื‘ื•ืื• ื ื‘ื“ื•ืง ืืช ื”ื ืชื•ื ื™ื ื‘ืงืœื™ืงื”ืื•ืก

ืขื‘ื•ืจ ืืœ ืงืœื™ืงื”ืื•ืก

clickhouse-client -h 172.26.10.109 -m

ื‘ื™ืฆื•ืข ืฉืื™ืœืชืช SQL

SELECT * FROM vector.logs;

โ”Œโ”€node_nameโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€timestampโ”€โ”ฌโ”€server_nameโ”€โ”ฌโ”€user_idโ”€โ”ฌโ”€request_fullโ”€โ”€โ”€โ”ฌโ”€request_user_agentโ”€โ”ฌโ”€request_http_hostโ”€โ”ฌโ”€request_uriโ”€โ”ฌโ”€request_schemeโ”€โ”ฌโ”€request_methodโ”€โ”ฌโ”€request_lengthโ”€โ”ฌโ”€request_timeโ”€โ”ฌโ”€request_referrerโ”€โ”ฌโ”€response_statusโ”€โ”ฌโ”€response_body_bytes_sentโ”€โ”ฌโ”€response_content_typeโ”€โ”ฌโ”€โ”€โ”€remote_addrโ”€โ”ฌโ”€remote_portโ”€โ”ฌโ”€remote_userโ”€โ”ฌโ”€upstream_addrโ”€โ”ฌโ”€upstream_portโ”€โ”ฌโ”€upstream_bytes_receivedโ”€โ”ฌโ”€upstream_bytes_sentโ”€โ”ฌโ”€upstream_cache_statusโ”€โ”ฌโ”€upstream_connect_timeโ”€โ”ฌโ”€upstream_header_timeโ”€โ”ฌโ”€upstream_response_lengthโ”€โ”ฌโ”€upstream_response_timeโ”€โ”ฌโ”€upstream_statusโ”€โ”ฌโ”€upstream_content_typeโ”€โ”
โ”‚ nginx-vector โ”‚ 2020-08-07 04:32:42 โ”‚ vhost1      โ”‚         โ”‚ GET / HTTP/1.0 โ”‚ 1server            โ”‚ vhost1            โ”‚ /           โ”‚ http           โ”‚ GET            โ”‚             66 โ”‚        0.028 โ”‚                  โ”‚             404 โ”‚                       27 โ”‚                       โ”‚ 172.26.10.106 โ”‚       45886 โ”‚             โ”‚ 172.26.10.106 โ”‚             0 โ”‚                     109 โ”‚                  97 โ”‚ DISABLED              โ”‚                     0 โ”‚                0.025 โ”‚                       27 โ”‚                  0.029 โ”‚             404 โ”‚                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

ื’ืœื” ืืช ื’ื•ื“ืœ ื”ืฉื•ืœื—ื ื•ืช ื‘ืงืœื™ืงื”ืื•ืก

select concat(database, '.', table)                         as table,
       formatReadableSize(sum(bytes))                       as size,
       sum(rows)                                            as rows,
       max(modification_time)                               as latest_modification,
       sum(bytes)                                           as bytes_size,
       any(engine)                                          as engine,
       formatReadableSize(sum(primary_key_bytes_in_memory)) as primary_keys_size
from system.parts
where active
group by database, table
order by bytes_size desc;

ื‘ื•ืื• ืœื’ืœื•ืช ื›ืžื” ื™ื•ืžื ื™ื ืชืคืกื• ื‘ืงืœื™ืงื”ืื•ืก.

ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ื’ื•ื“ืœ ื˜ื‘ืœืช ื”ื™ื•ืžื ื™ื ื”ื•ื 857.19 MB.

ืฉืœื™ื—ืช ื™ื•ืžื ื™ Nginx json ื‘ืืžืฆืขื•ืช Vector ืœ-Clickhouse ื•- Elasticsearch

ื’ื•ื“ืœื ืฉืœ ืื•ืชื ื ืชื•ื ื™ื ื‘ืื™ื ื“ืงืก ื‘- Elasticsearch ื”ื•ื 4,5GB.

ืื ืœื ืžืฆื™ื™ื ื™ื ื ืชื•ื ื™ื ื‘ื•ื•ืงื˜ื•ืจ ื‘ืคืจืžื˜ืจื™ื, Clickhouse ืœื•ืงื— 4500/857.19 = ืคื™ 5.24 ืคื—ื•ืช ืžืืฉืจ ื‘- Elasticsearch.

ื‘ื•ืงื˜ื•ืจ, ืฉื“ื” ื”ื“ื—ื™ืกื” ืžืฉืžืฉ ื›ื‘ืจื™ืจืช ืžื—ื“ืœ.

ืฆ'ืื˜ ื‘ื˜ืœื’ืจื ืžืืช ื‘ื™ืช ืงืœื™ืง
ืฆ'ืื˜ ื‘ื˜ืœื’ืจื ืžืืช Elasticsearch
ืฆ'ืื˜ ื‘ื˜ืœื’ืจื ืžืืช "ืื™ืกื•ืฃ ื•ื ื™ืชื•ื— ืžืขืจื›ืช ื”ื•ื“ืขื•ืช"

ืžืงื•ืจ: www.habr.com

ื”ื•ืกืคืช ืชื’ื•ื‘ื”