Skip to content

Instantly share code, notes, and snippets.

@pcn
Created September 23, 2019 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcn/875e32fb2a9c9748b07cf4b2c945dc76 to your computer and use it in GitHub Desktop.
Save pcn/875e32fb2a9c9748b07cf4b2c945dc76 to your computer and use it in GitHub Desktop.
Why would this:
```
# This could be expanded into another function to allow for
# reconfiguring more of the clickhouse_config_settings if we find we need
# it in the future.
def config_bg_pool_size(size=2):
"""When replacing a clickhouse node, we want to reduce the background
pool size, because at the default of 8, it'll max out the
resources on its peer nodes as it replicates data to itself.
This changes that size, and re-runs the config with the background pool size set
to the :size: argument.
To restore this, you can just run :state.sls clickhouse.config:, or run this
module with the size set to the normal value.
"""
config_key = 'clickhouse_profiles:default'
new_pillar = { config_key: __salt__['pillar.get'](config_key, {})}
new_pillar[config_key]['background_pool_size'] = size
log.debug("Running state.sls with clickhouse.config, using pillar data: {}".format(new_pillar))
state_result = __salt__['state.sls']('clickhouse.config', pillar=new_pillar)
return state_result
```
Not modify the background pool size appropriate in 2019.2.0?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment