Move all yaml tests to clickhouse config

This commit is contained in:
alesapin 2021-09-23 11:08:40 +03:00
parent 3bea8d5201
commit d1bb8d666e
38 changed files with 94 additions and 93 deletions

View File

@ -2,6 +2,6 @@ user_directories:
users_xml: users_xml:
path: users.xml path: users.xml
local_directory: local_directory:
path: access/ path: /var/lib/clickhouse/access/
"@replace": replace "@replace": replace

View File

@ -1,18 +1,18 @@
path: path:
- ./ - /var/lib/clickhouse
- "@replace": replace - "@replace": replace
tmp_path: tmp_path:
- ./tmp/ - /var/lib/clickhouse/tmp/
- "@replace": replace - "@replace": replace
user_files_path: user_files_path:
- ./user_files/ - /var/lib/clickhouse/user_files/
- "@replace": replace - "@replace": replace
format_schema_path: format_schema_path:
- ./format_schemas/ - /var/lib/clickhouse/format_schemas/
- "@replace": replace - "@replace": replace
access_control_path: access_control_path:
- ./access/ - /var/lib/clickhouse/access/
- "@replace": replace - "@replace": replace
top_level_domains_path: top_level_domains_path:
- ./top_level_domains/ - /var/lib/clickhouse/top_level_domains/
- "@replace": replace - "@replace": replace

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<yandex> <clickhouse>
<logger> <logger>
<level>trace</level> <level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log> <log>/var/log/clickhouse-server/clickhouse-server.log</log>
@ -64,10 +64,10 @@
<mmap_cache_size>1000</mmap_cache_size> <mmap_cache_size>1000</mmap_cache_size>
<path>/var/lib/clickhouse/</path> <path>./</path>
<tmp_path>/var/lib/clickhouse/tmp/</tmp_path> <tmp_path>./tmp/</tmp_path>
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path> <user_files_path>./user_files/</user_files_path>
<ldap_servers> <ldap_servers>
</ldap_servers> </ldap_servers>
<user_directories> <user_directories>
@ -274,4 +274,4 @@
<anonymize>false</anonymize> <anonymize>false</anonymize>
<endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint> <endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
</send_crash_reports> </send_crash_reports>
</yandex> </clickhouse>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Config that is used when server is run without config file. --> <!-- Config that is used when server is run without config file. -->
<yandex> <clickhouse>
<logger> <logger>
<level>trace</level> <level>trace</level>
<console>true</console> <console>true</console>
@ -37,4 +37,4 @@
<quotas> <quotas>
<default /> <default />
</quotas> </quotas>
</yandex> </clickhouse>

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<yandex> <clickhouse>
<profiles> <profiles>
<default> <default>
<max_memory_usage>10000000000</max_memory_usage> <max_memory_usage>10000000000</max_memory_usage>
@ -16,4 +16,4 @@
<profile>default</profile> <profile>default</profile>
</default> </default>
</users> </users>
</yandex> </clickhouse>

View File

@ -32,7 +32,7 @@ def test_xml_main_conf():
all_userd = ['configs/users.d/allow_introspection_functions.yaml', all_userd = ['configs/users.d/allow_introspection_functions.yaml',
'configs/users.d/log_queries.yaml'] 'configs/users.d/log_queries.yaml']
node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd, with_zookeeper=False) node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd, with_zookeeper=False, config_root_name='clickhouse')
try: try:
cluster.start() cluster.start()

View File

@ -2,6 +2,6 @@ user_directories:
users_xml: users_xml:
path: users.yaml path: users.yaml
local_directory: local_directory:
path: access/ path: /var/lib/clickhouse/access/
"@replace": replace "@replace": replace

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<keeper_server> <keeper_server>
<tcp_port>9181</tcp_port> <tcp_port>9181</tcp_port>
<server_id>1</server_id> <server_id>1</server_id>
@ -20,4 +20,4 @@
</server> </server>
</raft_configuration> </raft_configuration>
</keeper_server> </keeper_server>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<logger> <logger>
<!-- Disable rotation <!-- Disable rotation
https://pocoproject.org/docs/Poco.FileChannel.html https://pocoproject.org/docs/Poco.FileChannel.html
--> -->
<size>never</size> <size>never</size>
</logger> </logger>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<metric_log> <metric_log>
<database>system</database> <database>system</database>
<table>metric_log</table> <table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds> <flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds> <collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log> </metric_log>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<part_log> <part_log>
<database>system</database> <database>system</database>
<table>part_log</table> <table>part_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds> <flush_interval_milliseconds>7500</flush_interval_milliseconds>
</part_log> </part_log>
</yandex> </clickhouse>

View File

@ -1,18 +1,18 @@
path: path:
- ./ - /var/lib/clickhouse
- "@replace": replace - "@replace": replace
tmp_path: tmp_path:
- ./tmp/ - /var/lib/clickhouse/tmp/
- "@replace": replace - "@replace": replace
user_files_path: user_files_path:
- ./user_files/ - /var/lib/clickhouse/user_files/
- "@replace": replace - "@replace": replace
format_schema_path: format_schema_path:
- ./format_schemas/ - /var/lib/clickhouse/format_schemas/
- "@replace": replace - "@replace": replace
access_control_path: access_control_path:
- ./access/ - /var/lib/clickhouse/access/
- "@replace": replace - "@replace": replace
top_level_domains_path: top_level_domains_path:
- ./top_level_domains/ - /var/lib/clickhouse/top_level_domains/
- "@replace": replace - "@replace": replace

View File

@ -1,10 +1,10 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Config for test server --> <!-- Config for test server -->
<yandex> <clickhouse>
<query_masking_rules> <query_masking_rules>
<rule> <rule>
<regexp>TOPSECRET.TOPSECRET</regexp> <regexp>TOPSECRET.TOPSECRET</regexp>
<replace>[hidden]</replace> <replace>[hidden]</replace>
</rule> </rule>
</query_masking_rules> </query_masking_rules>
</yandex> </clickhouse>

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<remote_servers> <remote_servers>
<test_cluster_with_incorrect_pw> <test_cluster_with_incorrect_pw>
<shard> <shard>
@ -18,4 +18,4 @@
</shard> </shard>
</test_cluster_with_incorrect_pw> </test_cluster_with_incorrect_pw>
</remote_servers> </remote_servers>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<zookeeper> <zookeeper>
<node index="1"> <node index="1">
<host>localhost</host> <host>localhost</host>
<port>9181</port> <port>9181</port>
</node> </node>
</zookeeper> </zookeeper>
</yandex> </clickhouse>

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<yandex> <clickhouse>
<logger> <logger>
<level>trace</level> <level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log> <log>/var/log/clickhouse-server/clickhouse-server.log</log>
@ -64,10 +64,10 @@
<mmap_cache_size>1000</mmap_cache_size> <mmap_cache_size>1000</mmap_cache_size>
<path>/var/lib/clickhouse/</path> <path>./</path>
<tmp_path>/var/lib/clickhouse/tmp/</tmp_path> <tmp_path>./tmp/</tmp_path>
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path> <user_files_path>./user_files/</user_files_path>
<ldap_servers> <ldap_servers>
</ldap_servers> </ldap_servers>
<user_directories> <user_directories>
@ -274,4 +274,4 @@
<anonymize>false</anonymize> <anonymize>false</anonymize>
<endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint> <endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
</send_crash_reports> </send_crash_reports>
</yandex> </clickhouse>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Config that is used when server is run without config file. --> <!-- Config that is used when server is run without config file. -->
<yandex> <clickhouse>
<logger> <logger>
<level>trace</level> <level>trace</level>
<console>true</console> <console>true</console>
@ -37,4 +37,4 @@
<quotas> <quotas>
<default /> <default />
</quotas> </quotas>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<yandex> <clickhouse>
<profiles> <profiles>
<default> <default>
<allow_introspection_functions>1</allow_introspection_functions> <allow_introspection_functions>1</allow_introspection_functions>
</default> </default>
</profiles> </profiles>
</yandex> </clickhouse>

View File

@ -32,7 +32,7 @@ def test_extra_yaml_mix():
'configs/users.d/log_queries.yaml'] 'configs/users.d/log_queries.yaml']
node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd, with_zookeeper=False, node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd, with_zookeeper=False,
users_config_name="users.yaml", copy_common_configs=False) users_config_name="users.yaml", copy_common_configs=False, config_root_name="clickhouse")
try: try:
cluster.start() cluster.start()

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<!-- Sources to read users, roles, access rights, profiles of settings, quotas. --> <!-- Sources to read users, roles, access rights, profiles of settings, quotas. -->
<user_directories replace="replace"> <user_directories replace="replace">
<users_xml> <users_xml>
@ -7,7 +7,7 @@
</users_xml> </users_xml>
<local_directory> <local_directory>
<!-- Path to folder where users created by SQL commands are stored. --> <!-- Path to folder where users created by SQL commands are stored. -->
<path>access/</path> <path>/var/lib/clickhouse/access/</path>
</local_directory> </local_directory>
</user_directories> </user_directories>
</yandex> </clickhouse>

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<keeper_server> <keeper_server>
<tcp_port>9181</tcp_port> <tcp_port>9181</tcp_port>
<server_id>1</server_id> <server_id>1</server_id>
@ -20,4 +20,4 @@
</server> </server>
</raft_configuration> </raft_configuration>
</keeper_server> </keeper_server>
</yandex> </clickhouse>

View File

@ -1,7 +1,7 @@
<yandex> <clickhouse>
<logger> <logger>
<console>true</console> <console>true</console>
<log remove="remove"/> <log remove="remove"/>
<errorlog remove="remove"/> <errorlog remove="remove"/>
</logger> </logger>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<logger> <logger>
<!-- Disable rotation <!-- Disable rotation
https://pocoproject.org/docs/Poco.FileChannel.html https://pocoproject.org/docs/Poco.FileChannel.html
--> -->
<size>never</size> <size>never</size>
</logger> </logger>
</yandex> </clickhouse>

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<macros> <macros>
<test>Hello, world!</test> <test>Hello, world!</test>
<shard>s1</shard> <shard>s1</shard>
@ -6,4 +6,4 @@
<default_path_test>/clickhouse/tables/{database}/{shard}/</default_path_test> <default_path_test>/clickhouse/tables/{database}/{shard}/</default_path_test>
<default_name_test>table_{table}</default_name_test> <default_name_test>table_{table}</default_name_test>
</macros> </macros>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<metric_log> <metric_log>
<database>system</database> <database>system</database>
<table>metric_log</table> <table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds> <flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds> <collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log> </metric_log>
</yandex> </clickhouse>

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<remote_servers> <remote_servers>
<![CDATA[ <![CDATA[
@ -46,4 +46,4 @@
</two_shards_one_local_one_remote_at_port_9001> </two_shards_one_local_one_remote_at_port_9001>
</remote_servers> </remote_servers>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<part_log> <part_log>
<database>system</database> <database>system</database>
<table>part_log</table> <table>part_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds> <flush_interval_milliseconds>7500</flush_interval_milliseconds>
</part_log> </part_log>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<path replace="replace">./</path> <path replace="replace">/var/lib/clickhouse</path>
<tmp_path replace="replace">./tmp/</tmp_path> <tmp_path replace="replace">/var/lib/clickhouse/tmp/</tmp_path>
<user_files_path replace="replace">./user_files/</user_files_path> <user_files_path replace="replace">/var/lib/clickhouse/user_files/</user_files_path>
<format_schema_path replace="replace">./format_schemas/</format_schema_path> <format_schema_path replace="replace">/var/lib/clickhouse/format_schemas/</format_schema_path>
<access_control_path replace="replace">./access/</access_control_path> <access_control_path replace="replace">/var/lib/clickhouse/access/</access_control_path>
<top_level_domains_path replace="replace">./top_level_domains/</top_level_domains_path> <top_level_domains_path replace="replace">/var/lib/clickhouse/top_level_domains/</top_level_domains_path>
</yandex> </clickhouse>

View File

@ -1,10 +1,10 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Config for test server --> <!-- Config for test server -->
<yandex> <clickhouse>
<query_masking_rules> <query_masking_rules>
<rule> <rule>
<regexp>TOPSECRET.TOPSECRET</regexp> <regexp>TOPSECRET.TOPSECRET</regexp>
<replace>[hidden]</replace> <replace>[hidden]</replace>
</rule> </rule>
</query_masking_rules> </query_masking_rules>
</yandex> </clickhouse>

View File

@ -1,3 +1,3 @@
<yandex> <clickhouse>
<tcp_with_proxy_port>9010</tcp_with_proxy_port> <tcp_with_proxy_port>9010</tcp_with_proxy_port>
</yandex> </clickhouse>

View File

@ -1,4 +1,4 @@
<yandex> <clickhouse>
<remote_servers> <remote_servers>
<test_cluster_with_incorrect_pw> <test_cluster_with_incorrect_pw>
<shard> <shard>
@ -18,4 +18,4 @@
</shard> </shard>
</test_cluster_with_incorrect_pw> </test_cluster_with_incorrect_pw>
</remote_servers> </remote_servers>
</yandex> </clickhouse>

View File

@ -1,7 +1,7 @@
<yandex> <clickhouse>
<text_log> <text_log>
<database>system</database> <database>system</database>
<table>text_log</table> <table>text_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds> <flush_interval_milliseconds>7500</flush_interval_milliseconds>
</text_log> </text_log>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<yandex> <clickhouse>
<zookeeper> <zookeeper>
<node index="1"> <node index="1">
<host>localhost</host> <host>localhost</host>
<port>9181</port> <port>9181</port>
</node> </node>
</zookeeper> </zookeeper>
</yandex> </clickhouse>

View File

@ -48,9 +48,9 @@ total_memory_tracker_sample_probability: 0
uncompressed_cache_size: 8589934592 uncompressed_cache_size: 8589934592
mark_cache_size: 5368709120 mark_cache_size: 5368709120
mmap_cache_size: 1000 mmap_cache_size: 1000
path: /var/lib/clickhouse/ path: ./
tmp_path: /var/lib/clickhouse/tmp/ tmp_path: ./tmp/
user_files_path: /var/lib/clickhouse/user_files/ user_files_path: ./user_files/
ldap_servers: '' ldap_servers: ''
user_directories: user_directories:
users_xml: users_xml:

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Config that is used when server is run without config file. --> <!-- Config that is used when server is run without config file. -->
<yandex> <clickhouse>
<logger> <logger>
<level>trace</level> <level>trace</level>
<console>true</console> <console>true</console>
@ -37,4 +37,4 @@
<quotas> <quotas>
<default /> <default />
</quotas> </quotas>
</yandex> </clickhouse>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<yandex> <clickhouse>
<profiles> <profiles>
<default> <default>
<allow_introspection_functions>1</allow_introspection_functions> <allow_introspection_functions>1</allow_introspection_functions>
</default> </default>
</profiles> </profiles>
</yandex> </clickhouse>

View File

@ -1,7 +1,7 @@
<yandex> <clickhouse>
<profiles> <profiles>
<default> <default>
<log_queries>1</log_queries> <log_queries>1</log_queries>
</default> </default>
</profiles> </profiles>
</yandex> </clickhouse>

View File

@ -32,7 +32,8 @@ def test_yaml_main_conf():
'configs/users.d/log_queries.xml'] 'configs/users.d/log_queries.xml']
node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd, node = cluster.add_instance('node', base_config_dir='configs', main_configs=all_confd, user_configs=all_userd,
with_zookeeper=False, main_config_name="config.yaml", users_config_name="users.yaml", copy_common_configs=False) with_zookeeper=False, main_config_name="config.yaml", users_config_name="users.yaml",
copy_common_configs=False, config_root_name="clickhouse")
try: try:
cluster.start() cluster.start()