2022-02-08 18:12:04 +00:00
|
|
|
[Unit]
|
|
|
|
Description=ClickHouse Server (analytic DBMS for big data)
|
|
|
|
Requires=network-online.target
|
|
|
|
# NOTE: that After/Wants=time-sync.target is not enough, you need to ensure
|
|
|
|
# that the time was adjusted already, if you use systemd-timesyncd you are
|
|
|
|
# safe, but if you use ntp or some other daemon, you should configure it
|
|
|
|
# additionaly.
|
|
|
|
After=time-sync.target network-online.target
|
|
|
|
Wants=time-sync.target
|
|
|
|
|
|
|
|
[Service]
|
2022-11-19 18:18:03 +00:00
|
|
|
Type=notify
|
|
|
|
|
2022-12-05 21:20:04 +00:00
|
|
|
# NOTE: we leave clickhouse watchdog process enabled to be able to see OOM/SIGKILL traces in clickhouse-server.log files.
|
|
|
|
# If you wish to disable the watchdog and rely on systemd logs just add "Environment=CLICKHOUSE_WATCHDOG_ENABLE=0" line.
|
2022-02-08 18:12:04 +00:00
|
|
|
User=clickhouse
|
|
|
|
Group=clickhouse
|
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2023-02-20 16:26:49 +00:00
|
|
|
# Since ClickHouse is systemd aware default 1m30sec may not be enough
|
2023-03-17 16:56:56 +00:00
|
|
|
TimeoutStartSec=0
|
2023-02-16 11:23:16 +00:00
|
|
|
# %p is resolved to the systemd unit name
|
2023-02-16 04:46:24 +00:00
|
|
|
RuntimeDirectory=%p
|
2023-01-24 13:48:28 +00:00
|
|
|
ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=%t/%p/%p.pid
|
2022-02-08 18:12:04 +00:00
|
|
|
# Minus means that this file is optional.
|
2023-01-24 13:48:28 +00:00
|
|
|
EnvironmentFile=-/etc/default/%p
|
2023-02-28 11:00:08 +00:00
|
|
|
# Bring back /etc/default/clickhouse for backward compatibility
|
|
|
|
EnvironmentFile=-/etc/default/clickhouse
|
2022-02-08 18:12:04 +00:00
|
|
|
LimitCORE=infinity
|
|
|
|
LimitNOFILE=500000
|
2022-04-02 22:26:41 +00:00
|
|
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE CAP_NET_BIND_SERVICE
|
2022-02-08 18:12:04 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
# ClickHouse should not start from the rescue shell (rescue.target).
|
|
|
|
WantedBy=multi-user.target
|