Use Docker to deploy Apache Superset and achieve remote access over the public network

Big data visual BI analysis tool Apache Superset enables remote access over the public network

Article directory

  • Big data visual BI analysis tool Apache Superset enables remote access over the public network
    • Preface
    • 1. Deploy Apache Superset using Docker
      • 1.1 The first step is to install docker and docker compose
      • 1.2 Clone the superset code locally and start it using docker compose
    • 2. Install cpolar intranet penetration to achieve public network access
    • 3. Set the fixed connection public network address

Foreword

Superset is a “modern enterprise-level BI (Business Intelligence) Web application” open sourced by a well-known Chinese technology company. It provides lightweight data query and visualization solutions for data analysis by creating and sharing dashboards. Superset has powerful functions in data processing and visualization, which can meet enterprise-level data analysis needs and provide users with intuitive and flexible data exploration and display methods. Through Superset, users can easily extract valuable information from massive data to help enterprises make more informed decisions. In addition, team collaboration for data analysis can be combined with popular domestic intranet penetration tools to achieve real-time remote access to data from the public network.

Superset Logo

1. Deploy Apache Superset using Docker

Use Docker compose to deploy Apache Superset in docker

Instructions: Deployment steps follow the instructions on the superset official website

All About Docker & Containers - What Is It & Why Do We Need It?

1.1 The first step is to install docker and docker compose

Here you choose to download the rpm package manually and then install it using yum install *.rpm.
Download address: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

Note: Please select your corresponding system – please refer to this page https://docs.docker.com/engine/install/.

Download the rpm package as follows:
containerd.io-1.6.18-3.1.el7.x86_64.rpm

docker-ce-cli-23.0.1-1.el7.x86_64.rpm

docker-scan-plugin-0.23.0-1.el7.x86_64.rpm

docker-buildx-plugin-0.10.2-1.el7.x86_64.rpm

docker -ce-rootless-extras-23.0.1-1.el7.x86_64.rpm

docker-ce-23.0.1-1.el7.x86_64.rpm

docker-compose-plugin-2.16.0-1.el7.x86_64.rpm

Manually upload these packages to the centos system, for example:
I uploaded these packages to the /opt/dockerpackage directory
Then execute yum install /opt/dockerpackage/*.rpm.

At this point, the installation of docker and docker compose is completed.

Note: It is best that your computer has an Internet connection. There should be some dependencies that need to be installed.

These dependencies are listed here. If you don't have an Internet connection, it will be troublesome. You have to find the corresponding version to download by yourself.
 audit-libs-python x86_64 2.8.5-4.el7 base 76k
 checkpolicy x86_64 2.5-8.el7 base 295k
 container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40k
 fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54k
 fuse3-libs x86_64 3.6.1-4.el7 extras 82k
 libcgroup x86_64 0.41-21.el7 base 66k
 libsemanage-python x86_64 2.5-14.el7 base 113k
 policycoreutils-python x86_64 2.5-34.el7 base 457k
 python-IPy noarch 0.75-6.el7 base 32k
 setools-libs x86_64 3.3.8-4.el7 base 620k
 slirp4netns x86_64 0.4.3-4.el7_8 extras 81k

Verify here whether docker is installed
Start docker: sudo systemctl start docker
Pull a hello world and execute it: sudo docker run hello-world
Seeing Hello from Docker means it’s OK.

Note: The hello-world image here will be pulled from the warehouse. If there is no Internet, you need to go to dockerhub to download this image.

1.2 Clone the superset code locally and start it using docker compose

There is no need to use the git clone command here, just download the zip package and unzip it.
Open the https://github.com/apache/superset web page in the browser and dowanload the ZIP.

Upload the downloaded ZIP package (superset-master.zip) to the /opt/superset directory, which you need to create yourself.
Use unzip superset-master.zip to get the superset-master folder after decompression.

Then cd superset-master- If you want to change the default username and password, please see step 3 before continuing.
Execute docker compose -f docker-compose-non-dev.yml pull
This process will take a few minutes

After the previous step is completed, execute docker compose -f docker-compose-non-dev.yml up
Wait until the console output slows down and you’re done.

At this time, open the browser and enter: http://IP:8088/ or localhost:8088 to log in.
The default username and password is admin

Enter the Superset login interface

324596c479f7f17ff706a94656d2745

48a53d5f42840b330bc9d9e25717dfc

2. Install cpolar intranet penetration to achieve public network access

Here we use cpolar intranet penetration tool, which supports http/https/tcp protocol, does not require public IP, does not need to set up a router, and does not limit traffic.

Log in to cpolar official website: https://www.cpolar.com

On the download page of cpolar, find the corresponding version of the cpolar installation program. The author is using the Windows operating system, so I chose the Windows version to download.

image-20231010171854756

After the download is completed, unzip the downloaded file and double-click the .msi file to automatically execute the cpolar installation program. We only need to go all the way to Next to complete the installation. .

Since cpolar will create an independent data tunnel for each user, supplemented by user passwords and token codes to ensure data security, we need to register users before using cpolar. The registration process is also very simple. Just click User Registration in the upper right corner of the cpolar homepage and fill in the necessary information on the registration page to complete the registration.

20230322092214

20230322092215

After registration, log in to the cpolar client (you can enter localhost:8088 in the browser to access directly, or you can click the cpolar client shortcut in the start menu), click on the left side of the client’s main interface Click the Tunnel ManagementCreate Tunnel button to enter the local tunnel creation page.

  1. Tunnel name: It can be regarded as the local tunnel information comment of cpolar, as long as it is convenient for us to distinguish.

  2. Protocol: Select http protocol

  3. Local address: The local address is the output port number of the local website. The default port of the intranet is 192.168.50.170:88. Fill in 192.168.50.170:88 here.

    Note: If you enter port 8080 normally and a 400 error message appears on the web page, you need to completely fill in the previous IP into Local Address and click AdvancedHost header field

  4. Domain name type: If you plan to create a temporary data tunnel, directly check “Random domain name” and let the cpolar client generate the network address by itself.

  5. Region: It is the same as the information reserved in cpolar cloud. We can fill it in according to the actual place of use.

a66424e89856e2586c0ee15a9fd18fe

After completing these settings, you can click the button below.

After the data tunnel is created, cpolar will automatically jump to the Tunnel ManagementTunnel List page. On this page, we can manage this data tunnel, including opening, closing, or deleting this tunnel. We can also click the Edit button to modify the information of this data tunnel.

ac8b45b9d98ebfb2e07bb57a89e09b1

The superset data tunnel entrance (public Internet access address) can be found in StatusOnline Tunnel List.

31c35254841b7e07c1272632b335383

Copy either public address of the two tunnels and paste it into a public browser.

c68f8a462c6b1f0a048c6800e3a6801

After pasting the public network address into the browser, the superset login interface for accessing the company’s intranet from the public network will be displayed. After logging in, the public network can access the intranet.

64e1524540e7a0154e98629f197da24

3. Set the fixed connection public network address

Since the tunnel created using cpolar above uses a random public network address, it will change randomly within 24 hours, which is not conducive to long-term remote access. Therefore, we can configure a second-level subdomain name for it. This address is a fixed address and will not change randomly [ps: cpolar.cn has been filed]

Note that you need to upgrade the cpolar package to a basic package or above, and the bandwidth corresponding to each package is different. [cpolar.cn has been registered]

Log in to the cpolar official website, click Reserve on the left, select to reserve the second-level subdomain name, set a second-level subdomain name, click Reserve, and copy the reserved second-level subdomain name after the reservation is successful.

After the reservation is successful, copy the name of the second-level subdomain name that was successfully reserved.

58c44d3b81d5630a66ce425b6c90da0

Return to the cpolar web UI management interface, click Tunnel Management – Tunnel List on the left dashboard, find the tunnel you want to configure, and click Edit on the right

670a38ff09001f378bfd59a9fcaaf99

Modify the tunnel information and configure the successfully reserved second-level subdomain name into the tunnel.

  • Domain name type: Select a second-level subdomain name
  • Sub Domain: Fill in the successfully reserved second-level subdomain name

Click Update (note, click once to update, no need to submit again)

f1d4bfd091a8ee948fd97994e24ed26

After the update is completed, open the online tunnel list. At this time, you can see that the public network address has changed and the address name has become a fixed second-level subdomain name.

5de37f7aaa6eca018514a366bfab9e8

Finally, we use a fixed public network address to access superset. (You can copy either of the two addresses.) You can see that the access is successful. In this way, a fixed and permanent public network address is set, and you can use it from outside. Access the superset big data system via the Internet address and view the data anytime and anywhere!