首页 > 其他分享 >clickhuose config.xml文件

clickhuose config.xml文件

时间:2024-05-10 15:55:46浏览次数:15  
标签:xml log clickhuose config system server var true clickhouse

<?xml version="1.0"?>
<yandex>
    <logger>
        <level>trace</level>
        <log>/var/log/clickhouse-server/clickhouse-server.log</log>    <!-- 日志存放目录 -->
        <errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>  <!-- 错误日志存放目录 -->
        <size>1000M</size>   <!-- 文件的大小。文件达到大小后,ClickHouse将对其进行存档并重命名,并在其位置创建一个新的日志文件 -->
        <count>10</count>  <!--  ClickHouse存储的已归档日志文件的数量 -->
    </logger>
    <http_port>8123</http_port> <!-- 通过HTTP连接到服务器的端口 -->
    <tcp_port>9000</tcp_port>  <!--通过TCP协议与客户端进行通信的端口,即ClickHouse端口。-->
    <mysql_port>9004</mysql_port>  <!--通过MySQL协议与客户端通信的端口。-->
    <https_port>8443</https_port>   <!-- 通过HTTP连接到服务器的端口 -->
    <tcp_port_secure>9440</tcp_port_secure>  <!--通过TCP协议与客户端进行通信的端口,即ClickHouse端口。 与OpenSSL设置一起使用。-->
    <openSSL>
        <server>
            <certificateFile>/etc/clickhouse-server/server.crt</certificateFile>  <!--PEM格式的客户端/服务器证书文件的路径。如果privateKeyFile包含证书,则可以忽略它-->
            <privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile>  <!--具有PEM证书的秘密密钥的文件的路径。该文件可能同时包含密钥和证书-->
            <dhParamsFile>/etc/clickhouse-server/dhparam.pem</dhParamsFile> <!--dh文件路径-->
            <verificationMode>none</verificationMode> <!--检查节点证书的方法-->
            <loadDefaultCAFile>true</loadDefaultCAFile> <!--指示将使用OpenSSL的内置CA证书。可接受的值:true,false-->
            <cacheSessions>true</cacheSessions>  <!--启用或禁用缓存会话。必须与sessionIdContext结合使用。可接受的值:true,false。-->
            <disableProtocols>sslv2,sslv3</disableProtocols>  <!--不允许使用的协议-->
            <preferServerCiphers>true</preferServerCiphers>  <!--首选服务器密码-->
        </server>
 
        <client>
            <loadDefaultCAFile>true</loadDefaultCAFile> <!--指示将使用OpenSSL的内置CA证书。可接受的值:true,false-->
            <cacheSessions>true</cacheSessions> <!--启用或禁用缓存会话。必须与sessionIdContext结合使用。可接受的值:true,false。-->
            <disableProtocols>sslv2,sslv3</disableProtocols>  <!--不允许使用的协议-->
            <preferServerCiphers>true</preferServerCiphers> <!--首选服务器密码-->
            <invalidCertificateHandler>  <!--用于验证无效证书的类-->
                <name>RejectCertificateHandler</name>
            </invalidCertificateHandler>
        </client>
    </openSSL>
 
    <interserver_http_port>9009</interserver_http_port>  <!--于在ClickHouse服务器之间交换数据的端口。-->
 
    <listen_host>0.0.0.0</listen_host>  <!--限制来源主机的请求  允许所有-->
    <!-- <listen_host>127.0.0.1</listen_host> --> <!--限制来源主机的请求 只允许本机访问--> 
 
    <max_connections>4096</max_connections>  <!--最大连接数-->
    <keep_alive_timeout>3</keep_alive_timeout>  <!--ClickHouse在关闭连接之前等待传入请求的秒数。 默认为3秒。-->
 
    <max_concurrent_queries>100</max_concurrent_queries>  <!--同时处理的最大请求数。-->
 
    <max_open_files>262144</max_open_files> <!--打开最大的文件数,默认最大值-->
 
    <uncompressed_cache_size>8589934592</uncompressed_cache_size>  <!--表引擎从MergeTree使用的未压缩数据的缓存大小(以字节为单位,8G)-->
     
    <mark_cache_size>5368709120</mark_cache_size>  <!--标记缓存的大小,用于MergeTree系列的表中(以字节为单位,5G)-->
 
    <path>/var/lib/clickhouse/</path>  <!--数据的目录路径-->
     
    <storage_configuration>   <!--多个存储路径-->     
        <disks>
            <disk_name_a> <!--自定义磁盘名称 -->
                <path>/var/lib/clickhouse1/</path>  <!--必填项,用于指定磁盘路径 -->
                <keep_free_space_bytes>1073741824</keep_free_space_bytes>  <!--选填项,以字节为单位,用于定义磁盘的预留空间。-->
            </disk_name_a>
 
            <disk_name_b>
                <path>/var/lib/clickhouse2/</path>  <!--必填项,用于指定磁盘路径 -->
                <keep_free_space_bytes>1073741824</keep_free_space_bytes>  <!--选填项,以字节为单位,用于定义磁盘的预留空间。-->
            </disk_name_b>
        </disks>
    </storage_configuration> 
 
    <tmp_path>/var/lib/clickhouse/tmp/</tmp_path>  <!--用于处理大型查询的临时数据的路径。-->
 
    <tmp_policy>tmp</tmp_policy>  <!--用于存储临时文件。如果未设置,则使用tmp_path,否则将忽略它。-->
 
    <user_files_path>/var/lib/clickhouse/user_files/</user_files_path>  <!--存储用户文件的目录-->
 
    <users_config>users.xml</users_config>  <!--用户配置文件,可以配置用户访问、profiles、quota、查询等级等-->
 
    <default_profile>default</default_profile> <!--默认设置配置文件-->
 
 
    <default_database>default</default_database>  <!--默认数据库-->
 
    <timezone>Europe/Moscow</timezone>  <!--服务器的时区,定为UTC时区或地理位置  莫斯科时间-->
 
    <!-- <umask>022</umask> -->
     
    <mlock_executable>false</mlock_executable>
 
    <include_from>/etc/metrica.xml</include_from>  <!--带替换文件的路径-->
     
    <zookeeper incl="zookeeper-servers" optional="true" />  <!--ClickHouse与ZooKeeper群集进行交互的设置-->
 
    <macros incl="macros" optional="true" />  <!--复制表的参数替换,如果不使用复制表,则可以省略-->
 
    <builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>  <!--重新加载内置词典的时间间隔(以秒为单位),默认3600。可以在不重新启动服务器的情况下“即时”修改词典-->
 
    <max_session_timeout>3600</max_session_timeout>  <!-- 最大会话超时时间  单位秒-->
 
    <default_session_timeout>60</default_session_timeout>  <!--默认会话超时时间  单位秒-->
 
    <graphite>   <!--将数据发送到Graphite,它是一款企业级监控。-->
        <host>localhost</host>  <!--Graphite服务器-->
        <port>42000</port>  <!--Graphite服务器上的端口-->
        <timeout>0.1</timeout>  <!--发送超时时间,以秒为单位-->
        <interval>60</interval>  <!--发送间隔,以秒为单位-->
        <root_path>one_min</root_path>  <!--密钥的前缀-->
        <hostname_in_path>true</hostname_in_path>  <!--讲机名追加到根路径(默认= true)-->
 
        <metrics>true</metrics>  <!--从system.metrics表发送数据-->
        <events>true</events>  <!--从system.events表发送在该时间段内累积的增量数据-->
        <events_cumulative>false</events_cumulative>  <!--从system.events表发送累积数据-->
        <asynchronous_metrics>true</asynchronous_metrics>  <!--从system.asynchronous_metrics表发送数据-->
    </graphite>
    
    <query_log>  <!--通过log_queries = 1 在用户配置表中设置,记录了ClickHouse服务中所有已经执行的查询记录。查询记录在system.query_log表中-->
        <database>system</database>  <!--库名-->
        <table>query_log</table>  <!--表名-->
        <partition_by>toYYYYMM(event_date)</partition_by>  <!--自定义分区键-->
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>  <!--将数据从内存中的缓冲区刷新到表的时间间隔-->
    </query_log>
 
    <trace_log>  <!--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>
 
    <query_thread_log>  <!--使用log_query_threads = 1设置,在用户配置表中设置 记录了所有线程的执行查询的信息-->
        <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>
 
    <part_log>  <!--记录了MergeTree系列表引擎的分区操作日志。如添加或合并数据-->
        <database>system</database>  <!--库名-->
        <table>part_log</table>  <!--表名-->
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>  <!--将数据从内存中的缓冲区刷新到表的时间间隔-->
    </part_log>
 
    <text_log>  <!--log日志记录了ClickHouse运行过程中产生的一系列打印日志,包括INFO、DEBUG和Trace-->
        <database>system</database>   <!--库名-->
        <table>text_log</table>  <!--表名-->
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>  <!--将数据从内存中的缓冲区刷新到表的时间间隔-->
        <level></level>
    </text_log>
 
    <metric_log> <!--用于将system.metrics和system.events中的数据汇聚到一起-->
        <database>system</database>   <!--库名-->
        <table>metric_log</table>  <!--表名-->
        <flush_interval_milliseconds>7500</flush_interval_milliseconds>  <!--将数据从内存中的缓冲区刷新到表的时间间隔-->
        <collect_interval_milliseconds>1000</collect_interval_milliseconds>  <!--收集间隔-->
    </metric_log>
 
    <dictionaries_config>*_dictionary.xml</dictionaries_config>  <!--外部词典的配置文件的路径,在config配置文件中指定。路径可以包含通配符*和?的绝对或则相对路径-->
 
    <compression incl="clickhouse_compression">  <!--MergeTree引擎表的数据压缩设置。配置模板如-->
        <case>
            <min_part_size>10000000000</min_part_size>        <!-- 数据部分的最小大小 -->
            <min_part_size_ratio>0.01</min_part_size_ratio>   <!-- 数据部分大小与表大小的比率 -->
            <method>LZ4</method>  <!--压缩算法,zstd和lz4-->
        </case>
 
    </compression>
 
    <distributed_ddl>  <!--分布式ddl配置 create drop alter -->
        <path>/clickhouse/task_queue/ddl</path>  <!--分布式DDL在ZooKeeper内使用的根路径为-->
    </distributed_ddl>
 
    <max_table_size_to_drop>0</max_table_size_to_drop>  <!--删除表的限制,默认50G,0表示不限制。如果MergeTree表的大小超过max_table_size_to_drop(以字节为单位),则无法使用DROP查询将其删除-->
    <max_partition_size_to_drop>0</max_partition_size_to_drop>  <!--删除分区限制 默认50G,0表示不限制-->
 
    <format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>  <!--包含输入格式文件的目录路径-->
 
 
    <query_masking_rules>  <!--基于Regexp的规则,应用于查询以及所有日志消息。再其存储在服务器日志中,system.query_log,system.text_log,system.processes表以及以日志形式发送给客户端。这样可以防止SQL查询中的敏感数据泄漏记录到日志中-->
        <rule>
            <name>hide SSN</name>  <!--规则名称-->
            <regexp>\b\d{3}-\d{2}-\d{4}\b</regexp>  <!--正则表达式-->
            <replace>000-00-0000</replace>  <!--替换,敏感数据的替换字符串(默认为可选-六个星号)-->
        </rule>
    </query_masking_rules>
     
    <disable_internal_dns_cache>1</disable_internal_dns_cache>  <!--禁用内部DNS缓存,默认0-->
</yandex>

转载:https://www.cnblogs.com/yoyo1216/p/13731225.html

标签:xml,log,clickhuose,config,system,server,var,true,clickhouse
From: https://www.cnblogs.com/xxsdnol/p/18184546

相关文章

  • Xml和Json在线互转工具
    1、支持将Xml数据转为Json字符串格式2、支持将Json字符串转换为Xml格式的数据3、Json转为Xml数据时,提供自动检测Json格式是否正确,确保转换的Xml数据是准确的4、提供详细的Xml数据和Json字符串数据5、提供示例xml和json示例,供大家测试使用免费使用工具地址:http://tools.linu......
  • XML Schema(XSD)详解:定义 XML 文档结构合法性的完整指南
    XMLSchema描述了XML文档的结构。XMLSchema语言也称为XMLSchemaDefinition(XSD)。 <?xmlversion="1.0"?> <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema">   <xs:elementname="note"> <xs:compl......
  • XML Schema(XSD)详解:定义 XML 文档结构合法性的完整指南
    XMLSchema描述了XML文档的结构。XMLSchema语言也称为XMLSchemaDefinition(XSD)。<?xmlversion="1.0"?><xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:elementname="note"><xs:complexType><x......
  • configure,make和make install关系
    一.参考网址1. configure、make、makeinstall背后的原理(翻译)2. configure,make和makeinstall关系3. Linux:configuremake、makeinstall ......
  • dbt on_configuration_change 简单说明
    dbton_configuration_change目前主要是在处理物化视图中,on_configuration_change包含了三类设置参考设置apply是默认参数,尝试进行更新存在的数据库对象continue允许继续运行,但是提供一个警告fail如果捕捉到变动就失败参考使用比如模型上的{{config(......
  • 代理 mitmproxy config.yaml 模板 使用笔记(二)
    代理mitmproxyconfig.yaml模板使用笔记(二)mitmproxyconfig.yaml模板使用mitmproxy可能需要用到config.yaml来批量配置参数目录config.yaml文件所在位置config.yaml配置模板文件位置配置文件默认读取路径:~/.mitmproxy/config.yaml,见配置项:confdir:'~/.mitmpro......
  • applicationContext.xml
    我真服了,搜了半天没有我想看见的就是关于取代mybatis.xml的文件只能自己写一个了并不能完全取代,至少日志部分还得保留1<?xmlversion="1.0"encoding="UTF-8"?>2<beansxmlns="http://www.springframework.org/schema/beans"3xmlns:xsi="http://www.w3.org/2......
  • 解决vscode连接远程服务器出现Bad owner or permissions on C:\\Users\\Administr
    1.找到.ssh文件夹。它通常位于C:\Users2.右键单击.ssh文件夹,然后单击“属性”,选择“安全”3.单击“高级”。单击“禁用继承”,单击“确定”。将出现警告弹出窗口。单击“从此对象中删除所有继承的权限”。4.此时所有用户都将被删除。添加所有者。在同一窗口中,单击“编辑”按......
  • Field registration in org.springframework.cloud.client.serviceregistry.ServiceRe
    Fieldregistrationinorg.springframework.cloud.client.serviceregistry.ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfigurationrequiredasinglebean,but2werefound: -nacosRegistration:definedbymethod'nacosRegistration'in......
  • 前端 Vue webpack配置之 webpack.config.js 文件配置
     Webpack在执行的时候,除了在命令行传入参数,还可以通过指定的配置文件来执行。默认情况下,会搜索当前目录的 webpack.config.js 文件,这个文件是一个node.js模块,返回一个json格式的配置信息对象,或者通过 --config 选项来指定配置文件。.输入命令:webpack,即可按照webpack.c......