clickhouse建表时出现以下异常:
DB::Exception: No macro 'uuid' in config while processing substitutions in '/clickhouse/tables/{uuid}/{shard}' at '20' or macro is not supported here (version 20.8.3.18)
DB::Exception: No macro ‘uuid’ in config while processing substitutions in ‘/clickhouse/tables/{uuid}/{shard}’ at ‘20’ or macro is not supported here (version 20.8.3.18)
在替换/clickhouse/tables/{uuid}/{shard}中的uuid时未找到定义的uuid的宏变量,或者宏变量不支持。
使用大括号表示会从配置文件中获取宏定义的变量,若未添加该标签会报错。
在clickhouse的配置文件中,在每个节点服务器的文件/etc/clickhouse-server/metrika.xml或者/etc/clickhouse-server/config.xml中添加
<macros>
<shard_name>01</shard_name>
<replica>clickhouse01</replica>
</macros>