Altinity / clickhouse-operator

Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse® clusters running on Kubernetes
https://altinity.com
Apache License 2.0
1.93k stars 463 forks source link

Documentation for external dictionaries configuration seems wrong #771

Open jordan-thoms opened 3 years ago

jordan-thoms commented 3 years ago

Hi

In https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md and https://github.com/Altinity/clickhouse-operator/blob/master/docs/chi-examples/05-settings-02-dictionary.yaml, the example names the config file as 'dict_one.dict'. However, when I do that I get an error like:

2021.09.06 05:09:44.070638 [ 223 ] {} <Error> ExternalDictionariesLoader: Failed to load config file '/etc/clickhouse-server/config.d/geo_ip.dict': Code: 347, e.displayText() = DB::Exception: Unknown format of '/etc/clickhouse-server/config.d/geo_ip.dict' config, Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8f9a2ba in /usr/bin/clickhouse
1. DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x903e6c3 in /usr/bin/clickhouse
2. DB::ConfigProcessor::processConfig(bool*, zkutil::ZooKeeperNodeCache*, std::__1::shared_ptr<Poco::Event> const&) @ 0x1139dfbf in /usr/bin/clickhouse
3. DB::ConfigProcessor::loadConfig(bool) @ 0x1139fe92 in /usr/bin/clickhouse
4. DB::ExternalLoaderXMLConfigRepository::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x101111e7 in /usr/bin/clickhouse

I had a look at that code, and it looks like .dict is not an allowed extension for the config files: https://clickhouse.tech/codebrowser/html_report///ClickHouse/src/Common/Config/ConfigProcessor.cpp.html#_ZN2DB15ConfigProcessor13processConfigEPbPN6zkutil18ZooKeeperNodeCacheERKNSt3__110shared_ptrIN4Poco5EventEEE

I changed the extension to .conf and it loaded properly. Can the example be updated to fix this?

alex-zaitsev commented 2 years ago

@UnamedRus , could you please check and fix the documentation.

UnamedRus commented 2 years ago

Looks like this restriction was added with support for yaml configs

https://github.com/ClickHouse/ClickHouse/pull/21858/files#diff-be8543b10bc4c2ccfeb38691976ffe53ebd8b905dc44f4fa1f440c9f24ec372cL461