设为首页 收藏本站
查看: 1164|回复: 0

[经验分享] ClickHouse 快速入门

[复制链接]

尚未签到

发表于 2017-6-4 09:31:58 | 显示全部楼层 |阅读模式
root@GlonHo:~# grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"  SSE 4.2 supported
  root@GlonHo:/etc/apt/sources.list.d# vim clickhouse.list
  deb http://repo.yandex.ru/clickhouse/trusty stable main
  root@GlonHo:~# apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4
  Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.IoJhY8ePkd --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv E0C56BD4
  gpg: requesting key E0C56BD4 from hkp server keyserver.ubuntu.com
  gpg: key E0C56BD4: public key &quot;ClickHouse Repository Key <milovidov@yandex-team.ru>&quot; imported
  gpg: Total number processed: 1
  gpg:               imported: 1  (RSA: 1)
  root@GlonHo:~# apt-get update
  Hit http://security.ubuntu.com trusty-security InRelease                     
  Ign http://archive.ubuntu.com trusty InRelease                                 
  ...   
  Reading package lists... Done
  root@GlonHo:~#
  root@GlonHo:~# apt-get install clickhouse-client clickhouse-server-common
  Reading package lists... Done
  Building dependency tree      
  Reading state information... Done
  The following packages were automatically installed and are no longer required:
  acl at-spi2-core colord dconf-gsettings-backend dconf-service fontconfig
  fontconfig-config fonts-dejavu-core hicolor-icon-theme libasound2
  libasound2-data libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0
  libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2
  libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcolord1
  libcolorhug1 libcups2 libdatrie1 libdconf1 libdrm-intel1 libdrm-nouveau2
  libdrm-radeon1 libexif12 libfontconfig1 libfontenc1 libgd3
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri libgl1-mesa-glx
  libglapi-mesa libgphoto2-6 libgphoto2-l10n libgphoto2-port10 libgraphite2-3
  libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libgusb2
  libharfbuzz0b libice6 libieee1284-3 libjasper1 libjbig0 libjpeg-turbo8
  libjpeg8 liblcms2-2 libllvm3.4 libltdl7 libnotify-bin libnotify4 libogg0
  libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpciaccess0
  libpixman-1-0 libsane libsane-common libsm6 libtdb1 libthai-data libthai0
  libtiff5 libtxc-dxtn-s2tc0 libv4l-0 libv4lconvert0 libvorbis0a
  libvorbisfile3 libvpx1 libwayland-client0 libwayland-cursor0 libx11-xcb1
  libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0
  libxcb-render0 libxcb-shm0 libxcb-sync1 libxcomposite1 libxcursor1
  libxdamage1 libxfixes3 libxfont1 libxi6 libxinerama1 libxkbcommon0
  libxkbfile1 libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxt6
  libxtst6 libxxf86vm1 notification-daemon sound-theme-freedesktop x11-common
  x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common
  xserver-xorg-core
  Use 'apt-get autoremove' to remove them.
  The following extra packages will be installed:
  clickhouse-server-base
  The following NEW packages will be installed:
  clickhouse-client clickhouse-server-base clickhouse-server-common
  0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  Need to get 198 MB of archives.
  After this operation, 632 MB of additional disk space will be used.
  Do you want to continue? [Y/n] y
  Get:1 http://repo.yandex.ru/clickhouse/trusty/ stable/main clickhouse-server-base amd64 1.1.54198 [198 MB]
  Get:2 http://repo.yandex.ru/clickhouse/trusty/ stable/main clickhouse-client amd64 1.1.54198 [2,674 B]
  Get:3 http://repo.yandex.ru/clickhouse/trusty/ stable/main clickhouse-server-common amd64 1.1.54198 [7,578 B]
  Fetched 198 MB in 18min 7s (182 kB/s)                                          
  Selecting previously unselected package clickhouse-server-base.
  (Reading database ... 62852 files and directories currently installed.)
  Preparing to unpack .../clickhouse-server-base_1.1.54198_amd64.deb ...
  Unpacking clickhouse-server-base (1.1.54198) ...
  Selecting previously unselected package clickhouse-client.
  Preparing to unpack .../clickhouse-client_1.1.54198_amd64.deb ...
  Unpacking clickhouse-client (1.1.54198) ...
  Selecting previously unselected package clickhouse-server-common.
  Preparing to unpack .../clickhouse-server-common_1.1.54198_amd64.deb ...
  Unpacking clickhouse-server-common (1.1.54198) ...
  Processing triggers for ureadahead (0.100.0-16) ...
  Setting up clickhouse-server-base (1.1.54198) ...
  Processing triggers for ureadahead (0.100.0-16) ...
  Setting up clickhouse-client (1.1.54198) ...
  Setting up clickhouse-server-common (1.1.54198) ...
  root@GlonHo:~#
  root@GlonHo:~# top
  Tasks:  90 total,   2 running,  88 sleeping,   0 stopped,   0 zombie

  %Cpu(s):  0.0 us,  0.2 sy,  0.0 ni, 99.8>  KiB Mem:   2049856 total,  1147260 used,   902596 free,    16004 buffers
  KiB Swap:        0 total,        0 used,        0 free.   960556 cached Mem
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                 
  1262 root      20   0  112712  34552   1112 S   0.0  1.7   0:00.00 ruby                                                                                                                    
  1196 root      20   0  182364  34428   2728 S   0.0  1.7   0:00.77 puppet                                                                                                                  
  **2368 clickho+  20   0  241336  12524   3504 S   0.0  0.6   0:00.04 clickhouse-serv**                                                                                                         
  1973 root      20   0  107720   4216   3220 S   0.0  0.2   0:00.02 sshd      
  root@GlonHo:~# ls /var/log/clickhouse-server/
  clickhouse-server.err.log  clickhouse-server.log  stderr  stdout
  root@GlonHo:~# cat /var/log/clickhouse-server/clickhouse-server.err.log
  2017.04.24 09:30:03.783101 [ 1 ] <Warning> ConfigProcessor: Include not found: networks
  2017.04.24 09:30:03.783125 [ 1 ] <Warning> ConfigProcessor: Include not found: networks
  2017.04.24 09:30:05.803298 [ 2 ] <Warning> ConfigProcessor: Include not found: clickhouse_remote_servers
  2017.04.24 09:30:05.803353 [ 2 ] <Warning> ConfigProcessor: Include not found: clickhouse_compression
  root@GlonHo:~#
  root@GlonHo:~# cat /var/log/clickhouse-server/clickhouse-server.log
  2017.04.24 09:30:03.708578 [ 1 ] <Information> : Starting daemon with revision 54198
  2017.04.24 09:30:03.781176 [ 1 ] <Information> Application: starting up
  2017.04.24 09:30:03.781650 [ 1 ] <Debug> Application: rlimit on number of file descriptors is 262144
  2017.04.24 09:30:03.781664 [ 1 ] <Debug> Application: Initializing DateLUT.
  2017.04.24 09:30:03.781670 [ 1 ] <Trace> Application: Initialized DateLUT with time zone `UTC'.
  2017.04.24 09:30:03.782226 [ 1 ] <Debug> Application: Configuration parameter 'interserver_http_host' doesn't exist or exists and empty. Will use 'ubuntu' as replica host.
  2017.04.24 09:30:03.782338 [ 1 ] <Debug> ConfigReloader: Loading config `/etc/clickhouse-server/users.xml'
  2017.04.24 09:30:03.783093 [ 1 ] <Warning> ConfigProcessor: Include not found: networks
  2017.04.24 09:30:03.783121 [ 1 ] <Warning> ConfigProcessor: Include not found: networks
  2017.04.24 09:30:03.783472 [ 1 ] <Information> Application: Loading metadata.
  2017.04.24 09:30:03.783610 [ 1 ] <Information> DatabaseOrdinary (default): Total 0 tables.
  2017.04.24 09:30:03.783734 [ 1 ] <Debug> Application: Loaded metadata.
  2017.04.24 09:30:03.783848 [ 1 ] <Information> DatabaseOrdinary (system): Total 0 tables.
  2017.04.24 09:30:03.784376 [ 1 ] <Information> Application: Listening http://[::1]:8123
  2017.04.24 09:30:03.784420 [ 1 ] <Information> Application: Listening tcp: [::1]:9000
  2017.04.24 09:30:03.784448 [ 1 ] <Information> Application: Listening interserver: [::1]:9009
  2017.04.24 09:30:03.784473 [ 1 ] <Information> Application: Listening http://127.0.0.1:8123
  2017.04.24 09:30:03.784491 [ 1 ] <Information> Application: Listening tcp: 127.0.0.1:9000
  2017.04.24 09:30:03.784507 [ 1 ] <Information> Application: Listening interserver: 127.0.0.1:9009
  2017.04.24 09:30:03.784621 [ 1 ] <Information> Application: Ready for connections.
  2017.04.24 09:30:05.801608 [ 2 ] <Debug> ConfigReloader: Loading config `/etc/clickhouse-server/config.xml'
  2017.04.24 09:30:05.803274 [ 2 ] <Warning> ConfigProcessor: Include not found: clickhouse_remote_servers
  2017.04.24 09:30:05.803348 [ 2 ] <Warning> ConfigProcessor: Include not found: clickhouse_compression
  root@GlonHo:~# cat /var/log/clickhouse-server/stderr
  Should logs to /var/log/clickhouse-server/clickhouse-server.log
  Should error logs to /var/log/clickhouse-server/clickhouse-server.err.log
  root@GlonHo:~# clickhouse-client
  ClickHouse client version 1.1.54198.
  Connecting to localhost:9000.
  Connected to ClickHouse server version 1.1.54198.
  :)
  :) select 1
  SELECT 1
  ┌─1─┐
  │ 1 │
  └───┘
  1 rows in set. Elapsed: 0.023 sec.
  :)
  :) select now()
  SELECT now()
  ┌───────────────now()─┐
  │ 2017-04-24 09:37:31 │
  └─────────────────────┘
  1 rows in set. Elapsed: 0.005 sec.
  :)
  :) Bye. (CTRL + d 退出客户端)
  root@GlonHo:~# service clickhouse-server stop
  Stop clickhouse-server service: DONE

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-383369-1-1.html 上篇帖子: Docker存储方式选型建议 下篇帖子: 基于Activiti的流程应用开发平台JSAAS-WF V5.3
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表