How to remotely access Linux MeterSphere one-stop open source continuous testing platform

foreword

MeterSphere is a one-stop open source continuous testing platform, covering functions such as test tracking, interface testing, UI testing, and performance testing. It is fully compatible with mainstream open source standards such as JMeter and Selenium, and effectively helps development and testing teams make full use of cloud elasticity for highly scalable Automated testing accelerates the delivery of high-quality software and promotes the improvement of the overall efficiency of China's testing industry.

The following introduces the deployment of MeterSphere in Linux and combined with cpolar intranet penetration to achieve remote access to the MeterSphere interface!

1. Install MeterSphere

Execute the following command as the root user to install MeterSphere with one click. If docker and docker compose are installed in the device, it will be installed in docker mode by default

curl -sSL https://resource.fit2cloud.com/metersphere/metersphere/releases/latest/download/quick_start.sh | bash

After the installation is successful, we can see the following information, access method URL, port number: 8081, and user name and initialization password, which need to be remembered

image-20230831162759484

2. Local access to MeterSphere

After installation, we access the web interface in the browser through the default web interface port 8081, or access the external device through the LAN through port 8081. You can see that the local access is successful. Next, we install cpolar to achieve remote access

image-20230831170514124

As mentioned above, if docker and docker compose are installed in the device, they will be installed in docker mode by default. Now we can open docker images and docker pa -a to see that MeterSphere runs in docker mode, so we can stop or start it in Operation in docker

image-20230831172527388

3. Install cpolar intranet penetration software

Above we installed and started the MeterSphere service in the local Linux, and the local access is ok. Next, we install the cpolar intranet penetration tool in Linux. Through the http public network address of cpolar, we can easily access MeterSphere remotely without our own Register a domain name to purchase a cloud server. The following are the steps to install cpolar

cpolar official website address: https://www.cpolar.com

  • Install commands using one-click scripts
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
  • Add a service to the system
sudo systemctl enable cpolar
  • Start the cpolar service
sudo systemctl start cpolar

After cpolar is successfully installed, access Linux port 9200 on an external browser: [http://LAN ip:9200], log in with the cpolar account, and you can see the cpolar web configuration interface after logging in, and then configure it on the web interface can

image-20230831171159175

4. Configure MeterSphere public network access address

Click on the tunnel management on the left dashboard - create a tunnel, and create a cpolar tunnel on port 8081 of our http access method above!

  • Tunnel name: you can customize the name, be careful not to duplicate the existing tunnel name
  • Protocol: select http
  • Local address: 8081 (default port)
  • Domain name type: choose a random domain name for free
  • Region: Select China VIP

click创建

image-20230831171116451

After the tunnel is successfully created, click on the status on the left - online tunnel list to view the generated public network access address. There are two access methods, one is http and https

image-20230831171248106

5. Remotely access MeterSphere from public network

Use the above https public network address to visit in the browser of any device, and you can successfully see our MeterSphere service login management interface. Such a public network address can be accessed remotely and is created. To access a new address, you may need to log in again.

image-20230831171445641

6. Fixed MeterSphere public network address

Since the above tunnel created by using cpolar 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, which is a fixed address and will not change randomly [ps: cpolar.cn has been filed]

Note that the cpolar package needs to be upgraded to the basic package or above, and the bandwidth corresponding to each package is different. [cpolar.cn has been filed]

Log in to the cpolar official website , click Reserve on the left, choose 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

image-20230831171644841

After the reservation is successful, copy the name of the reserved second-level subdomain name

image-20230831171725316

Go back to log in to the cpolar web UI management interface, click the tunnel management on the left dashboard - tunnel list, find the MeterSphere tunnel to be configured, and click edit on the right

image-20230831171801436

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 reserved sub-domain name

Click 更新(note, click once to update, no need to submit repeatedly)

image-20230831171857933

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

image-20230831171930810

Finally, we use a fixed public network address to access the MeterSphere service. You can see the login interface, indicating that the access is successful. Such a fixed and permanent public network address is set.

image-20230831172030365

Enter username and password to log in

We use a fixed public network address to access the MeterSphere service. You can see the login interface, indicating that the access is successful. Such a fixed and permanent public network address is set.

Enter username and password to log in

image-20230831172136283

Reprinted from cpolar pole cloud article: Linux MeterSphere one-stop open source continuous testing platform remote access

Guess you like

Origin blog.csdn.net/qq_48652579/article/details/132714208