if we use some root squashed volume mappings in docker
uid=0 is actually uid=nobody
thus FS operations with uid=0 will fail miserably
and overall it's a strange idea to create dirs under root when
DO_NOT_CHOWN is in effect...
We build clickhouse cluster in k8s by clickhouse-operator.
clickhouse-server.log is mounted by emptydir on the path `/var/log/clickhouse-server`.
It causes the file system error called `Necessary directory '/var/log/clickhouse-server' isn't owned by user with id '101' ` when CLICKHOUSE_DO_NOT_CHOWN is set to true(1).
Because emptydir file and dir is owned by root when it started, it has to do the chown cmd.
But it will take a long time to run chown cmd when the cluster has much data (in table data dir), the cluster cannot even restart because of `initialDelaySeconds`
So chown operation is necessary to check if the file owner and group is owned by user 101.
`http_port` can be removed from the configuration when serving HTTP is
not desired. When it is not present, `extract-from-config` will fail,
which will prevent the server from starting.
Only fetch it when it is required for database initialization.
Fixes 'Address family not supported by protocol' for any docker-entrypoint-initdb.d script.
wget uses 'localhost' which resolves for both ipv4 and ipv6 with current config (/etc/hosts) and so the wget fails _(Address family not supported by protocol)_ and does not retry.
Forcing it to use IPv4 fixes the issue