Puppet Class: clickhouse::server

Inherits:
clickhouse
Defined in:
manifests/server.pp

Summary

Installs and configures Clickhouse server.

Overview

Examples:

Install Clickhouse Server.

class { 'clickhouse::server':
  package_name   => 'clickhouse-server',
  package_ensure => '19.1.6-1.el7',
}

Parameters:

  • package_name (String)

    Name of Clickhouse Server package to install. Defaults to ‘clickhouse-server’.

  • package_ensure (String)

    Whether the Clickhouse Server package should be present, absent or specific version. Valid values are ‘present’, ‘absent’ or ‘x.y.z’. Defaults to ‘present’.

  • manage_package (Boolean)

    Whether to manage Clickhouse Server package. Defaults to ‘true’.

  • package_install_options (Array[String])

    Array of install options for managed package resources. Appropriate options are passed to package manager.

  • manage_config (Boolean)

    Whether the Clickhouse Server configurations files should be managd. Defaults to ‘true’.

  • config_dir (Stdlib::Unixpath)

    Directory where Clickhouse Server configuration files will be stored. Defaults to ‘/etc/clickhouse-server/conf.d’.

  • datadir_mode (String)

    Permissions for data directory

  • confdir_mode (String)

    Permissions for config directory

  • users_dir (Stdlib::Unixpath)

    Directory where Clickhouse Server user configuration files will be stored. Defaults to ‘/etc/clickhouse-server/users.d’.

  • dict_dir (Stdlib::Unixpath)

    Directory where Clickhouse Server dictionaries will be stored. Defaults to ‘/etc/clickhouse-server/dict’.

  • clickhouse_datadir (Stdlib::Unixpath)

    Directory where Clickhouse Server database files will be stored. Defaults to ‘/var/lib/clickhouse/’.

  • clickhouse_tmpdir (Stdlib::Unixpath)

    Directory where Clickhouse Server tmp files will be stored. Defaults to ‘/var/lib/clickhouse/tmp/’.

  • clickhouse_user (String)

    Owner for Clickhouse Server configuration and data directories. Defaults to ‘clickhouse’.

  • clickhouse_group (String)

    Group for Clickhouse Server configuration and data directories. Defaults to ‘clickhouse’.

  • keep_default_users (Boolean)

    Specifies whether to automatically remove default users, which are specified in users.xml file. Defaults to ‘false’.

  • override_options (Hash[String, Any]) (defaults to: {})

    Hash[String, Any] of override options to pass to Clickhouse Server configuration file.

  • config_file (String)

    Name of the file, where Clickhouse Server configuration will be stored. See clickhouse.yandex/docs/en/operations/configuration_files/. Defaults to ‘config.xml’

  • profiles_file (String)

    Name of the file, where Clickhouse Server profiles configuration will be stored. See clickhouse.yandex/docs/en/operations/settings/settings_profiles/. Defaults to ‘$profiles.xml’.

  • quotas_file (String)

    Name of the file, where Clickhouse Server quotas configuration will be stored. See clickhouse.yandex/docs/en/operations/quotas/. Defaults to ‘quotas.xml’.

  • macros_file (String)

    Name of the file, where Clickhouse Server macros configuration for replication will be stored. See clickhouse.yandex/docs/en/operations/table_engines/replication/. Defaults to ‘$macros.xml’.

  • zookeeper_config_file (String)

    Name of the file, where Clickhouse Server zookeeper configuration will be stored. See clickhouse.yandex/docs/en/operations/table_engines/replication/. Defaults to ‘zookeeper.xml’.

  • remote_servers_file (String)

    Name of the file, where Clickhouse Server remote servers configuration for Distributed table engine will be stored. See clickhouse.yandex/docs/en/operations/table_engines/distributed/. Defaults to ‘remote_servers.xml’.

  • dict_source_folder (String) (defaults to: "puppet:///modules/${module_name}")

    Path to a ‘files’ folder in puppet, where dictionary file are located. Defaults to ‘puppet:///modules/$module_name’.

  • install_client (Boolean)

    Specifies whether to install Clickhouse Client package. Defaults to ‘true’.

  • service_name (String)

    Name of the Clickhouse Server service. Defaults to ‘clickhouse-server’.

  • service_ensure (Stdlib::Ensure::Service)

    Specifies whether Clickhouse Server service should be running. Defaults to ‘running’.

  • service_enabled (Boolean)

    Specifies whether Clickhouse Server service should be enabled. Defaults to ‘true’.

  • manage_service (Boolean)

    Specifies whether Clickhouse Server service should be managed. Defaults to ‘true’.

  • restart (Boolean)

    Specifies whether Clickhouse Server service should be restated when configuration changes. Defaults to ‘false’.

  • users (Optional[Clickhouse::Clickhouse_users]) (defaults to: undef)

    Users, which are passed to clickhouse::server::user (see types/clickhouse_users.pp for data type description). See clickhouse.yandex/docs/en/operations/access_rights/.

  • profiles (Optional[Hash[String, Hash[String, Any]]]) (defaults to: undef)

    Profiles configuration, which are passed to clickhouse::server::profiles. See clickhouse.yandex/docs/en/operations/settings/settings_profiles/.

  • quotas (Optional[Clickhouse::Clickhouse_quotas]) (defaults to: undef)

    Quotas configuration, which are passed to clickhouse::server::quotas. See clickhouse.yandex/docs/en/operations/quotas/.

  • dictionaries (Optional[Array[String]]) (defaults to: undef)

    Dictionaries configuration, which are passed to clickhouse::server::dictionary. See clickhouse.yandex/docs/en/query_language/dicts/external_dicts/.

  • replication (Optional[Clickhouse::Clickhouse_replication]) (defaults to: undef)

    Replication configuration parameters (see types/clickhouse_replication.pp for data type description). See clickhouse.yandex/docs/en/operations/table_engines/replication/.

  • remote_servers (Optional[Clickhouse::Clickhouse_remote_servers]) (defaults to: undef)

    Remote server configuration parameters for Distributed engine (see types/clickhouse_remote_servers.pp for data type description), which are passed to clickhouse::server::remote_servers. See clickhouse.yandex/docs/en/operations/table_engines/distributed/.

  • crash_reports (Optional[Clickhouse::Clickhouse_crash_reports]) (defaults to: undef)
  • main_dir (Stdlib::Unixpath)
  • manage_systemd (Boolean)


84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'manifests/server.pp', line 84

class clickhouse::server (
  # Server package
  String $package_name,
  String $package_ensure,
  Boolean $manage_package,
  Array[String] $package_install_options,

  # Configuration
  Boolean $manage_config,
  Stdlib::Unixpath $main_dir,
  Stdlib::Unixpath $config_dir,
  Stdlib::Unixpath $users_dir,
  Stdlib::Unixpath $dict_dir,
  Stdlib::Unixpath $clickhouse_datadir,
  Stdlib::Unixpath $clickhouse_tmpdir,
  String $clickhouse_user,
  String $clickhouse_group,
  Boolean $keep_default_users,
  String $config_file,
  String $profiles_file,
  String $quotas_file,
  String $macros_file,
  String $zookeeper_config_file,
  String $remote_servers_file,
  Boolean $install_client,
  String $datadir_mode,
  String $confdir_mode,

# Service
  String $service_name,
  Stdlib::Ensure::Service $service_ensure,
  Boolean $service_enabled,
  Boolean $manage_service,
  Boolean $manage_systemd,
  Boolean $restart,

  Hash[String, Any] $override_options = {},
  String $dict_source_folder = "puppet:///modules/${module_name}",
# Additional configuration
  Optional[Clickhouse::Clickhouse_users] $users                             = undef,
  Optional[Hash[String, Hash[String, Any]]] $profiles                       = undef,
  Optional[Clickhouse::Clickhouse_quotas] $quotas = undef,
  Optional[Array[String]] $dictionaries                                     = undef,
  Optional[Clickhouse::Clickhouse_replication] $replication                 = undef,
  Optional[Clickhouse::Clickhouse_remote_servers] $remote_servers           = undef,
  Optional[Clickhouse::Clickhouse_crash_reports] $crash_reports             = undef,
) inherits clickhouse {
  if $clickhouse::manage_repo {
    Class['clickhouse::repo']
    -> Class['clickhouse::server::install']
  }

  if $restart {
    Class['clickhouse::server::config']
    ~> Class['clickhouse::server::service']
  }

  include clickhouse::server::install
  include clickhouse::server::config
  include clickhouse::server::resources
  include clickhouse::server::service

  if $install_client {
    include clickhouse::client
    Class['clickhouse::server::install']
    -> Class['clickhouse::client']
  }

  Class['clickhouse::server::install']
  -> Class['clickhouse::server::config']
  -> Class['clickhouse::server::resources']
  -> Class['clickhouse::server::service']
}