Help Center/
Application Performance Management/
Best Practices(2.0)/
Connecting to APM/
Connecting to APM Through a Public Network
Updated on 2025-03-27 GMT+08:00
Connecting to APM Through a Public Network
Prerequisites
Procedure
Purchase an ECS as the jump server and perform the following operations:
- Log in to the ECS and modify its security group rules.
- On the ECS details page, click the Security Groups tab.
- Click a security group name and click Modify Security Group Rule.
- On the security group details page, click the Inbound Rules tab and then click Add Rule. On the page displayed, add a security group rule by referring to Table 1.
- Obtain the APM report address. For details, see Access Address (master.address).
- Log in to the jump server as the root user and run the iptables forwarding command.
If the iptables service does not exist, run the following commands to install it:
yum install iptables-services systemctl stop firewalld.service systemctl disable firewalld.service systemctl mask firewalld.service
- Enable data forwarding.
# Edit the file. vim /etc/sysctl.conf # Add the following content: net.ipv4.ip_forward=1 # Enable data forwarding. sysctl -p
- Forward the data from the port of the local host (jump server) to the port for reporting data to APM.
# Edit the file. vim /etc/sysconfig/iptables # *Add filters. -A INPUT -p tcp -m state --state NEW -m tcp --dport 41333 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 41335 -j ACCEPT # *Add NAT rules. -A OUTPUT -p tcp --dport 41333 -j DNAT --to-destination {IP address of the host that reports data to APM}:41333 -A PREROUTING -p tcp --dport 41333 -j DNAT --to-destination {IP address of the host that reports data to APM}:41333 -A POSTROUTING -d {IP address of the host that reports data to APM}/32 -p tcp --dport 41333 -j SNAT --to-source {IP address of the jump server} -A OUTPUT -p tcp --dport 41335 -j DNAT --to-destination {IP address of the host that reports data to APM}:41335 -A PREROUTING -p tcp --dport 41335 -j DNAT --to-destination {IP address of the host that reports data to APM}:41335 -A POSTROUTING -d {IP address of the host that reports data to APM}/32 -p tcp --dport 41335 -j SNAT --to-source {IP address of the jump server} # If the following rule exists, delete it: -A FORWARD -j REJECT --reject-with icmp-host-prohibited
- Restart iptables.
systemctl restart iptables
- Check whether port forwarding is successful.
curl -kv https://{IP address of the jump server}:41333 curl -kv https://{IP address of the jump server}:41335
- Enable data forwarding.
- Modify the apm.config file in the JavaAgent package.
master.address=https://{Public IP address of the jump server}:41333 access.address={Public IP address of the jump server}:41335
- Restart the application.
Parent topic: Connecting to APM
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot