Clickhouse 原生监控

clickhouse的监控包括硬件资源的使用和clickhouse服务指标的监控。

1.硬件资源的使用:

1.处理器的负载 温度
 可以使用dmesg, turbostat 命令

2.网络资源,内存,磁盘的监控

2. clickhouse 服务的监控:

clickhouse提供了日志和系统表进行自我状态的监控。

2.1系统表:

clickhouse主要提供了三张表来支撑运行指标的查询,分别是metrics,events,asynchronous_metrics

1. metrics:

Clickhouse> select count(1) from system.metrics;

SELECT count(1)
FROM system.metrics

┌─count(1)─┐
│       56 │
└──────────┘

1 rows in set. Elapsed: 0.004 sec. 

Clickhouse> select * from metrics limit 8;

SELECT *
FROM metrics
LIMIT 8

┌─metric─────────────────┬─value─┬─description───────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Query                  │     1 │ Number of executing queries                                                                                       │
│ Merge                  │     0 │ Number of executing background merges                                                                             │
│ PartMutation           │     0 │ Number of mutations (ALTER DELETE/UPDATE)                                                                         │
│ ReplicatedFetch        │     0 │ Number of data parts being fetched from replica                                                                   │
│ ReplicatedSend         │     0 │ Number of data parts being sent to replicas                                                                       │
│ ReplicatedChecks       │     0 │ Number of data parts checking for consistency                                                                     │
│ BackgroundPoolTask     │     0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping) │
│ BackgroundMovePoolTask │     0 │ Number of active tasks in BackgroundProcessingPool for moves                                                      │
└────────────────────────┴───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

8 rows in set. Elapsed: 0.001 sec. 


2.events:
Clickhouse> select count(1) from system.events;

SELECT count(1)
FROM system.events

┌─count(1)─┐
│       56 │
└──────────┘

1 rows in set. Elapsed: 0.002 sec. 

Clickhouse> select * from system.events where length(description)<64 limit 8;

SELECT *
FROM system.events
WHERE length(description) < 64
LIMIT 8

┌─event──────────────┬─────────value─┬─description───────────────────────────────────────┐
│ SelectQuery        │           117 │ Same as Query, but only for SELECT queries.       │
│ InsertQuery        │            10 │ Same as Query, but only for INSERT queries.       │
│ FailedQuery        │            16 │ Number of failed queries.                         │
│ FailedSelectQuery  │            13 │ Same as FailedQuery, but only for SELECT queries. │
│ FileOpen           │       4754048 │ Number of files opened.                           │
│ IOBufferAllocs     │      10663562 │                                                   │
│ IOBufferAllocBytes │ 1475385103619 │                                                   │
│ ArenaAllocChunks   │           239 │                                                   │
└────────────────────┴───────────────┴───────────────────────────────────────────────────┘

8 rows in set. Elapsed: 0.002 sec. 

3.asynchronous_metrics
asynchronous_metrics 主要用于统计clickhouse服务运行过程的时候,当前正在后台异步运行的信息。
Clickhouse> select * from system.asynchronous_metrics;

SELECT *
FROM system.asynchronous_metrics

┌─metric───────────────────────────────────┬──────value─┐
│ jemalloc.arenas.all.pmuzzy               │          0 │
│ jemalloc.arenas.all.pdirty               │     390809 │
│ jemalloc.background_thread.run_intervals │          0 │
│ jemalloc.background_thread.num_runs      │          0 │
│ jemalloc.retained                        │ 2072219648 │
│ jemalloc.mapped                          │ 1702653952 │
│ jemalloc.metadata                        │   14310304 │
│ jemalloc.resident                        │ 1688084480 │
│ jemalloc.allocated                       │   65487464 │
│ jemalloc.epoch                           │       1003 │
│ NumberOfTables                           │         81 │
│ jemalloc.active                          │   74637312 │
│ NumberOfDatabases                        │          4 │
│ MaxPartCountForPartition                 │          6 │
│ jemalloc.background_thread.num_threads   │          0 │
│ ReplicasSumQueueSize                     │          0 │
│ ReplicasMaxMergesInQueue                 │          0 │
│ MemoryShared                             │   36601856 │
│ MemoryCode                               │  296161280 │
│ ReplicasMaxAbsoluteDelay                 │          0 │
│ ReplicasMaxQueueSize                     │          0 │
│ jemalloc.arenas.all.muzzy_purged         │          0 │
│ MemoryVirtual                            │ 5033521152 │
│ MarkCacheBytes                           │       1152 │
│ Uptime                                   │      60101 │
│ jemalloc.arenas.all.dirty_purged         │  513426464 │
│ ReplicasMaxRelativeDelay                 │          0 │
│ MemoryResident                           │  741322752 │
│ ReplicasMaxInsertsInQueue                │          0 │
│ jemalloc.metadata_thp                    │          0 │
│ UncompressedCacheCells                   │          0 │
│ CompiledExpressionCacheCount             │          0 │
│ ReplicasSumMergesInQueue                 │          0 │
│ UncompressedCacheBytes                   │          0 │
│ ReplicasSumInsertsInQueue                │          0 │
│ MarkCacheFiles                           │         36 │
│ MemoryDataAndStack                       │ 4291059712 │
│ jemalloc.arenas.all.pactive              │      18222 │
└──────────────────────────────────────────┴────────────┘

38 rows in set. Elapsed: 0.002 sec. 

4.processes:

用于查询线程信息的process:

Clickhouse> desc system.processes;

DESCRIBE TABLE system.processes

┌─name─────────────────┬─type──────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ is_initial_query     │ UInt8         │              │                    │         │                  │                │
│ user                 │ String        │              │                    │         │                  │                │
│ query_id             │ String        │              │                    │         │                  │                │
│ address              │ IPv6          │              │                    │         │                  │                │
│ port                 │ UInt16        │              │                    │         │                  │                │
│ initial_user         │ String        │              │                    │         │                  │                │
│ initial_query_id     │ String        │              │                    │         │                  │                │
│ initial_address      │ IPv6          │              │                    │         │                  │                │
│ initial_port         │ UInt16        │              │                    │         │                  │                │
│ interface            │ UInt8         │              │                    │         │                  │                │
│ os_user              │ String        │              │                    │         │                  │                │
│ client_hostname      │ String        │              │                    │         │                  │                │
│ client_name          │ String        │              │                    │         │                  │                │
│ client_revision      │ UInt64        │              │                    │         │                  │                │
│ client_version_major │ UInt64        │              │                    │         │                  │                │
│ client_version_minor │ UInt64        │              │                    │         │                  │                │
│ client_version_patch │ UInt64        │              │                    │         │                  │                │
│ http_method          │ UInt8         │              │                    │         │                  │                │
│ http_user_agent      │ String        │              │                    │         │                  │                │
│ quota_key            │ String        │              │                    │         │                  │                │
│ elapsed              │ Float64       │              │                    │         │                  │                │
│ is_cancelled         │ UInt8         │              │                    │         │                  │                │
│ read_rows            │ UInt64        │              │                    │         │                  │                │
│ read_bytes           │ UInt64        │              │                    │         │                  │                │
│ total_rows_approx    │ UInt64        │              │                    │         │                  │                │
│ written_rows         │ UInt64        │              │                    │         │                  │                │
│ written_bytes        │ UInt64        │              │                    │         │                  │                │
│ memory_usage         │ Int64         │              │                    │         │                  │                │
│ peak_memory_usage    │ Int64         │              │                    │         │                  │                │
│ query                │ String        │              │                    │         │                  │                │
│ thread_ids           │ Array(UInt64) │              │                    │         │                  │                │
│ ProfileEvents.Names  │ Array(String) │              │                    │         │                  │                │
│ ProfileEvents.Values │ Array(UInt64) │              │                    │         │                  │                │
│ Settings.Names       │ Array(String) │              │                    │         │                  │                │
│ Settings.Values      │ Array(String) │              │                    │         │                  │                │
└──────────────────────┴───────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

35 rows in set. Elapsed: 0.002 sec. 

2.2查询日志:

clickhouse目前主要支持6种类型的日志,分别从不同的角度记录clickhouse的操作行为,所有查询日志在默认配置下是关闭的,需要在config.xml 文件中更改设置。在配置开启之后clickhouse会为每种类型的查询日志自动生成相应的系统表供查询。

1.query_log
记录了clickhouse服务中所有的已经执行的查询记录。

 <!-- Query log. Used only for queries with setting log_queries = 1. -->
    <query_log>
        <!-- What table to insert data. If table is not exist, it will be created.
             When query log structure is changed after system update,
              then old table will be renamed and new table will be created automatically.
        -->
        <database>s若ystem</database>
        <table>query_log</table>
        <!--
            PARTITION BY expr https://clickhouse.yandex/docs/en/table_engines/custom_partitioning_key/
            Example:
                event_date
                toMonday(event_date)
                toYYYYMM(event_date)
                toStartOfHour(event_time)
        -->
        <partition_by>toYYYYMM(event_date)</partition_by>

        <!-- Instead of partition_by, you can provide full engine expression (starting with ENGINE = ) with parameters,
             Example: <engine>ENGINE = MergeTree PARTITION BY toYYYYMM(event_date) ORDER BY (event_date, event_time) SETTINGS index_granularity = 1024</engine>
          -->

        <!-- Interval of flushing data. -->
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
    </query_log>
说明:

若要为某个用户单独开启query_log 可以在user.xml文件的profile配置中设置:
 <log_queties>1</log_queries>

query_log 相关的字段:
Clickhouse> desc system.query_log;

DESCRIBE TABLE system.query_log

┌─name─────────────────┬─type───────────────────────────────────────────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ type                 │ Enum8('QueryStart' = 1, 'QueryFinish' = 2, 'ExceptionBeforeStart' = 3, 'ExceptionWhileProcessing' = 4) │              │                    │         │                  │                │
│ event_date           │ Date                                                                                                   │              │                    │         │                  │                │
│ event_time           │ DateTime                                                                                               │              │                    │         │                  │                │
│ query_start_time     │ DateTime                                                                                               │              │                    │         │                  │                │
│ query_duration_ms    │ UInt64                                                                                                 │              │                    │         │                  │                │
│ read_rows            │ UInt64                                                                                                 │              │                    │         │                  │                │
│ read_bytes           │ UInt64                                                                                                 │              │                    │         │                  │                │
│ written_rows         │ UInt64                                                                                                 │              │                    │         │                  │                │
│ written_bytes        │ UInt64                                                                                                 │              │                    │         │                  │                │
│ result_rows          │ UInt64                                                                                                 │              │                    │         │                  │                │
│ result_bytes         │ UInt64                                                                                                 │              │                    │         │                  │                │
│ memory_usage         │ UInt64                                                                                                 │              │                    │         │                  │                │
│ query                │ String                                                                                                 │              │                    │         │                  │                │
│ exception_code       │ Int32                                                                                                  │              │                    │         │                  │                │
│ exception            │ String                                                                                                 │              │                    │         │                  │                │
│ stack_trace          │ String                                                                                                 │              │                    │         │                  │                │
│ is_initial_query     │ UInt8                                                                                                  │              │                    │         │                  │                │
│ user                 │ String                                                                                                 │              │                    │         │                  │                │
│ query_id             │ String                                                                                                 │              │                    │         │                  │                │
│ address              │ IPv6                                                                                                   │              │                    │         │                  │                │
│ port                 │ UInt16                                                                                                 │              │                    │         │                  │                │
│ initial_user         │ String                                                                                                 │              │                    │         │                  │                │
│ initial_query_id     │ String                                                                                                 │              │                    │         │                  │                │
│ initial_address      │ IPv6                                                                                                   │              │                    │         │                  │                │
│ initial_port         │ UInt16                                                                                                 │              │                    │         │                  │                │
│ interface            │ UInt8                                                                                                  │              │                    │         │                  │                │
│ os_user              │ String                                                                                                 │              │                    │         │                  │                │
│ client_hostname      │ String                                                                                                 │              │                    │         │                  │                │
│ client_name          │ String                                                                                                 │              │                    │         │                  │                │
│ client_revision      │ UInt32                                                                                                 │              │                    │         │                  │                │
│ client_version_major │ UInt32                                                                                                 │              │                    │         │                  │                │
│ client_version_minor │ UInt32                                                                                                 │              │                    │         │                  │                │
│ client_version_patch │ UInt32                                                                                                 │              │                    │         │                  │                │
│ http_method          │ UInt8                                                                                                  │              │                    │         │                  │                │
│ http_user_agent      │ String                                                                                                 │              │                    │         │                  │                │
│ quota_key            │ String                                                                                                 │              │                    │         │                  │                │
│ revision             │ UInt32                                                                                                 │              │                    │         │                  │                │
│ thread_ids           │ Array(UInt64)                                                                                          │              │                    │         │                  │                │
│ ProfileEvents.Names  │ Array(String)                                                                                          │              │                    │         │                  │                │
│ ProfileEvents.Values │ Array(UInt64)                                                                                          │              │                    │         │                  │                │
│ Settings.Names       │ Array(String)                                                                                          │              │                    │         │                  │                │
│ Settings.Values      │ Array(String)                                                                                          │              │                    │         │                  │                │
└──────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

42 rows in set. Elapsed: 0.002 sec. 



2.query_thread_log
记录了线程的执行查询的信息:

配置信息:
<!-- Query thread log. Has information about all threads participated in query execution.
         Used only for queries with setting log_query_threads = 1. -->
    <query_thread_log>
        <database>system</database>
        <table>query_thread_log</table>
        <partition_by>toYYYYMM(event_date)</partition_by>
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
    </query_thread_log>

相关的字段和记录的信息:
Clickhouse> desc system.query_thread_log;

DESCRIBE TABLE system.query_thread_log

┌─name─────────────────┬─type──────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ event_date           │ Date          │              │                    │         │                  │                │
│ event_time           │ DateTime      │              │                    │         │                  │                │
│ query_start_time     │ DateTime      │              │                    │         │                  │                │
│ query_duration_ms    │ UInt64        │              │                    │         │                  │                │
│ read_rows            │ UInt64        │              │                    │         │                  │                │
│ read_bytes           │ UInt64        │              │                    │         │                  │                │
│ written_rows         │ UInt64        │              │                    │         │                  │                │
│ written_bytes        │ UInt64        │              │                    │         │                  │                │
│ memory_usage         │ Int64         │              │                    │         │                  │                │
│ peak_memory_usage    │ Int64         │              │                    │         │                  │                │
│ thread_name          │ String        │              │                    │         │                  │                │
│ thread_id            │ UInt64        │              │                    │         │                  │                │
│ master_thread_id     │ UInt64        │              │                    │         │                  │                │
│ query                │ String        │              │                    │         │                  │                │
│ is_initial_query     │ UInt8         │              │                    │         │                  │                │
│ user                 │ String        │              │                    │         │                  │                │
│ query_id             │ String        │              │                    │         │                  │                │
│ address              │ IPv6          │              │                    │         │                  │                │
│ port                 │ UInt16        │              │                    │         │                  │                │
│ initial_user         │ String        │              │                    │         │                  │                │
│ initial_query_id     │ String        │              │                    │         │                  │                │
│ initial_address      │ IPv6          │              │                    │         │                  │                │
│ initial_port         │ UInt16        │              │                    │         │                  │                │
│ interface            │ UInt8         │              │                    │         │                  │                │
│ os_user              │ String        │              │                    │         │                  │                │
│ client_hostname      │ String        │              │                    │         │                  │                │
│ client_name          │ String        │              │                    │         │                  │                │
│ client_revision      │ UInt32        │              │                    │         │                  │                │
│ client_version_major │ UInt32        │              │                    │         │                  │                │
│ client_version_minor │ UInt32        │              │                    │         │                  │                │
│ client_version_patch │ UInt32        │              │                    │         │                  │                │
│ http_method          │ UInt8         │              │                    │         │                  │                │
│ http_user_agent      │ String        │              │                    │         │                  │                │
│ quota_key            │ String        │              │                    │         │                  │                │
│ revision             │ UInt32        │              │                    │         │                  │                │
│ ProfileEvents.Names  │ Array(String) │              │                    │         │                  │                │
│ ProfileEvents.Values │ Array(UInt64) │              │                    │         │                  │                │
└──────────────────────┴───────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

37 rows in set. Elapsed: 0.001 sec. 

3.part_log
记录了MergeTree系列表引擎的分区操作日志。默认关闭。
<!-- Uncomment if use part log.
         Part log contains information about all actions with parts in MergeTree tables (creation, deletion, merges, downloads).
     -->
    <part_log>
        <database>system</database>
        <table>part_log</table>
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
    </part_log>
Clickhouse> desc system.part_log;

DESCRIBE TABLE system.part_log

┌─name───────────────┬─type───────────────────────────────────────────────────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ event_type         │ Enum8('NewPart' = 1, 'MergeParts' = 2, 'DownloadPart' = 3, 'RemovePart' = 4, 'MutatePart' = 5, 'MovePart' = 6) │              │                    │         │                  │                │
│ event_date         │ Date                                                                                                           │              │                    │         │                  │                │
│ event_time         │ DateTime                                                                                                       │              │                    │         │                  │                │
│ duration_ms        │ UInt64                                                                                                         │              │                    │         │                  │                │
│ database           │ String                                                                                                         │              │                    │         │                  │                │
│ table              │ String                                                                                                         │              │                    │         │                  │                │
│ part_name          │ String                                                                                                         │              │                    │         │                  │                │
│ partition_id       │ String                                                                                                         │              │                    │         │                  │                │
│ path_on_disk       │ String                                                                                                         │              │                    │         │                  │                │
│ rows               │ UInt64                                                                                                         │              │                    │         │                  │                │
│ size_in_bytes      │ UInt64                                                                                                         │              │                    │         │                  │                │
│ merged_from        │ Array(String)                                                                                                  │              │                    │         │                  │                │
│ bytes_uncompressed │ UInt64                                                                                                         │              │                    │         │                  │                │
│ read_rows          │ UInt64                                                                                                         │              │                    │         │                  │                │
│ read_bytes         │ UInt64                                                                                                         │              │                    │         │                  │                │
│ peak_memory_usage  │ UInt64                                                                                                         │              │                    │         │                  │                │
│ error              │ UInt16                                                                                                         │              │                    │         │                  │                │
│ exception          │ String                                                                                                         │              │                    │         │                  │                │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

18 rows in set. Elapsed: 0.002 sec. 

4.text_log
记录了clickhouse运行过程中产生的一系列打印日志,包括INFO,DEBUG TRACE级别等。默认关闭的。
 <!-- Uncomment to write text log into table.
         Text log contains all information from usual server log but stores it in structured and efficient way.
         The level of the messages that goes to the table can be limited (<level>), if not specified all messages will go to the table.
     -->
    <text_log>
        <database>system</database>
        <table>text_log</table>
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
        <level></level>
    </text_log>
    


5.metric_log
metric 日志用于将system.metrics 和system.events 中的数据汇聚到一起。

<!-- Metric log contains rows with current values of ProfileEvents, CurrentMetrics collected with "collect_interval_milliseconds" interval. -->
    <metric_log>
        <database>system</database>
        <table>metric_log</table>
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
        <collect_interval_milliseconds>1000</collect_interval_milliseconds>
    </metric_log>

collect_interval_milliseconds 表示收集metrics 和events数据的时间周期。

Clickhouse> desc metric_log;

DESCRIBE TABLE metric_log

┌─name────────────────────────────────────────────────────────────┬─type─────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ event_date                                                      │ Date     │              │                    │         │                  │                │
│ event_time                                                      │ DateTime │              │                    │         │                  │                │
│ milliseconds                                                    │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_Query                                              │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_SelectQuery                                        │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_InsertQuery                                        │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_FailedQuery                                        │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_FailedSelectQuery                                  │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_FailedInsertQuery                                  │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_FileOpen                                           │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_Seek                                               │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_ReadBufferFromFileDescriptorRead                   │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_ReadBufferFromFileDescriptorReadFailed             │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_ReadBufferFromFileDescriptorReadBytes              │ UInt64   │              │                    │         │                  │                │
│ ProfileEvent_WriteBufferFromFileDescriptorWrite                 │ UInt64   │              │                    │         │                  │                │
.............

信息相当丰富,字段达到235个之多。

6.trace_log:
记录查询分析优化器的追踪信息。
<!-- Trace log. Stores stack traces collected by query profilers.
         See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings. -->
    <trace_log>
        <database>system</database>
        <table>trace_log</table>

        <partition_by>toYYYYMM(event_date)</partition_by>
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>
    </trace_log>

Clickhouse> desc trace_log;

DESCRIBE TABLE trace_log

┌─name─────────┬─type───────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ event_date   │ Date                                       │              │                    │         │                  │                │
│ event_time   │ DateTime                                   │              │                    │         │                  │                │
│ timestamp_ns │ UInt64                                     │              │                    │         │                  │                │
│ revision     │ UInt32                                     │              │                    │         │                  │                │
│ trace_type   │ Enum8('Real' = 0, 'CPU' = 1, 'Memory' = 2) │              │                    │         │                  │                │
│ thread_id    │ UInt64                                     │              │                    │         │                  │                │
│ query_id     │ String                                     │              │                    │         │                  │                │
│ trace        │ Array(UInt64)                              │              │                    │         │                  │                │
│ size         │ UInt64                                     │              │                    │         │                  │                │
└──────────────┴────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

9 rows in set. Elapsed: 0.002 sec. 

 3.日志:

Clickhouse> use system;

USE system

Ok.

0 rows in set. Elapsed: 0.001 sec. 

Clickhouse> show tables like '%log%';

SHOW TABLES LIKE '%log%'

┌─name─────────────┐
│ metric_log       │
│ metric_log_0     │
│ part_log         │
│ query_log        │
│ query_thread_log │
│ text_log         │
│ trace_log        │
└──────────────────┘

7 rows in set. Elapsed: 0.002 sec. 


可以看到在clickhouse20.5版本中除了 part_log 和text_log其他的日志信息已经默认开启了。

Clickhouse提供了命令:clickhouse-report


# clickhouse-report  > report.txt
+ tail -n200 /var/log/clickhouse-server/clickhouse-server.err.log
+ tail -n200 /var/log/clickhouse-server/clickhouse-server.log
+ tail -n100 /var/log/clickhouse-server/stderr.log
+ clickhouse-client -q 'SELECT * FROM system.events FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.metrics FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.asynchronous_metrics FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.build_options FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.processes FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.merges FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.parts FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.replication_queue FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.replicas FORMAT PrettyCompactNoEscapes'
+ clickhouse-client -q 'SELECT * FROM system.dictionaries FORMAT PrettyCompactNoEscapes'


可以看到会查看最近200行的错误日志信息和100行的标准输出日志信息。

此外还查询了系统的表:
events 
metrics 
asynchronous_metrics 
build_options 
processes 
merges 
parts 
replication_queue 
replicas 
dictionaries 

 

参考:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值