Installing ClickHouse-22.10.2.11 on openEuler

来源:https://www.cnblogs.com/huaxiayuyi/archive/2022/11/15/16892292.html
-Advertisement-
Play Games

一、Installing ClickHouse-22.10.2.11 on openEuler 1 地址 https://clickhouse.com https://packages.clickhouse.com https://github.com/ClickHouse/ClickHouse 2 ...


一、Installing ClickHouse-22.10.2.11 on openEuler

1 地址

https://clickhouse.com

https://packages.clickhouse.com

https://github.com/ClickHouse/ClickHouse

2 Tgz安裝包​

如果您的操作系統不支持安裝deb或rpm包,建議使用官方預編譯的 tgz 軟體包。

所需的版本可以通過 curl 或 wget 從存儲庫 https://github.com/ClickHouse/ClickHouse下載。

下載後解壓縮下載資源文件並使用安裝腳本進行安裝。以下是一個最新穩定版本的安裝。

# wget 下載
mkdir -p /opt/software/ClickHouse && cd /opt/software/ClickHouse
wget https://github.com/ClickHouse/ClickHouse/releases/download/v22.10.2.11-stable/clickhouse-client-22.10.2.11-amd64.tgz
wget https://github.com/ClickHouse/ClickHouse/releases/download/v22.10.2.11-stable/clickhouse-common-static-22.10.2.11-amd64.tgz
wget https://github.com/ClickHouse/ClickHouse/releases/download/v22.10.2.11-stable/clickhouse-common-static-dbg-22.10.2.11-amd64.tgz
wget https://github.com/ClickHouse/ClickHouse/releases/download/v22.10.2.11-stable/clickhouse-server-22.10.2.11-amd64.tgz

對於生產環境,建議使用最新的stable版本。

可以在GitHub頁面 https://github.com/ClickHouse/ClickHouse/tags 找到它,它以尾碼`-stable`標誌。

3 解壓

mkdir /opt/ClickHouse
tar -zxvf /opt/software/ClickHouse/clickhouse-client-22.10.2.11-amd64.tgz -C /opt/ClickHouse
tar -zxvf /opt/software/ClickHouse/clickhouse-common-static-22.10.2.11-amd64.tgz -C /opt/ClickHouse
tar -zxvf /opt/software/ClickHouse/clickhouse-common-static-dbg-22.10.2.11-amd64.tgz -C /opt/ClickHouse
tar -zxvf /opt/software/ClickHouse/clickhouse-server-22.10.2.11-amd64.tgz -C /opt/ClickHouse

4 運行 doinst.sh

# 找到 doinst.sh 並執行sh
/opt/ClickHouse/clickhouse-common-static-22.10.2.11/install/doinst.sh
/opt/ClickHouse/clickhouse-common-static-dbg-22.10.2.11/install/doinst.sh
/opt/ClickHouse/clickhouse-server-22.10.2.11/install/doinst.sh
/opt/ClickHouse/clickhouse-client-22.10.2.11/install/doinst.sh

# 運行clickhouse-server後,clickhouse會預設創建一個default的用戶,讓你設置密碼,不設置密碼可以按回車
[root@ecs-65685 ~]# /opt/ClickHouse/clickhouse-server-22.10.2.11/install/doinst.sh
ClickHouse binary is already located at /usr/bin/clickhouse
Symlink /usr/bin/clickhouse-server already exists but it points to /root/clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-copier already exists but it points to /root/clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-copier to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-git-import to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-extract-from-config already exists but it points to /root/clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-keeper already exists but it points to /root/clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper-converter to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-disks to /usr/bin/clickhouse.
Creating clickhouse group if it does not exist.
 groupadd -r clickhouse
Creating clickhouse user if it does not exist.
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.
Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.
Config file /etc/clickhouse-server/config.xml already exists, will keep it and extract path info from it.
/etc/clickhouse-server/config.xml has /var/lib/clickhouse/ as data path.
/etc/clickhouse-server/config.xml has /var/log/clickhouse-server/ as log path.
Users config file /etc/clickhouse-server/users.xml already exists, will keep it and extract users info from it.
Creating log directory /var/log/clickhouse-server/.
Creating data directory /var/lib/clickhouse/.
Creating pid directory /var/run/clickhouse-server.
 chown -R clickhouse:clickhouse '/var/log/clickhouse-server/'
 chown -R clickhouse:clickhouse '/var/run/clickhouse-server'
 chown  clickhouse:clickhouse '/var/lib/clickhouse/'
 groupadd -r clickhouse-bridge
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridge
 chown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-odbc-bridge'
 chown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-library-bridge'
Enter password for default user:
Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
Setting capabilities for clickhouse binary. This is optional.
Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' or 'net_bind_service' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually.
# 允許伺服器接受來自網路的連接(預設為僅本地主機)
Allow server to accept connections from the network (default is localhost only), [y/N]: y
The choice is saved in file /etc/clickhouse-server/config.d/listen.xml.
 chown -R clickhouse:clickhouse '/etc/clickhouse-server'

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client --password

Synchronizing state of clickhouse-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable clickhouse-server
Created symlink /etc/systemd/system/multi-user.target.wants/clickhouse-server.service → /usr/lib/systemd/system/clickhouse-server.service.

5 啟動

5.1 如果沒有service,可以運行如下命令在後臺啟動服務

# 查看命令
[root@ecs-65685 ~]# clickhouse-server --help
usage:
clickhouse-server [OPTION] [-- [ARG]...]
positional arguments can be used to rewrite config.xml properties, for
example, --http_port=8010

-h, --help                        show help and exit
-V, --version                     show version and exit
-C<file>, --config-file=<file>    load configuration from a given file
-L<file>, --log-file=<file>       use given log file
-E<file>, --errorlog-file=<file>  use given log file for errors only
-P<file>, --pid-file=<file>       use given pidfile
--daemon                          Run application as a daemon.
--umask=mask                      Set the daemon's umask (octal, e.g. 027).
--pidfile=path                    Write the process ID of the application to given file.

# 啟動
sudo /etc/init.d/clickhouse-server start

# 停止
sudo /etc/init.d/clickhouse-server stop

日誌文件將輸出在 /var/log/clickhouse-server 文件夾。

如果伺服器沒有啟動,檢查 /etc/clickhouse-server/config.xml 中的配置。

5.2 手動從控制台啟動伺服器

[root@ecs-65685 ~]# clickhouse-server --config-file=/etc/clickhouse-server/config.xml
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/listen.xml'.
Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
2022.11.15 20:44:35.961690 [ 4036 ] {} <Information> SentryWriter: Sending crash reports is disabled
2022.11.15 20:44:35.971273 [ 4036 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2022.11.15 20:44:36.120186 [ 4036 ] {} <Information> : Starting ClickHouse 22.10.2.11 (revision: 54467, git hash: d2bfcaba0022ff70075078987cf253c6e0c12183, build id: 980C6F4C7EC4672BA0D63DCE7EA99C43523A5A7E), PID 4036
2022.11.15 20:44:36.120305 [ 4036 ] {} <Information> Application: starting up
2022.11.15 20:44:36.120328 [ 4036 ] {} <Information> Application: OS name: Linux, version: 4.19.90-2003.4.0.0036.oe1.x86_64, architecture: x86_64
2022.11.15 20:44:36.130693 [ 4036 ] {} <Warning> Context: Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
2022.11.15 20:44:36.131091 [ 4036 ] {} <Trace> AsynchronousMetrics: Scanning /sys/class/thermal
2022.11.15 20:44:36.131121 [ 4036 ] {} <Trace> AsynchronousMetrics: Scanning /sys/block
2022.11.15 20:44:36.131169 [ 4036 ] {} <Trace> AsynchronousMetrics: Scanning /sys/devices/system/edac
2022.11.15 20:44:36.131191 [ 4036 ] {} <Trace> AsynchronousMetrics: Scanning /sys/class/hwmon
2022.11.15 20:44:36.293811 [ 4036 ] {} <Information> Application: Integrity check of the executable successfully passed (checksum: 61AFDDE9B58A440D85A27CF2CFCBED9D)
2022.11.15 20:44:36.293932 [ 4036 ] {} <Trace> Application: Will do mlock to prevent executable memory from being paged out. It may take a few seconds.
2022.11.15 20:44:36.314733 [ 4036 ] {} <Trace> Application: The memory map of clickhouse executable has been mlock'ed, total 279.37 MiB
2022.11.15 20:44:36.316017 [ 4036 ] {} <Error> Application: DB::Exception: Effective user of the process (root) does not match the owner of the data (clickhouse). Run under 'sudo -u clickhouse'.
2022.11.15 20:44:36.316052 [ 4036 ] {} <Information> Application: shutting down
2022.11.15 20:44:36.316063 [ 4036 ] {} <Debug> Application: Uninitializing subsystem: Logging Subsystem
2022.11.15 20:44:36.316106 [ 4037 ] {} <Trace> BaseDaemon: Received signal -2
2022.11.15 20:44:36.316161 [ 4037 ] {} <Information> BaseDaemon: Stop SignalListener thread

在這種情況下,日誌將被列印到控制台,這在開發過程中很方便。

如果配置文件在當前目錄中,則不需要指定——config-file參數。預設情況下,它的路徑為./config.xml

5.3 root 用戶啟動失敗

檢查 ClickHouse 相關的用戶目錄,會發現用戶都是ClickHouse

ll /etc/clickhouse-server
ll /var/log/clickhouse-server
ll /var/lib/clickhouse

5.4 clickhouse 用戶啟動

用 clickhouse 用戶來啟動 clickhouse server

sudo -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid

# 查看進程
[root@ecs-65685 ~]# ps -ef |grep clickhouse
clickho+    1803       1  0 20:17 ?        00:00:00 clickhouse-watchdog        --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
clickho+    2479    1803  5 20:17 ?        00:00:07 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
root        3079    2949  0 20:19 pts/0    00:00:00 grep --color=auto clickhouse

6 root 用戶啟動

將 ClickHouse 相關的用戶目錄全部設置成 root

chown -R root:root /var/lib/clickhouse /var/log/clickhouse-server /etc/clickhouse-server /etc/clickhouse-client

6.1 使用root用戶命令啟動

[root@ecs-65685 ~]# sudo /etc/init.d/clickhouse-server start
 chown -R clickhouse: '/var/run/clickhouse-server/'
Will run sudo -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid --daemon
Waiting for server to start
Waiting for server to start
Server started

7 命令行客戶端

ClickHouse 提供了一個原生命令行客戶端 clickhouse-client 客戶端支持命令行。

安裝部署後,系統預設會安裝 clickhouse-client(同時它屬於clickhouse-client安裝包中)。

# 沒有密碼可不加 --password
[root@ecs-65685 ~]# clickhouse-client --password
ClickHouse client version 22.10.2.11 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 22.10.2 revision 54460.

Warnings:
 * Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
 * Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.

ecs-65685 :)

不同的客戶端和伺服器版本彼此相容,但是一些特性可能在舊客戶機中不可用。建議使用與伺服器應用相同版本的客戶端。

預設情況下,使用default用戶並不攜帶密碼連接到localhost:9000

還可以使用--host參數連接到指定伺服器。終端必須使用 UTF-8 編碼。

二、ClickHouse 相關目錄

1 命令目錄

[root@ecs-65685 bin]# pwd
/usr/bin
[root@ecs-65685 bin]# ll |grep clickhouse
-r-xr-xr-x  1 root              root              401M Nov 15 15:11 clickhouse
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-benchmark -> clickhouse
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-client -> clickhouse
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-compressor -> clickhouse
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-copier -> /usr/bin/clickhouse
-rwx------  1 root              root               19M Nov 15 15:11 clickhouse-diagnostics
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-disks -> /usr/bin/clickhouse
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-extract-from-config -> /usr/bin/clickhouse
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-format -> clickhouse
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-git-import -> /usr/bin/clickhouse
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-keeper -> /usr/bin/clickhouse
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-keeper-converter -> /usr/bin/clickhouse
-rwx------  1 clickhouse-bridge clickhouse-bridge 134M Nov 15 15:11 clickhouse-library-bridge
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-local -> clickhouse
lrwxrwxrwx  1 root              root                10 Nov 15 15:14 clickhouse-obfuscator -> clickhouse
-rwx------  1 clickhouse-bridge clickhouse-bridge 135M Nov 15 15:11 clickhouse-odbc-bridge
-rwx------  1 root              root              2.0K Nov 15 15:12 clickhouse-report
lrwxrwxrwx  1 root              root                19 Nov 15 15:12 clickhouse-server -> /usr/bin/clickhouse

2 配置文件目錄

[root@ecs-65685 ~]# ll /etc/clickhouse-server
total 88K
dr-x------ 2 clickhouse clickhouse 4.0K Nov 15 15:14 config.d
-r-------- 1 clickhouse clickhouse  69K Nov 15 15:12 config.xml
dr-x------ 2 clickhouse clickhouse 4.0K Nov 15 15:44 users.d
-r-------- 1 clickhouse clickhouse 5.3K Nov 15 15:47 users.xml

3 日誌目錄

[root@ecs-65685 ~]# ll /var/log/clickhouse-server
total 1.8M
-rw-r----- 1 clickhouse clickhouse  11K Nov 15 15:47 clickhouse-server.err.log
-rw-r----- 1 clickhouse clickhouse 1.8M Nov 15 16:14 clickhouse-server.log
-rw------- 1 clickhouse clickhouse  398 Nov 15 15:17 stderr.log
-rw-r----- 1 clickhouse clickhouse    0 Nov 15 15:17 stdout.log

4 數據文件目錄

[root@ecs-65685 ~]# ll /var/lib/clickhouse
total 64K
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 access
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:17 cores
drwxr-x--- 4 clickhouse clickhouse 4.0K Nov 15 15:32 data
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 dictionaries_lib
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 flags
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 format_schemas
drwxr-x--- 4 clickhouse clickhouse 4.0K Nov 15 15:32 metadata
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 metadata_dropped
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 preprocessed_configs
-rw-r----- 1 clickhouse clickhouse   60 Nov 15 15:35 status
drwxr-x--- 8 clickhouse clickhouse 4.0K Nov 15 15:49 store
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 tmp
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 user_defined
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 user_files
drwxr-x--- 2 clickhouse clickhouse 4.0K Nov 15 15:32 user_scripts
-rw-r----- 1 clickhouse clickhouse   36 Nov 15 15:32 uuid

 

三、允許遠程訪問

1 ClickHouse 預設不允許遠程訪問,需要修改配置文件

2 重啟 ClickHouse

clickhouse restart

3 使用瀏覽器驗證一下,伺服器 IP:8123

四、使用DBeaver連接 ClickHouse

 

 

第一次鏈接要安裝相應驅動,填寫對應IP和埠,用戶名,密碼[沒有設置可以不填]。

 

測試連接

 

五、防火牆

# 關閉防火牆
systemctl stop firewalld

firewall-cmd --zone=public --add-port=8123/tcp --permanent

# 配置立即生效
firewall-cmd --reload

# 重啟防火牆生效
systemctl restart firewalld

雲主機配置安全組,在入方向規則,允許8123放行。

X、One Step Success 

 

Y、Error message

1 DB::ErrnoException: Could not calculate available disk space (statvfs), errno: 13, strerror: Permission denied

[root@ecs-65685 ~]# sudo -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/listen.xml'.
Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
2022.11.15 15:31:21.118852 [ 314492 ] {} <Information> SentryWriter: Sending crash reports is disabled
2022.11.15 15:31:21.127975 [ 314492 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
Code: 76. DB::ErrnoException: Cannot open file /usr/lib/debug/usr/bin/clickhouse.debug, errno: 13, strerror: Permission denied. (CANNOT_OPEN_FILE), Stack trace (when copying this message, always include the lines below):

 (version 22.10.2.11 (official build))
2022.11.15 15:31:21.175767 [ 314493 ] {} <Trace> BaseDaemon: Received signal -2
2022.11.15 15:31:21.175819 [ 314493 ] {} <Information> BaseDaemon: Stop SignalListener thread
[root@ecs-65685 ~]# ll /usr/lib/debug/usr/bin
total 3.1G
-rw------- 1 root root 1.7G Nov 15 15:11 clickhouse.debug
-rw------- 1 root root 700M Nov 15 15:12 clickhouse-library-bridge.debug
-rw------- 1 root root 705M Nov 15 15:11 clickhouse-odbc-bridge.debug
[root@ecs-65685 ~]# chown -R clickhouse:clickhouse /usr/lib/debug/usr/bin
[root@ecs-65685 ~]# ll /usr/lib/debug/usr/bin
total 3.1G
-rw------- 1 clickhouse clickhouse 1.7G Nov 15 15:11 clickhouse.debug
-rw------- 1 clickhouse clickhouse 700M Nov 15 15:12 clickhouse-library-bridge.debug
-rw------- 1 clickhouse clickhouse 705M Nov 15 15:11 clickhouse-odbc-bridge.debug
[root@ecs-65685 ~]# sudo -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/listen.xml'.
Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
2022.11.15 15:32:11.442704 [ 314588 ] {} <Information> SentryWriter: Sending crash reports is disabled
2022.11.15 15:32:11.452552 [ 314588 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2022.11.15 15:32:11.602884 [ 314588 ] {} <Information> : Starting ClickHouse 22.10.2.11 (revision: 54467, git hash: d2bfcaba0022ff70075078987cf253c6e0c12183, build id: 980C6F4C7EC4672BA0D63DCE7EA99C43523A5A7E), PID 314588
2022.11.15 15:32:11.603022 [ 314588 ] {} <Information> Application: starting up
2022.11.15 15:32:11.603047 [ 314588 ] {} <Information> Application: OS name: Linux, version: 4.19.90-2003.4.0.0036.oe1.x86_64, architecture: x86_64
2022.11.15 15:32:11.720246 [ 314588 ] {} <Warning> Context: Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
2022.11.15 15:32:11.720676 [ 314588 ] {} <Trace> AsynchronousMetrics: Scanning /sys/class/thermal
2022.11.15 15:32:11.720707 [ 314588 ] {} <Trace> AsynchronousMetrics: Scanning /sys/block
2022.11.15 15:32:11.720743 [ 314588 ] {} <Trace> AsynchronousMetrics: Scanning /sys/devices/system/edac
2022.11.15 15:32:11.720764 [ 314588 ] {} <Trace> AsynchronousMetrics: Scanning /sys/class/hwmon
2022.11.15 15:32:12.467832 [ 314588 ] {} <Information> Application: Integrity check of the executable successfully passed (checksum: 61AFDDE9B58A440D85A27CF2CFCBED9D)
2022.11.15 15:32:12.468919 [ 314588 ] {} <Information> Application: It looks like the process has no CAP_IPC_LOCK capability, binary mlock will be disabled. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_ipc_lock=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.
2022.11.15 15:32:12.476417 [ 314588 ] {} <Debug> Application: rlimit on number of file descriptors is 1048576
2022.11.15 15:32:12.476453 [ 314588 ] {} <Debug> Application: rlimit on number of threads is 29729
2022.11.15 15:32:12.476483 [ 314588 ] {} <Warning> Context: Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.
2022.11.15 15:32:12.476503 [ 314588 ] {} <Debug> Application: Initializing DateLUT.
2022.11.15 15:32:12.476513 [ 314588 ] {} <Trace> Application: Initialized DateLUT with time zone 'Asia/Shanghai'.
2022.11.15 15:32:12.476541 [ 314588 ] {} <Debug> Application: Setting up /var/lib/clickhouse/tmp/ to store temporary data in it
2022.11.15 15:32:12.476860 [ 314588 ] {} <Debug> Application: Configuration parameter 'interserver_http_host' doesn't exist or exists and empty. Will use 'ecs-65685' as replica host.
2022.11.15 15:32:12.476883 [ 314588 ] {} <Debug> Application: Initializing interserver credentials.
2022.11.15 15:32:12.477028 [ 314588 ] {} <Information> SensitiveDataMaskerConfigRead: 1 query masking rules loaded.
2022.11.15 15:32:12.478838 [ 314588 ] {} <Debug> ConfigReloader: Loading config '/etc/clickhouse-server/config.xml'
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/listen.xml'.
Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml'.
2022.11.15 15:32:12.481753 [ 314588 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/config.xml', performing update on configuration
2022.11.15 15:32:12.483413 [ 314588 ] {} <Information> Application: Setting max_server_memory_usage was set to 6.56 GiB (7.29 GiB available * 0.90 max_server_memory_usage_to_ram_ratio)
2022.11.15 15:32:12.486133 [ 314588 ] {} <Information> CertificateReloader: One of paths is empty. Cannot apply new configuration for certificates. Fill all paths and try again.
2022.11.15 15:32:12.486164 [ 314588 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/config.xml', performed update on configuration
2022.11.15 15:32:12.487887 [ 314588 ] {} <Debug> ConfigReloader: Loading config '/etc/clickhouse-server/users.xml'
Processing configuration file '/etc/clickhouse-server/users.xml'.
Merging configuration file '/etc/clickhouse-server/users.d/default-password.xml'.
Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.
2022.11.15 15:32:12.488299 [ 314588 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/users.xml', performing update on configuration
2022.11.15 15:32:12.488803 [ 314588 ] {} <Debug> ConfigReloader: Loaded config '/etc/clickhouse-server/users.xml', performed update on configuration
2022.11.15 15:32:12.489059 [ 314588 ] {} <Debug> Access(user directories): Added users.xml access storage 'users.xml', path: /etc/clickhouse-server/users.xml
2022.11.15 15:32:12.489141 [ 314588 ] {} <Warning> Access(local directory): File /var/lib/clickhouse/access/users.list doesn't exist
2022.11.15 15:32:12.489159 [ 314588 ] {} <Warning> Access(local directory): Recovering lists in directory /var/lib/clickhouse/access/
2022.11.15 15:32:12.489258 [ 314588 ] {} <Debug> Access(user directories): Added local directory access storage 'local directory', path: /var/lib/clickhouse/access/
2022.11.15 15:32:12.489288 [ 314588 ] {} <Information> Application: Uncompressed cache policy name
2022.11.15 15:32:12.489303 [ 314588 ] {} <Information> Application: Uncompressed cache size was lowered to 3.64 GiB because the system has low amount of memory
2022.11.15 15:32:12.491692 [ 314588 ] {} <Information> Context: Initialized background executor for merges and mutations with num_threads=16, num_tasks=32
2022.11.15 15:32:12.492037 [ 314588 ] {} <Information> Context: Initialized background executor for move operations with num_threads=8, num_tasks=8
2022.11.15 15:32:12.492434 [ 314588 ] {} <Information> Context: Initialized background executor for fetches with num_threads=8, num_tasks=8
2022.11.15 15:32:12.493313 [ 314588 ] {} <Information> Context: Initialized background executor for common operations (e.g. clearing old parts) with num_threads=8, num_tasks=8
2022.11.15 15:32:12.493499 [ 314588 ] {} <Information> Application: Mark cache size was lowered to 3.64 GiB because the system has low amount of memory
2022.11.15 15:32:12.493608 [ 314588 ] {} <Information> BackgroundSchedulePool/BgSchPool: Create BackgroundSchedulePool with 128 threads
2022.11.15 15:32:12.504101 [ 314588 ] {} <Information> DNSCacheUpdater: Update period 15 seconds
2022.11.15 15:32:12.504135 [ 314588 ] {} <Information> Application: Loading metadata from /var/lib/clickhouse/
2022.11.15 15:32:12.504220 [ 314639 ] {} <Debug> DNSResolver: Updating DNS cache
2022.11.15 15:32:12.507126 [ 314639 ] {} <Debug> DNSResolver: Updated DNS cache
2022.11.15 15:32:12.515442 [ 314588 ] {} <Information> DatabaseAtomic (system): Metadata processed, database system has 0 tables and 0 dictionaries in total.
2022.11.15 15:32:12.515469 [ 314588 ] {} <Information> TablesLoader: Parsed metadata of 0 tables in 1 databases in 8.1882e-05 sec
2022.11.15 15:32:12.515509 [ 314588 ] {} <Information> TablesLoader: Loading 0 tables with 0 dependency level
2022.11.15 15:32:12.516817 [ 314588 ] {} <Debug> SystemLog: Not creating system.text_log since corresponding section 'text_log' is missing from config
2022.11.15 15:32:12.518166 [ 314588 ] {} <Debug> SystemLog: Not creating system.filesystem_cache_log since corresponding section 'filesystem_cache_log' is missing from config
2022.11.15 15:32:12.518677 [ 314588 ] {} <Debug> SystemLog: Not creating system.zookeeper_log since corresponding section 'zookeeper_log' is missing from config
2022.11.15 15:32:12.518703 [ 314588 ] {} <Debug> SystemLog: Not creating system.session_log since corresponding section 'session_log' is missing from config
2022.11.15 15:32:12.518719 [ 314588 ] {} <Debug> SystemLog: Not creating system.transactions_info_log since corresponding section 'transactions_info_log' is missing from config
2022.11.15 15:32:12.534139 [ 314588 ] {} <Information> DatabaseCatalog: Found 0 partially dropped tables. Will load them and retry removal.
2022.11.15 15:32:12.537305 [ 314588 ] {} <Information> DatabaseAtomic (default): Metadata processed, database default has 0 tables and 0 dictionaries in total.
2022.11.15 15:32:12.537332 [ 314588 ] {} <Information> TablesLoader: Parsed metadata of 0 tables in 1 databases in 6.2905e-05 sec
2022.11.15 15:32:12.537362 [ 314588 ] {} <Information> TablesLoader: Loading 0 tables with 0 dependency level
2022.11.15 15:32:12.537376 [ 314588 ] {} <Information> DatabaseAtomic (default): Starting up tables.
2022.11.15 15:32:12.537392 [ 314588 ] {} <Information> DatabaseAtomic (system): Starting up tables.
2022.11.15 15:32:12.538464 [ 314588 ] {} <Information> UserDefinedSQLObjectsLoaderFromDisk: Loading user defined objects from /var/lib/clickhouse/user_defined/
2022.11.15 15:32:12.538510 [ 314588 ] {} <Debug> UserDefinedSQLObjectsLoaderFromDisk: User defined objects loaded
2022.11.15 15:32:12.538521 [ 314588 ] {} <Debug> Application: Loaded metadata.
2022.11.15 15:32:12.538550 [ 314588 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2022.11.15 15:32:12.538572 [ 314588 ] {} <Information> Application: Tasks stats provider: procfs
2022.11.15 15:32:12.538587 [ 314588 ] {} <Information> Application: It looks like the process has no CAP_SYS_NICE capability, the setting 'os_thread_priority' will have no effect. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_sys_nice=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.
2022.11.15 15:32:12.538902 [ 314588 ] {} <Trace> MySQLHandlerFactory: Failed to create SSL context. SSL will be disabled. Error: Poco::Exception. Code: 1000, e.code() = 0, SSL Exception: Configuration error: no certificate file has been specified (version 22.10.2.11 (official build))
2022.11.15 15:32:12.538986 [ 314588 ] {} <Trace> MySQLHandlerFactory: Failed to read RSA key pair from server certificate. Error: Code: 139. DB::Exception: Certificate file is not set. (NO_ELEMENTS_IN_CONFIG) (version 22.10.2.11 (official build))
2022.11.15 15:32:12.538998 [ 314588 ] {} <Trace> MySQLHandlerFactory: Generating new RSA key pair.
2022.11.15 15:32:12.587458 [ 314588 ] {} <Information> CertificateReloader: One of paths is empty. Cannot apply new configuration for certificates. Fill all paths and try again.
2022.11.15 15:32:12.587732 [ 314588 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 11.57 MiB, peak 15.97 MiB, will set to 526.04 MiB (RSS), difference: 505.96 MiB
2022.11.15 15:32:12.588056 [ 314588 ] {} <Information> Application: Shutting down storages.
2022.11.15 15:32:12.588156 [ 314769 ] {} <Trace> SystemLog (system.query_log): Terminating
2022.11.15 15:32:12.588244 [ 314777 ] {} <Trace> SystemLog (system.query_thread_log): Terminating
2022.11.15 15:32:12.588295 [ 314772 ] {} <Trace> SystemLog (system.part_log): Terminating
2022.11.15 15:32:12.588365 [ 314767 ] {} <Trace> SystemLog (system.trace_log): Flushing system log, 1 entries to flush up to offset 1
2022.11.15 15:32:12.588406 [ 314767 ] {} <Debug> SystemLog (system.trace_log): Creating new table system.trace_log for TraceLog
2022.11.15 15:32:12.589343 [ 314767 ] {} <Trace> StoragePolicy (default): Storage policy default created, total volumes 1
2022.11.15 15:32:12.592456 [ 314767 ] {} <Debug> system.trace_log (f608a8db-8edf-46eb-b056-149ebb09c40b): Loading data parts
2022.11.15 15:32:12.592593 [ 314767 ] {} <Information> system.trace_log (f608a8db-8edf-46eb-b056-149ebb09c40b): Found 0 parts for disk 'default' to load
2022.11.15 15:32:12.592629 [ 314767 ] {} <Debug> system.trace_log (f608a8db-8edf-46eb-b056-149ebb09c40b): There are no data parts
2022.11.15 15:32:12.595633 [ 314767 ] {} <Trace> system.trace_log (f608a8db-8edf-46eb-b056-149ebb09c40b): Trying to reserve 1.00 MiB using storage policy from min volume index 0
2022.11.15 15:32:12.595680 [ 314767 ] {} <Trace> DiskLocal: Reserved 1.00 MiB on local disk `default`, having unreserved 17.59 GiB.
2022.11.15 15:32:12.595934 [ 314767 ] {} <Trace> MergedBlockOutputStream: filled checksums 202211_1_1_0 (state Temporary)
2022.11.15 15:32:12.596568 [ 314767 ] {} <Trace> system.trace_log (f608a8db-8edf-46eb-b056-149ebb09c40b): Renaming temporary part tmp_insert_202211_1_1_0 to 202211_1_1_0.
2022.11.15 15:32:12.596702 [ 314767 ] {} <Trace> SystemLog (system.trace_log): Flushed system log up to offset 1
2022.11.15 15:32:12.596718 [ 314767 ] {} <Trace> SystemLog (system.trace_log): Terminating
2022.11.15 15:32:12.596786 [ 314776 ] {} <Trace> SystemLog (system.crash_log): Terminating
2022.11.15 15:32:13.519852 [ 314771 ] {} <Trace> SystemLog (system.metric_log): Flushing system log, 1 entries to flush up to offset 1
2022.11.15 15:32:13.519928 [ 314771 ] {} <Debug> SystemLog (system.metric_log): Creating new table system.metric_log for MetricLog
2022.11.15 15:32:13.528837 [ 314771 ] {} <Debug> system.metric_log (fa3ecf81-1bce-4be0-989a-07239a96472b): Loading data parts
2022.11.15 15:32:13.528983 [ 314771 ] {} <Information> system.metric_log (fa3ecf81-1bce-4be0-989a-07239a96472b): Found 0 parts for disk 'default' to load
2022.11.15 15:32:13.529032 [ 314771 ] {} <Debug> system.metric_log (fa3ecf81-1bce-4be0-989a-07239a96472b): There are no data parts
2022.11.15 15:32:13.541563 [ 314771 ] {} <Trace> system.metric_log (fa3ecf81-1bce-4be0-989a-07239a96472b): Trying to reserve 1.00 MiB using storage policy from min volume index 0
2022.11.15 15:32:13.541624 [ 314771 ] {} <Trace> DiskLocal: Reserved 1.00 MiB on local disk `default`, having unreserved 17.59 GiB.
2022.11.15 15:32:13.544491 [ 314771 ] {} <Trace> MergedBlockOutputStream: filled checksums 202211_1_1_0 (state Temporary)
2022.11.15 15:32:13.545009 [ 314771 ] {} <Trace> system.metric_log (fa3ecf81-1bce-4be0-989a-07239a96472b): Renaming temporary part tmp_insert_202211_1_1_0 to 202211_1_1_0.
2022.11.15 15:32:13.546021 [ 314771 ] {} <Trace> SystemLog (system.metric_log): Flushed system log up to offset 1
2022.11.15 15:32:13.546046 [ 314771 ] {} <Trace> SystemLog (system.metric_log): Terminating
2022.11.15 15:32:13.546105 [ 314775 ] {} <Trace> SystemLog (system.asynchronous_metric_log): Terminating
2022.11.15 15:32:13.546178 [ 314778 ] {} <Trace> SystemLog (system.opentelemetry_span_log): Terminating
2022.11.15 15:32:13.546230 [ 314768 ] {} <Trace> SystemLog (system.query_views_log): Terminating
2022.11.15 15:32:13.546279 [ 314770 ] {} <Trace> SystemLog (system.processors_profile_log): Terminating
2022.11.15 15:32:13.546320 [ 314773 ] {} <Trace> SystemLog (system.asynchronous_insert_log): Terminating
2022.11.15 15:32:13.547816 [ 314588 ] {} <Trace> BackgroundSchedulePool/BgSchPool: Waiting for threads to finish.
2022.11.15 15:32:13.548944 [ 314588 ] {} <Debug> MemoryTracker: Peak memory usage (for query): 71.56 KiB.
2022.11.15 15:32:13.549010 [ 314588 ] {} <Debug> Application: Shut down storages.
2022.11.15 15:32:13.549024 [ 314588 ] {} <Trace> AsynchronousInsertQueue: Shutting down the asynchronous insertion queue
2022.11.15 15:32:13.549050 [ 314588 ] {} <Trace> AsynchronousInsertQueue: Asynchronous insertion queue finished
2022.11.15 15:32:13.549324 [ 314588 ] {} <Debug> Application: Destroyed global context.
2022.11.15 15:32:13.550859 [ 314588 ] {} <Error> Application: DB::ErrnoException: Could not calculate available disk space (statvfs), errno: 13, strerror: Permission denied
2022.11.15 15:32:13.550883 [ 314588 ] {} <Information> Application: shutting down
2022.11.15 15:32:13.550893 [ 314588 ] {} <Debug> Application: Uninitializing subsystem: Logging Subsystem
2022.11.15 15:32:13.551424 [ 314589 ] {} <Trace> BaseDaemon: Received signal -2
2022.11.15 15:32:13.551457 [ 314589 ] {} <Information> BaseDaemon: Stop SignalListener thread

添加clickhouse用戶到root用戶組重新啟動即可

usermod -a -G root clickhouse

 

2 password is incorrect or there is no user with such name

[root@ecs-65685 ~]# clickhouse-client
ClickHouse client version 22.10.2.11 (official build).
Connecting to localhost:9000 as user default.

If you have installed ClickHouse and forgot password you can reset it in the configuration file.
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml
and deleting this file will reset the password.
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.

Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED)

 解決

[root@ecs-65685 ~]# clickhouse-client --password
ClickHouse client version 22.10.2.11 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 22.10.2 revision 54460.

Warnings:
 * Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
 * Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.

ecs-65685 :) exit

 

Z、Related Links

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 按core傳統方式添加 AddJsonFile("appsettings.json") 在windows平臺和ssr工作正常,但是在 ios 和 android 無法用這種方式,因為資源生成方式不一樣. 使用內置資源方式不夠靈活而且 ios 平臺會提示不能複製 json 文件到目錄,於是進行了幾天的... ...
  • (1)基於機器視覺及深度學習理論,研發AI瑕疵識別演算法,應用至刨花板生產線質檢工段,滿足高可靠性、高實時性的刨花板板面質檢需求。(2)基於工業互聯網平臺的異構設備及系統集成,實現數據接入、處理、分析、決策等流程化應用,支持多條刨花板產線集成,助力企業產線協同管理和產線綜合對標。 ...
  • 摘要 C/S端軟體,左側導航菜單+右側頁面切換的佈局很常見。 這篇文章介紹下使用ContentControl控制項和TabControl控制項如何實現基礎的頁面切換。 一、使用ContentControl實現頁面切換 頁面使用UserControl來實現。 基於MVVM框架的思想,利用數據綁定機制,將控 ...
  • windows10系統“無法安裝Windows沙盒:在固件中禁用了虛擬化支持”,另外操作無法安裝hyoer-v該固件中的虛擬化支持被禁用問題。 ####解決辦法: 我這裡以聯想拯救者r720筆記本電腦為例,開啟cpu虛擬化: 1、打開聯想筆記本電腦,重新啟動電腦,在啟動的時候快速按鍵盤上的F2按鍵, ...
  • //源文件 static uint32_t fac_us = 0; // us延時倍乘數 /** * @brief 初始化延遲函數 * 當使用ucos的時候,此函數會初始化ucos的時鐘節拍 * SYSTICK的時鐘固定為AHB時鐘的1/8 * @param SYSCLK 系統時鐘頻率 */ voi ...
  • //源文件 void LedPhyConfig() { RCC->AHB1ENR |= (1<<1); //使能GPIOB //LD1 GPIOB->MODER |= (1<<0*2); //輸出模式 GPIOB->OTYPER &= ~(1<<0); //推輓 GPIOB->OSPEEDR |= ...
  • 背景:內網環境伺服器不能直接安裝工具或服務,可以用一臺外網伺服器同步阿裡雲的yum倉庫,作為本地倉庫 搭建本地yum倉庫 編輯yum配置文件,開啟緩存使用功能,設置緩存路徑 cp /etc/yum.conf /etc/yum.conf.bak vim /etc/yum.conf cachedir=/ ...
  • SingleStore(前身 MemSQL)是一個為數據密集型應用設計的雲原生資料庫。它是一個分散式的關係型 SQL 資料庫管理系統(RDBMS),具有 ANSI SQL 支持,它以數據攝入、交易處理和查詢處理的速度而聞名。SingleStore 主要存儲關係型數據,但也可以存儲 JSON 數據、圖 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...