• Centos7.9 安装 clickhouse 24.6.1


    '''
    总结:
    [root@localhost ~]# curl https://clickhouse.com/ | sh
    [root@localhost ~]# sudo ./clickhouse install
    [root@localhost ~]# sudo clickhouse start
    [root@localhost ~]# clickhouse-client --password
    '''

    执行过程:

    1. [root@localhost ~]# curl https://clickhouse.com/ | sh
    2. % Total % Received % Xferd Average Speed Time Time Time Current
    3. Dload Upload Total Spent Left Speed
    4. 100 2822 0 2822 0 0 1584 0 --:--:-- 0:00:01 --:--:-- 1583
    5. Will download https://builds.clickhouse.com/master/amd64/clickhouse into clickhouse
    6. % Total % Received % Xferd Average Speed Time Time Time Current
    7. Dload Upload Total Spent Left Speed
    8. 100 109M 100 109M 0 0 1095k 0 0:01:42 0:01:42 --:--:-- 990k
    9. Successfully downloaded the ClickHouse binary, you can run it as:
    10. ./clickhouse
    11. You can also install it:
    12. sudo ./clickhouse install
    13. [root@localhost ~]# ll
    14. 总用量 131488
    15. -rw-------. 1 root root 1549 5月 7 16:23 anaconda-ks.cfg
    16. -rwxr-xr-x. 1 root root 114503961 6月 12 13:27 clickhouse
    17. -rw-r--r--. 1 root root 1580 5月 7 17:59 initial-setup-ks.cfg
    18. -rw-r--r--. 1 root root 255976 5月 13 13:59 tigervnc-server-1.13.80-1.el7.x86_64.rpm
    19. -rw-r--r--. 1 root root 221384 5月 13 14:11 tigervnc-server-1.8.0-21.el7.x86_64.rpm
    20. drwxr-xr-x. 2 root root 6 6月 3 18:19 公共
    21. drwxr-xr-x. 2 root root 6 6月 3 18:19 模板
    22. drwxr-xr-x. 2 root root 6 6月 3 18:19 视频
    23. drwxr-xr-x. 2 root root 6 6月 3 18:19 图片
    24. drwxr-xr-x. 2 root root 6 6月 3 18:19 文档
    25. drwxr-xr-x. 2 root root 6 6月 3 18:19 下载
    26. drwxr-xr-x. 2 root root 6 6月 3 18:19 音乐
    27. drwxr-xr-x. 2 root root 6 6月 3 18:19 桌面
    28. [root@localhost ~]# sudo ./clickhouse install
    29. Decompressing the binary....
    30. Copying ClickHouse binary to /usr/bin/clickhouse.new
    31. Renaming /usr/bin/clickhouse.new to /usr/bin/clickhouse.
    32. Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
    33. Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
    34. Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
    35. Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse.
    36. Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse.
    37. Creating symlink /usr/bin/clickhouse-git-import to /usr/bin/clickhouse.
    38. Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
    39. Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
    40. Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse.
    41. Creating symlink /usr/bin/clickhouse-keeper to /usr/bin/clickhouse.
    42. Creating symlink /usr/bin/clickhouse-keeper-converter to /usr/bin/clickhouse.
    43. Creating symlink /usr/bin/clickhouse-disks to /usr/bin/clickhouse.
    44. Creating symlink /usr/bin/ch to /usr/bin/clickhouse.
    45. Creating symlink /usr/bin/chl to /usr/bin/clickhouse.
    46. Creating symlink /usr/bin/chc to /usr/bin/clickhouse.
    47. Creating clickhouse group if it does not exist.
    48. groupadd -r clickhouse
    49. Creating clickhouse user if it does not exist.
    50. useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
    51. Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
    52. Creating config directory /etc/clickhouse-server.
    53. Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.
    54. Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.
    55. Data path configuration override is saved to file /etc/clickhouse-server/config.d/data-paths.xml.
    56. Log path configuration override is saved to file /etc/clickhouse-server/config.d/logger.xml.
    57. User directory path configuration override is saved to file /etc/clickhouse-server/config.d/user-directories.xml.
    58. OpenSSL path configuration override is saved to file /etc/clickhouse-server/config.d/openssl.xml.
    59. Creating log directory /var/log/clickhouse-server.
    60. Creating data directory /var/lib/clickhouse.
    61. Creating pid directory /var/run/clickhouse-server.
    62. chown -R clickhouse:clickhouse '/var/log/clickhouse-server'
    63. chown -R clickhouse:clickhouse '/var/run/clickhouse-server'
    64. chown clickhouse:clickhouse '/var/lib/clickhouse'
    65. Enter password for the default user:
    66. Password for the default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
    67. Setting capabilities for clickhouse binary. This is optional.
    68. 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.
    69. Allow server to accept connections from the network (default is localhost only), [y/N]: y
    70. The choice is saved in file /etc/clickhouse-server/config.d/listen.xml.
    71. chown -R clickhouse:clickhouse '/etc/clickhouse-server'
    72. ClickHouse has been successfully installed.
    73. Start clickhouse-server with:
    74. sudo clickhouse start
    75. Start clickhouse-client with:
    76. clickhouse-client --password
    77. [root@localhost ~]# sudo clickhouse start
    78. chown -R clickhouse: '/var/run/clickhouse-server/'
    79. Will run sudo --preserve-env -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid --daemon
    80. Waiting for server to start
    81. Waiting for server to start
    82. Server started
    83. [root@localhost ~]# clickhouse-client --password
    84. ClickHouse client version 24.6.1.3573 (official build).
    85. Password for user (default):
    86. Connecting to localhost:9000 as user default.
    87. Connected to ClickHouse server version 24.6.1.
    88. Warnings:
    89. * Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
    90. * Linux threads max count is too low. Check /proc/sys/kernel/threads-max
    91. * Available memory at server startup is too low (2GiB).
    92. * Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.
    93. localhost :) show databases;
    94. SHOW DATABASES
    95. Query id: b0e8a288-79c4-4e72-a485-9981f686c153
    96. ┌─name───────────────┐
    97. 1. │ INFORMATION_SCHEMA │
    98. 2. │ default │
    99. 3. │ information_schema │
    100. 4. │ system │
    101. └────────────────────┘
    102. 4 rows in set. Elapsed: 0.003 sec.
    103. localhost :) use defautl;
    104. USE defautl
    105. Query id: 02eb24cc-2362-49be-bbde-79cd037e1b8f
    106. Elapsed: 0.481 sec.
    107. Received exception from server (version 24.6.1):
    108. Code: 81. DB::Exception: Received from localhost:9000. DB::Exception: Database defautl does not exist. Maybe you meant default?. (UNKNOWN_DATABASE)
    109. localhost :) show tables;
    110. SHOW TABLES
    111. Query id: 35c52c21-56fd-43a6-b3be-1add9ca23d2a
    112. Ok.
    113. 0 rows in set. Elapsed: 0.005 sec.
    114. localhost :) exit;
    115. Bye.
    116. [root@localhost ~]#


    '''
    参考:
    https://clickhouse.com/docs/en/install
    '''
     

  • 相关阅读:
    JavaScript学习笔记(未完待续)
    平安人寿“内鬼”泄露近4万条公民信息
    redis 和 mysql 的区别
    LeetCode——29. 两数相除
    jquery的datatable插件
    JSON结构示例
    【Java面试小短文】HashMap中的hash方法为什么要右移16位并异或?
    Distribution (mathematics)
    vue3中若v-model绑定的响应字段出现三级,该如何实现rules验证规则
    七日算法先导(签到)
  • 原文地址:https://blog.csdn.net/yudiandian2014/article/details/139681501