How to install Apache Superset Docker Image on Linux CentOS7 that without internet

本文介绍了如何在没有互联网连接的CentOS 7系统上安装Docker和Docker Compose,并从Docker Hub下载Apache Superset及hello-world镜像,通过本地上传并运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Step 1: Login Linux and check the CentOS version

[root@bigdatasmallteam ~]# whoami
root
[root@bigdatasmallteam ~]# free
              total        used        free      shared  buff/cache   available
Mem:       16247588     1266648    11102236      274164     3878704    14368600
Swap:       9957372           0     9957372
[root@bigdatasmallteam ~]#

How to Install Docker on Linux CentOS 7.9
Step 1: Check Linux CentOS version:
[root@bigdatasmallteam ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

Step 2: Update the system in CentOS 7

[root@bigdatasmallteam ~]# sudo yum check-update
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, search-disabled-repos, subscription-manager,
              : tracer_upload, versionlock
Loading mirror speeds from cached hostfile
PwC_CentOS_7_Base                                                                                     | 2.1 kB  00:00:00
PwC_CentOS_7_Extras                                                                                   | 2.1 kB  00:00:00
PwC_CentOS_7_Updates                                                                                  | 2.1 kB  00:00:00
PwC_Docker_Docker-CE                                                                                  | 2.1 kB  00:00:00
PwC_EPEL_7_EPEL                                                                                       | 2.6 kB  00:00:00
PwC_EPEL_7_Supplementary_EPEL_Created_by_PwC                                                          | 2.1 kB  00:00:00
PwC_Foreman_1_22_Foreman_Client                                                                       | 2.1 kB  00:00:00
PwC_Foreman_2_1_Foreman_Client                                                                        | 2.1 kB  00:00:00
PwC_Microsoft_Linux_Software_Repository_7_prod                                                        | 2.1 kB  00:00:00

mdatp.x86_64                            101.53.02-1                            PwC_Microsoft_Linux_Software_Repository_7_prod
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id, subscription-manager, versionlock
[root@bigdatasmallteam ~]#

Step 3: Get the docker compose from github

If the server can connect the github, then run below script. Otherwise, download the docker compose and then upload to the CentOS server.**

How to install Docker on Linux CentOS 7.9

[root@iZ2zehb3zobkh31kn9cuo2Z ~]# curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose

[root@bigdatasmallteam ~]# mkdir -p ~/.docker/cli-plugins/

Step 4: Download the Docker Compose

https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 on Windows

Upload docker-compose-linux-x86_64 to the server folder

[root@bigdatasmallteam ~]# pwd

/root

[root@bigdatasmallteam ~]# cp /home/CN_SSH_USER_02/docker-compose-linux-x86_64 /root/.docker/cli-plugins/

[root@bigdatasmallteam ~]# ls -l /root/.docker/cli-plugins/

total 24128

-rw------- 1 root root 24707072 Mar 3 13:33 docker-compose-linux-x86_64

[root@bigdatasmallteam ~]#

Install docker on Linux:

Docker Documentation – 16 Mar 22

Install Docker Engine

Lists the installation methods

Docker Documentation – 16 Mar 22

Install Docker Engine on CentOS

Instructions for installing Docker Engine on CentOS

[root@bigdatasmallteam ~]# sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, search-disabled-repos, subscription-manager, tracer_upload, versionlock
Loading mirror speeds from cached hostfile
PwC_CentOS_7_Base                                                                                                                          | 2.1 kB  00:00:00
PwC_CentOS_7_Extras                                                                                                                        | 2.1 kB  00:00:00
PwC_CentOS_7_Updates                                                                                                                       | 2.1 kB  00:00:00
PwC_Docker_Docker-CE                                                                                                                       | 2.1 kB  00:00:00
PwC_EPEL_7_EPEL                                                                                                                            | 2.6 kB  00:00:00
PwC_EPEL_7_Supplementary_EPEL_Created_by_PwC                                                                                               | 2.1 kB  00:00:00
PwC_Foreman_1_22_Foreman_Client                                                                                                            | 2.1 kB  00:00:00
PwC_Foreman_2_1_Foreman_Client                                                                                                             | 2.1 kB  00:00:00
PwC_Microsoft_Linux_Software_Repository_7_prod                                                                                             | 2.1 kB  00:00:00

mdatp.x86_64                                              101.53.02-1                                               PwC_Microsoft_Linux_Software_Repository_7_prod
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id, subscription-manager, versionlock
[root@bigdatasmallteam ~]# sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, search-disabled-repos, subscription-manager, tracer_upload, versionlock
Loading mirror speeds from cached hostfile
PwC_CentOS_7_Base                                                                                                                          | 2.1 kB  00:00:00
PwC_CentOS_7_Extras                                                                                                                        | 2.1 kB  00:00:00
PwC_CentOS_7_Updates                                                                                                                       | 2.1 kB  00:00:00
PwC_Docker_Docker-CE                                                                                                                       | 2.1 kB  00:00:00
PwC_EPEL_7_EPEL                                                                                                                            | 2.6 kB  00:00:00

Step 5: Start Docker and check docker status

[root@bigdatasmallteam ~]# sudo systemctl start docker
[root@bigdatasmallteam ~]# sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-03-03 13:43:38 HKT; 2min 16s ago
     Docs: https://docs.docker.com
 Main PID: 109474 (dockerd)
    Tasks: 7
   Memory: 31.2M
   CGroup: /system.slice/docker.service
           └─109474 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mar 03 13:43:37 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:37.994893444+08:00" level=info msg="failed to read ipv6 net.ipv6.conf.<bridge>....accept_ra
Mar 03 13:43:37 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:37.994920496+08:00" level=info msg="failed to read ipv6 net.ipv6.conf.<bridge>....accept_ra
Mar 03 13:43:38 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:38.197460756+08:00" level=info msg="Loading containers: done."
Mar 03 13:43:38 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:38.254772674+08:00" level=info msg="Docker daemon" commit=459d0df graphdriver(s...=20.10.12
Mar 03 13:43:38 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:38.254901669+08:00" level=info msg="Daemon has completed initialization"
Mar 03 13:43:38 bigdatasmallteam systemd[1]: Started Docker Application Container Engine.
Mar 03 13:43:38 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:38.323577822+08:00" level=info msg="API listen on /var/run/docker.sock"
Mar 03 13:43:46 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:46.451376542+08:00" level=warning msg="Error getting v2 registry: Get \"https:/... by peer"
Mar 03 13:43:46 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:46.451424609+08:00" level=info msg="Attempting next endpoint for pull after err... by peer"
Mar 03 13:43:46 bigdatasmallteam dockerd[109474]: time="2022-03-03T13:43:46.460385769+08:00" level=error msg="Handler for POST /v1.41/images/create retu... by peer"
Hint: Some lines were ellipsized, use -l to show in full.

Step 6: Create a user superset_user for Apache superset.

[root@bigdatasmallteam ~]# whoami
root
[root@bigdatasmallteam ~]# sudo useradd superset_user
[root@bigdatasmallteam ~]# sudo usermod -aG docker superset_user


[root@bigdatasmallteam ~]# docker --version
Docker version 20.10.12, build e91ed57

Step 7: Check the docker hello-world.

[superset_user@bigdatasmallteam ~]$ whoami
superset_user
[superset_user@bigdatasmallteam ~]$ docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp 10.158.34.75:36406->54.86.228.181:443: read: connection reset by peer.
See 'docker run --help'.
[superset_user@bigdatasmallteam ~]$

This issue because this server cannot connect the internet (https://hub.docker.com).

Step 8: Download the hello-world docker image and apache superset docker image from https://hub.docker.com

Assuming we have another Linux on Aliyun that can download the docker images.

Download: docker hello-world
Docker Hub

Linux of Aliyun Server:

Download Hello-world docker image.

root@iZj6c746e7oevje00s2gumZ:~# docker -v
Docker version 20.10.12, build e91ed57

root@iZj6c746e7oevje00s2gumZ:~# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:4c5f3db4f8a54eb1e017c385f683a2de6e06f75be442dc32698c9bbe6c861edd
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest

root@iZj6c746e7oevje00s2gumZ:
<think>好的,我现在需要在CentOS 7上使用Docker部署Apache Superset。首先,我应该回顾一下用户提供的参考信息。引用[1]提到启动Docker的命令是sudo systemctl start docker,然后拉取hello-world镜像来验证安装是否正确。引用[2]和[3]都提到了使用Docker Compose来部署Superset,并且需要安装cpolar进行内网穿透,不过用户可能暂时不需要远程访问部分,先专注于部署。 首先,我需要确认CentOS 7上已经安装了DockerDocker Compose。根据引用[1],安装Docker后需要启动服务并验证。CentOS 7Docker安装步骤可能包括添加仓库、安装docker-ce,然后启动服务。接下来,安装Docker Compose可能需要从GitHub下载二进制文件。 然后,克隆Superset的代码仓库,使用docker compose启动。引用[2]和[3]都提到了这一点,但具体的仓库地址可能需要确认。通常,Superset的官方文档可能推荐使用他们的GitHub仓库中的docker-compose.yml文件。 在步骤中,需要注意权限问题,比如使用sudo或者在docker命令前加上sudo。另外,初始化Superset时可能需要创建管理员账户、迁移数据库、初始化角色等步骤,这些在官方Docker部署流程中常见。 用户的问题是如何在CentOS 7上部署,所以步骤需要针对CentOS的环境调整。例如,安装依赖包时可能使用yum而不是apt,防火墙设置可能需要用到firewalld而不是ufw。 最后,确保所有步骤正确无误,并且检查Superset是否在本地可以通过浏览器访问,比如http://localhost:8088。如果有问题,可能需要检查Docker容器日志,或者端口是否正确映射。 现在需要将这些步骤整理成一个清晰的指南,确保每个步骤都正确,并符合用户提供的引用中的方法,同时适用于CentOS 7。</think>### 在 CentOS 7 上使用 Docker 部署 Apache Superset 的详细步骤 #### 1. **安装 DockerDocker Compose** - **安装 Docker** 执行以下命令: ```bash sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum install docker-ce docker-ce-cli containerd.io sudo systemctl start docker sudo systemctl enable docker ``` 验证 Docker 是否安装成功: ```bash sudo docker run hello-world ``` 若显示 `Hello from Docker!` 表示安装成功[^1]。 - **安装 Docker Compose** 下载二进制文件并赋予执行权限: ```bash sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose ``` 验证版本: ```bash docker-compose --version ``` --- #### 2. **部署 Apache Superset** - **克隆 Superset 代码库** 使用官方提供的 `docker-compose.yml`: ```bash git clone https://github.com/apache/superset.git cd superset ``` - **启动 Superset 服务** 使用 Docker Compose 启动容器: ```bash docker-compose -f docker-compose-non-dev.yml up -d ``` 此过程会拉取镜像并启动数据库、RedisSuperset 等组件[^3]。 --- #### 3. **初始化 Superset** - **创建管理员账户** 执行以下命令进入 Superset 容器: ```bash docker exec -it superset_app bash ``` 在容器内初始化账户: ```bash superset fab create-admin \ --username admin \ --firstname John \ --lastname Doe \ --email admin@example.com \ --password admin ``` - **迁移数据库并初始化角色** 在容器内执行: ```bash superset db upgrade superset init ``` --- #### 4. **访问 Superset** - 在浏览器中访问 `http://localhost:8088`,使用账号 `admin` 和密码 `admin` 登录[^2]。 - 若需远程访问,需配置防火墙开放端口: ```bash sudo firewall-cmd --permanent --add-port=8088/tcp sudo firewall-cmd --reload ``` --- #### 5. **验证服务状态** - 查看容器运行状态: ```bash docker-compose -f docker-compose-non-dev.yml ps ``` - 若容器异常,检查日志: ```bash docker logs superset_app ``` --- ### 常见问题解决 - **端口冲突**:若 `8088` 端口被占用,修改 `docker-compose-non-dev.yml` 中的端口映射,如 `8080:8088`。 - **数据库初始化失败**:确保 PostgreSQL 和 Redis 容器正常启动,尝试重新执行 `superset db upgrade`。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值