主頁 > 資料庫 > Installing ClickHouse-22.10.2.11 on openEuler

Installing ClickHouse-22.10.2.11 on openEuler

2022-11-16 07:30:34 資料庫

一、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

 

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/534211.html

標籤:其它

上一篇:還在為資料庫事務一致性檢測而苦惱?讓Elle幫幫你,以TDSQL為例我們測測 | DB·洞見#7

下一篇:ElasticSearch深度分頁詳解

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more