Target Environment Management
A target environment refers to the server hosting the Java process to be analyzed. You can add multiple target environments as required on the Java Profiler tool page.
Prerequisites
- You have logged in to the Kunpeng DevKit and installed the Java Profiler.
- The sshd service has been enabled on the server that you want to add as a target environment.
- You have installed JDK 8 or later and configured environment variables.
Adding a Target Environment
- Log in to the Kunpeng DevKit. In the navigation tree on the left, click
next to the Java Profiler.The Add Target Environment dialog box is displayed. See Figure 1. For details about the parameters, see Table 1.Table 1 Parameters for adding a target environment Parameter
Description
Select Server
Select the type of the target environment to be added. You can select a local or remote server.
NOTE:When using the Kunpeng DevKit plugin in VS Code, you can select a local, existing, or new server.
Server IP Address
IP address of the remote server where the Java Profiler is to be installed. For details, see Querying the Physical IP Address of a Server.
NOTE:For security purposes, perform security hardening when entering IP addresses.
Port
SSH service port number of the remote server. The default value is 22.
NOTE:Before deploying the Java Profiler on a Docker container, specify the -p mapping_port_number:22 parameter when starting the Docker container, and then enter the host machine port number mapped to the Docker SSH service.
Example:
Start the Docker.
docker run -di --name dockername -p 20086:22 imageid /usr/sbin/init
Enter 20086 in the Port box.
User Name
User name for logging in to the remote server.
NOTE:- The Java Profiler deployed by the OS administrator can obtain all running Java processes on the server.
- The Java Profiler deployed by a non-administrator user of the OS can obtain only the running Java processes of the user on the server.
- To ensure SSH channel security, you are advised to log in as a non-root user.
Password
Password for logging in to the remote server.
NOTE:- If the root user is used, you are advised to harden the OS to prevent the user password from being cracked based on the interface information.
- The Remember password option is available only when the Kunpeng DevKit plugin is used in VS Code.
Password-free Login
Indicates whether to enable password-free login. By default, password-free login is disabled.
NOTE:- For details about password-free operations, see Configuring the Password-free Login Certificate. Ensure that the devkit user has the read permission on the copied /home/user/.ssh/id_rsa file.
- If SSH password-free communication has been enabled for the DevKit installation node and the node to be analyzed, you do not need to enter the OS user's password when adding an environment.
- Set parameters by referring to Table 1 and click OK.
In the confirmation dialog box that is displayed, click OK.
- The fingerprint is the SSH public key fingerprint of the server that you want to add as a target environment.
- The administrator devadmin can click
next to Java Profiler to filter target environments.
Restarting a Target Environment
- If the target environment is offline, select a target environment and click
in the Target Environments list of the Java Profiler.Figure 2 Restart
- In the dialog box that is displayed, enter the user name and password for logging in to the remote server to redeploy the Java Profiler.
If an error message indicating that the Guardian cannot be installed is displayed when you redeploy the Java Profiler, check whether the user name or password is correct and whether the current user is locked.
Deleting a Target Environment
- In the Target Environments list of the Java Profiler, select a target environment and click
.Figure 3 Delete
- Click OK in the dialog box that is displayed.
- To delete a target environment when it is offline, enter the user name and password for deploying the Java Profiler and click OK. If you click OK without entering the password or the password is incorrect, you need to manually delete the executable file of the Java Profiler on the remote server.
- If an error message indicating that the Guardian cannot be installed is displayed when you delete a target environment, check whether the password is correct and whether the current user is locked.
Importing a Task/Report
- Click
next to Java Profiler.Figure 4 Import button
- Select a data type to import.Figure 5 Selecting a data type
- View the imported task/report.Figure 6 Tasks/Reports
After online tasks are imported, they are displayed instantly on the tab page. The administrator devadmin can click
next to the task/report list to filter the imported content.
