暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Docker方式安装Starrocks

skylines 2024-03-19
525

在Starrocks存算一体模式的安装方式中,官方只提供两种部署文件,一种是二进制安装介质,StarRocks 二进制包的名称格式为 StarRocks-version.tar.gz,这种部署文件只适合CentOS 7.9操作系统安装。另外一种是StarRocks Docker 镜像,可以从 StarRocks Docker Hub 下载下载,这种部署文件适合Ubuntu 22.04和使用ARM架构CPU的操作系统上。见官方文档http://docs.mirrorship.cn/zh/docs/deployment/prepare_deployment_files/。

以下延时使用docker方式安装Starrocks,过程包括在Ubuntu 22.04安装docker engine。

--Ubuntu 22.04安装docker engine

    root@startestdb01:~# apt-get update


    Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy InRelease
    Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates InRelease
    Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-backports InRelease
    Hit:4 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security InRelease
    Reading package lists... Done
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~# sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    ca-certificates is already the newest version (20230311ubuntu0.22.04.1).
    ca-certificates set to manually installed.
    curl is already the newest version (7.81.0-1ubuntu1.15).
    software-properties-common is already the newest version (0.99.22.9).
    software-properties-common set to manually installed.
    The following NEW packages will be installed:
    apt-transport-https gnupg-agent
    0 upgraded, 2 newly installed, 0 to remove and 53 not upgraded.
    Need to get 6,994 B of archives.
    After this operation, 217 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates/universe amd64 apt-transport-https all 2.4.11 [1,510 B]
    Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates/universe amd64 gnupg-agent all 2.2.27-3ubuntu2.1 [5,484 B]
    Fetched 6,994 B in 0s (47.1 kB/s)
    Selecting previously unselected package apt-transport-https.
    (Reading database ... 82223 files and directories currently installed.)
    Preparing to unpack .../apt-transport-https_2.4.11_all.deb ...
    Unpacking apt-transport-https (2.4.11) ...
    Selecting previously unselected package gnupg-agent.
    Preparing to unpack .../gnupg-agent_2.2.27-3ubuntu2.1_all.deb ...
    Unpacking gnupg-agent (2.2.27-3ubuntu2.1) ...
    Setting up apt-transport-https (2.4.11) ...
    Setting up gnupg-agent (2.2.27-3ubuntu2.1) ...
    Scanning processes...
    Scanning linux images...


    Running kernel seems to be up-to-date.


    No services need to be restarted.


    No containers need to be restarted.


    No user sessions are running outdated binaries.


    No VM guests are running outdated hypervisor (qemu) binaries on this host.
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
    OK
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb\_release -cs) stable"
    Repository: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable'
    Description:
    Archive for codename: jammy components: stable
    More info: https://download.docker.com/linux/ubuntu
    Adding repository.
    Press [ENTER] to continue or Ctrl-c to cancel.
    Adding deb entry to etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list
    Adding disabled deb-src entry to etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list
    Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy InRelease
    Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates InRelease
    Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-backports InRelease
    Hit:4 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security InRelease
    0% [Connecting to download.docker.com (108.139.10.9)]
    0% [Connecting to download.docker.com (108.139.10.9)]
    Get:5 https://download.docker.com/linux/ubuntu jammy InRelease [48.8 kB]
    Get:6 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages [27.6 kB]
    Fetched 76.4 kB in 1s (58.2 kB/s)
    Reading package lists... Done
    W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~# sudo apt-get update
    Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy InRelease
    Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates InRelease
    Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-backports InRelease
    Hit:4 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security InRelease
    Hit:5 https://download.docker.com/linux/ubuntu jammy InRelease
    Reading package lists... Done
    W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~#
    root@startestdb01:~# sudo apt-get install docker-ce docker-ce-cli containerd.io
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following additional packages will be installed:
    docker-buildx-plugin docker-ce-rootless-extras docker-compose-plugin libslirp0 pigz slirp4netns
    Suggested packages:
    aufs-tools cgroupfs-mount | cgroup-lite
    The following NEW packages will be installed:
    containerd.io docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin libslirp0 pigz slirp4netns
    0 upgraded, 9 newly installed, 0 to remove and 53 not upgraded.
    Need to get 119 MB of archives.
    After this operation, 424 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy/universe amd64 pigz amd64 2.6-1 [63.6 kB]
    Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu jammy/main amd64 libslirp0 amd64 4.6.1-1build1 [61.5 kB]
    Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu jammy/universe amd64 slirp4netns amd64 1.0.1-2 [28.2 kB]
    Get:4 https://download.docker.com/linux/ubuntu jammy/stable amd64 containerd.io amd64 1.6.28-1 [29.6 MB]
    Get:5 https://download.docker.com/linux/ubuntu jammy/stable amd64 docker-buildx-plugin amd64 0.13.0-1~ubuntu.22.04~jammy [29.5 MB]
    Get:6 https://download.docker.com/linux/ubuntu jammy/stable amd64 docker-ce-cli amd64 5:25.0.4-1~ubuntu.22.04~jammy [13.7 MB]
    Get:7 https://download.docker.com/linux/ubuntu jammy/stable amd64 docker-ce amd64 5:25.0.4-1~ubuntu.22.04~jammy [24.3 MB]
    Get:8 https://download.docker.com/linux/ubuntu jammy/stable amd64 docker-ce-rootless-extras amd64 5:25.0.4-1~ubuntu.22.04~jammy [9,320 kB]
    Get:9 https://download.docker.com/linux/ubuntu jammy/stable amd64 docker-compose-plugin amd64 2.24.7-1~ubuntu.22.04~jammy [12.1 MB]
    Fetched 119 MB in 11s (11.2 MB/s)
    Selecting previously unselected package pigz.
    (Reading database ... 82231 files and directories currently installed.)
    Preparing to unpack .../0-pigz_2.6-1_amd64.deb ...
    Unpacking pigz (2.6-1) ...
    Selecting previously unselected package containerd.io.
    Preparing to unpack .../1-containerd.io_1.6.28-1_amd64.deb ...
    Unpacking containerd.io (1.6.28-1) ...
    Selecting previously unselected package docker-buildx-plugin.
    Preparing to unpack .../2-docker-buildx-plugin_0.13.0-1~ubuntu.22.04~jammy_amd64.deb ...
    Unpacking docker-buildx-plugin (0.13.0-1~ubuntu.22.04~jammy) ...
    Selecting previously unselected package docker-ce-cli.
    Preparing to unpack .../3-docker-ce-cli_5%3a25.0.4-1~ubuntu.22.04~jammy_amd64.deb ...
    Unpacking docker-ce-cli (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Selecting previously unselected package docker-ce.
    Preparing to unpack .../4-docker-ce_5%3a25.0.4-1~ubuntu.22.04~jammy_amd64.deb ...
    Unpacking docker-ce (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Selecting previously unselected package docker-ce-rootless-extras.
    Preparing to unpack .../5-docker-ce-rootless-extras_5%3a25.0.4-1~ubuntu.22.04~jammy_amd64.deb ...
    Unpacking docker-ce-rootless-extras (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Selecting previously unselected package docker-compose-plugin.
    Preparing to unpack .../6-docker-compose-plugin_2.24.7-1~ubuntu.22.04~jammy_amd64.deb ...
    Unpacking docker-compose-plugin (2.24.7-1~ubuntu.22.04~jammy) ...
    Selecting previously unselected package libslirp0:amd64.
    Preparing to unpack .../7-libslirp0_4.6.1-1build1_amd64.deb ...
    Unpacking libslirp0:amd64 (4.6.1-1build1) ...
    Selecting previously unselected package slirp4netns.
    Preparing to unpack .../8-slirp4netns_1.0.1-2_amd64.deb ...
    Unpacking slirp4netns (1.0.1-2) ...
    Setting up docker-buildx-plugin (0.13.0-1~ubuntu.22.04~jammy) ...
    Setting up containerd.io (1.6.28-1) ...
    Created symlink etc/systemd/system/multi-user.target.wants/containerd.service → lib/systemd/system/containerd.service.
    Setting up docker-compose-plugin (2.24.7-1~ubuntu.22.04~jammy) ...
    Setting up docker-ce-cli (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Setting up libslirp0:amd64 (4.6.1-1build1) ...
    Setting up pigz (2.6-1) ...
    Setting up docker-ce-rootless-extras (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Setting up slirp4netns (1.0.1-2) ...
    Setting up docker-ce (5:25.0.4-1~ubuntu.22.04~jammy) ...
    Created symlink etc/systemd/system/multi-user.target.wants/docker.service → lib/systemd/system/docker.service.
    Created symlink etc/systemd/system/sockets.target.wants/docker.socket → lib/systemd/system/docker.socket.
    Processing triggers for man-db (2.10.2-1) ...
    Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
    Scanning processes...
    Scanning linux images...


    Running kernel seems to be up-to-date.


    No services need to be restarted.


    No containers need to be restarted.


    No user sessions are running outdated binaries.


    No VM guests are running outdated hypervisor (qemu) binaries on this host.
    root@startestdb01:~#
    root@startestdb01:~# sudo systemctl start docker
    root@startestdb01:~#
    root@startestdb01:~# docker --version
    Docker version 25.0.4, build 1a576c5
    root@startestdb01:~#


    --docker容器部署Starrocks

      Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-92-generic x86_64)


      * Documentation: https://help.ubuntu.com
      * Management: https://landscape.canonical.com
      * Support: https://ubuntu.com/pro


      System information as of Mon Mar 18 07:16:54 PM CST 2024


      System load: 0.05126953125 Processes: 120
      Usage of : 7.0% of 48.85GB Users logged in: 1
      Memory usage: 20% IPv4 address for docker0: 172.18.0.1
      Swap usage: 0% IPv4 address for eth0: 172.17.7.11


      * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
      just raised the bar for easy, resilient and secure K8s cluster deployment.


      https://ubuntu.com/engage/secure-kubernetes-at-the-edge


      Expanded Security Maintenance for Applications is not enabled.


      53 updates can be applied immediately.
      26 of these updates are standard security updates.
      To see these additional updates run: apt list --upgradable


      2 additional security updates can be applied with ESM Apps.
      Learn more about enabling ESM Apps service at https://ubuntu.com/esm






      Welcome to Alibaba Cloud Elastic Compute Service !


      Last login: Mon Mar 18 18:03:56 2024 from 223.104.63.35
      root@startestdb01:~#


      root@startestdb01:~# docker search starrocks
      NAME DESCRIPTION STARS OFFICIAL
      starrocks/fe-ubuntu 3
      starrocks/operator 1
      starrocks/allin1-ubuntu 5
      starrocks/be-ubuntu 4
      starrocks/cn-ubuntu 0
      starrocks/dev-env-centos7 7
      starrocks/dev-env-ubuntu 0
      starrocks/toolchains-centos7 0
      starrocks/allin1-ubi 0
      starrocks/artifacts-ubuntu 0
      starrocks/starlet-artifacts-centos7 0
      starrocks/toolchains-ubuntu 0
      starrocks/starlet-artifacts-ubuntu22 0
      starrocks/artifacts-centos7 0
      d87904488/starrocks-starter StarRocks docker images for starter, learnin… 0
      starrocks/be-ubi 0
      starrocks/fe-ubi 0
      starrocks/cn-ubi 0
      starrocks/static-debian11 0
      starrocks/destination-starrocks 0
      screnwei/starrocks-computenodegroup 0
      starrocks/starlet-dev-env-ubuntu22 0
      starrocks/starlet-dev-env-centos7 0
      d87904488/starrocks-docker-dev One-click StarRocks Docker development envir… 0
      landnow/starrocks-computenodegroup [wx:landnow]Kubernetes image, starrocks-comp… 0
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~# docker pull starrocks/starrocks:v3.2.1
      Error response from daemon: pull access denied for starrocks/starrocks, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~# docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd starrocks.docker.scarf.sh/starrocks/allin1-ubuntu
      Unable to find image 'starrocks.docker.scarf.sh/starrocks/allin1-ubuntu:latest' locally
      latest: Pulling from starrocks/allin1-ubuntu
      bccd10f490ab: Pull complete
      72309d075652: Pull complete
      feaff302b015: Pull complete
      3880565b2b14: Pull complete
      3609cd502a5d: Pull complete
      9bdc47d07866: Downloading [=============> ] 345.9MB/1.283GB
      50ae5afe7959: Download complete
      de7586a7c43f: Download complete
      d6b64f21c2f5: Download complete
      ea1dc9afb074: Download complete
      Digest: sha256:13e15f455a09c11f07d6fdda567197e8ae9dfffae407f457c8a8309c9da57610
      Status: Downloaded newer image for starrocks.docker.scarf.sh/starrocks/allin1-ubuntu:latest
      2ecaa8cab9efdf40d69e82af4e80c11a2f7a1dde67896c432f52eb01059ccbed


      root@s
      root@startestdb01:~# apt install mysql-client-core-8.0
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      The following NEW packages will be installed:
      mysql-client-core-8.0
      0 upgraded, 1 newly installed, 0 to remove and 53 not upgraded.
      Need to get 2,692 kB of archives.
      After this operation, 62.0 MB of additional disk space will be used.
      Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates/main amd64 mysql-client-core-8.0 amd64 8.0.36-0ubuntu0.22.04.1 [2,692 kB]
      Fetched 2,692 kB in 0s (18.8 MB/s)
      Selecting previously unselected package mysql-client-core-8.0.
      (Reading database ... 82490 files and directories currently installed.)
      Preparing to unpack .../mysql-client-core-8.0_8.0.36-0ubuntu0.22.04.1_amd64.deb ...
      Unpacking mysql-client-core-8.0 (8.0.36-0ubuntu0.22.04.1) ...
      Setting up mysql-client-core-8.0 (8.0.36-0ubuntu0.22.04.1) ...
      Processing triggers for man-db (2.10.2-1) ...
      Scanning processes...
      Scanning linux images...


      Running kernel seems to be up-to-date.


      No services need to be restarted.


      No containers need to be restarted.


      No user sessions are running outdated binaries.


      No VM guests are running outdated hypervisor (qemu) binaries on this host.
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~#
      root@startestdb01:~# mysql -P9030 -h127.0.0.1 -uroot --prompt="StarRocks > "
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 10
      Server version: 5.1.0 3.2.4-613f0b5


      Copyright (c) 2000, 2024, Oracle and/or its affiliates.


      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.


      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


      StarRocks >
      StarRocks >
      StarRocks > SELECT version();
      +-----------+
      | version() |
      +-----------+
      | 5.1.0 |
      +-----------+
      1 row in set (0.10 sec)


      StarRocks >
      StarRocks > exit
      Bye
      root@startestdb01:~# tartestdb01:~# docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      2ecaa8cab9ef starrocks.docker.scarf.sh/starrocks/allin1-ubuntu "/bin/sh -c ./entryp…" 48 minutes ago Up 48 minutes 0.0.0.0:8030->8030/tcp, :::8030->8030/tcp, 0.0.0.0:8040->8040/tcp, :::8040->8040/tcp, 0.0.0.0:9030->9030/tcp, :::9030->9030/tcp gallant_tharp





      --从docker容器tar打包starrocks安装包并复制到宿主机上

        root@startestdb01:~# docker exec -it 2ecaa8cab9ef sh
        #
        #
        # pwd
        /data/deploy
        # ls
        banner.txt entrypoint.sh starrocks


        # ls -lrt
        total 2088
        -rw-rw-r-- 1 root root 10234 Feb 2 10:47 LICENSE.txt
        -rw-r--r-- 1 root root 2088768 Mar 11 12:19 NOTICE.txt
        drwxr-xr-x 1 root root 4096 Mar 18 12:30 apache_hdfs_broker
        drwxrwxr-x 1 root root 4096 Mar 18 12:30 supervisor
        drwxrwxr-x 1 root root 4096 Mar 18 12:30 feproxy
        drwxr-xr-x 1 root root 4096 Mar 18 12:30 be
        drwxr-xr-x 1 root root 4096 Mar 18 12:31 fe
        drwxrwxr-x 1 root root 4096 Mar 18 12:31 director
        #


        # tar -zcvf starRocks.tar.gz starRocks/
        starRocks/
        starRocks/apache_hdfs_broker/
        starRocks/apache_hdfs_broker/log/
        starRocks/apache_hdfs_broker/log/apache_hdfs_broker.log
        starRocks/apache_hdfs_broker/log/apache_hdfs_broker.out
        starRocks/apache_hdfs_broker/lib/
        starRocks/apache_hdfs_broker/lib/okio-2.8.0.jar
        starRocks/apache_hdfs_broker/lib/netty-codec-dns-4.1.89.Final.jar
        starRocks/apache_hdfs_broker/lib/jersey-servlet-1.19.4.jar
        starRocks/apache_hdfs_broker/lib/netty-all-4.1.89.Final.jar
        starRocks/apache_hdfs_broker/lib/javax.servlet-api-3.1.0.jar
        starRocks/apache_hdfs_broker/lib/netty-resolver-dns-4.1.89.Final.jar
        starRocks/apache_hdfs_broker/lib/netty-codec-xml-4.1.89.Final.jar
        starRocks/apache_hdfs_broker/lib/kerb-identity-1.0.1.jar
        ... ...


        starRocks/fe/spark-dpp/spark-dpp-1.0.0-jar-with-dependencies.jar
        starRocks/fe/bin/
        starRocks/fe/bin/build/
        starRocks/fe/bin/build/converter.jar
        starRocks/fe/bin/build/async-profiler.jar
        starRocks/fe/bin/build/fdtransfer
        starRocks/fe/bin/build/libasyncProfiler.so
        starRocks/fe/bin/build/jattach
        starRocks/fe/bin/profiler.sh
        starRocks/fe/bin/common.sh
        starRocks/fe/bin/show_fe_version.sh
        starRocks/fe/bin/stop_fe.sh
        starRocks/fe/bin/fe.pid
        starRocks/fe/bin/start_fe.sh

        # pwd
        /data/deploy
        # ls
        banner.txt entrypoint.sh starRocks starRocks.tar.gz starrocks
        # exit
        root@startestdb01:~#
        root@startestdb01:~#
        root@startestdb01:~# docker cp 2ecaa8cab9ef:/data/deploy/starRocks.tar.gz /usr/local/
        Copying from container - 0B24.8MB50.1MB65.7MB73MB79.3MB82.8MB87.7MB91.8MB91.9MB94




        root@startestdb01:/usr/local# ls -lrt
        total 3244788
        drwxr-xr-x 2 root root 4096 Apr 21 2022 src
        lrwxrwxrwx 1 root root 9 Apr 21 2022 man -> share/man
        drwxr-xr-x 2 root root 4096 Apr 21 2022 include
        drwxr-xr-x 2 root root 4096 Apr 21 2022 games
        drwxr-xr-x 2 root root 4096 Apr 21 2022 etc
        drwxr-xr-x 2 root root 4096 Apr 21 2022 bin
        drwxr-xr-x 2 root root 4096 Apr 21 2022 sbin
        drwxr-xr-x 3 root root 4096 Apr 21 2022 lib
        -rw-rw-r-- 1 root root 10234 Feb 2 18:47 LICENSE.txt
        -rw-r--r-- 1 root root 2088768 Mar 11 20:19 NOTICE.txt
        drwxr-xr-x 7 root root 4096 Mar 18 17:17 share
        drwxr-xr-x 9 root root 4096 Mar 18 18:03 aegis
        -rw-r--r-- 1 root root 3320520221 Mar 18 22:14 starRocks.tar.gz
        root@startestdb01:/usr/local#
        root@startestdb01:/usr/local#

        文章转载自skylines,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

        评论