- Print
- PDF
Installing and managing agent
- Print
- PDF
Available in Classic and VPC
Agent installation and management explains supported agent specifications and the installation method. In addition, an description is offered about commands for the agent and resolutions for the problems that could occur related to the agent.
Supported agent specifications
The supported specifications for the agent are as follows:
Item | Supported specifications |
---|---|
Target server | Server or Auto Scaling Group created on NAVER Cloud Platform |
OS | CentOS, Ubuntu, Rocky |
Python version | Version 2.6 and 2.7 |
You cannot deploy a server created in NAVER Cloud Platform Secure Zone through SourceDeploy.
Install agent
To deploy to a server using SourceDeploy, the target server must have the agent for SourceDeploy installed.
To install the agent, proceed with the following steps in order:
1. Create API authentication key
You need an API authentication key to install and use the agent.
The following describes how to create an API authentication key:
- Access NAVER Cloud Platform portal.
- Click My page > Manage account > Manage authentication key, in order.
- Enter the login password, and then click the [OK] button.
- Click the [Create a new API authentication key] button.
- The created API is displayed in the list.
2. Compose installation commands
You can access to the server and compose the installation commands, or compose it in an Init Script.
See the following according to the composition method:
If you are installing the agent by writing an Init Script from the console, compose the installation commands in the Init Script before creating a project, and then register it when you create the Server or Auto Scaling which is going to be the deployment target.
Compose after accessing to server
The following describes how to access to a server and then compose and run the installation commands:
Access to the deployment target server set in the SourceDeploy deployment project.
Enter the commands by referring to the following:
echo $'NCP_ACCESS_KEY=accesskey\nNCP_SECRET_KEY=secretkey' > /opt/NCP_AUTH_KEY chmod 400 /opt/NCP_AUTH_KEY wget Agent download address chmod 755 install ./install rm -rf install
Enter the Access Key ID of the API authentication key created in 1. Create API authentication key in the
accesskey
field.Enter the Secret key of the API authentication key created in 1. Create API authentication key in the
secretkey
field.- Click the [View] button to see the Secret Key.
CautionYou should use the API authentication key whose status is in use. If you use a disabled key, the authentication will fail, even if the agent is running normally, and the deployment through SourceDeploy won't be performed properly.
To use a disabled key, click the [Use] button to change its status to in use.
:::
Enter the agent download address for the applicable Region and use environment in the
Agent 다운로드 주소
field.Environment Region Agent download address VPC Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/vpc/download/install Singapore (SGN) https://sourcedeploy-agent.apigw.ntruss.com/agent/sg-v1/download/install Japan (JPN) https://sourcedeploy-agent.apigw.ntruss.com/agent/jp-v1/download/install Classic Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/v2/download/install NCP_AUTH_KEY
should be created under the server's/opt directory as follows:
Compose in Init Script
If you have composed the installation commands in an Init Script, then it must be registered to Server or Auto Scaling.
The following describes how to compose the installation commands in an Init Script and register to Server or Auto Scaling:
Access NAVER Cloud Platform console.
Click Services > Compute > Server, in order.
Click the Init Script menu.
Click the [Create Script] button.
Enter the Script name and then select the OS type.
Compose the Script by referring to the following:
#!/bin/bash echo $'NCP_ACCESS_KEY=accesskey\nNCP_SECRET_KEY=secretkey' > /opt/NCP_AUTH_KEY chmod 400 /opt/NCP_AUTH_KEY wget Agent download address chmod 755 install ./install rm -rf install
Enter the Access Key ID of the API authentication key created in 1. Create API authentication key in the
accesskey
field.Enter the secret key of the API authentication key created in 1. Create API authentication key in the
secretkey
field.- Click the [View] button to see the Secret Key.
CautionYou should use the API authentication key whose status is in use. If you use a disabled key, the authentication will fail, even if the agent is running normally, and the deployment through SourceDeploy won't be performed properly.
To use a disabled key, click the [Use] button to change its status to in use.
:::
Enter the agent download address for the applicable environment and Region in the
Agent 다운로드 주소
field.Environment Region Agent download address VPC Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/vpc/download/install Singapore (SGN) https://sourcedeploy-agent.apigw.ntruss.com/agent/sg-v1/download/install Japan (JPN) https://sourcedeploy-agent.apigw.ntruss.com/agent/jp-v1/download/install Classic Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/v2/download/install
Click the [Create Script] button.
Register the Init Script created to Server or Auto Scaling.
- Click the Server menu to register it to Server.
- Click the [Create server] button to register the Init Script. For more details about creating a server, see Server creation guide.
- Click Services > Compute > Auto Scaling > Launch Configuration to register to Auto Scaling in order.
- Click the [create Launch Configuration] to register the Init Script. For more details on how to create Launch Configuration, see Launch Configuration creation guide (Classic) and Launch Configuration creation guide (VPC).
- Click the Server menu to register it to Server.
Agent execution commands
The following are execution commands for the agent:
Start the agent
service sourcedeploy start
Stop the agent
service sourcedeploy stop
Check the agent status
service sourcedeploy status
Restart the agent
service sourcedeploy restart
Check agent process
You can check the agent process to view if the agent is running normally.
The normal execution criteria for the agent process are as follows:
- Execute 1 process
ps -ef | grep main.py
Delete agent
The following shows how to delete an agent:
- Access to the server where the agent is installed, and then stop the agent.
- The following is the commands to stop the agent:
service sourcedeploy stop
- The following is the commands to stop the agent:
- Remove all live processes by checking the agent process.
The following are the commands to check and eliminate the agent processes:
ps -ef | grep main.py
kill -9 PID(ex.3587)
- Remove the installed agent file.
- The following is the commands to remove the agent file:
rm -rf /opt/sdagent
- The following is the commands to remove the agent file:
Troubleshooting agent
When the agent connection doesn't work
Enter the agent status check commands and check if the agent has been installed normally.
service sourcedeploy status
Check the installed version of the agent.
cat /opt/sdagent/Agent.ver
<example> As of May 27, 2021
[VERSION] ver=2021/05/18/01
- If the agent installed is an older version, then delete and reinstall the agent.
- For information on deleting the agent, see delete agent.
- If the agent installed is an older version, then delete and reinstall the agent.
Check if the following agent installation URL is entered in the Init Script.
The following are the addresses to download the agent for each use environment and Region:
Environment Region Agent download address VPC Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/vpc/download/install Singapore (SGN) https://sourcedeploy-agent.apigw.ntruss.com/agent/sg-v1/download/install Japan (JPN) https://sourcedeploy-agent.apigw.ntruss.com/agent/jp-v1/download/install Classic Korea (KR) https://sourcedeploy-agent.apigw.ntruss.com/agent/v2/download/install wget Agent download address
Check if the server status is running.
When the agent processes are not running normally
The normal execution criteria for the agent process are as follows:
- Execute 1 process
- Enter the restart commands to restart the agent.
service sourcedeploy restart
- If the problem continues even after restarting, then reinstall the agent.
When the agent can't be installed
Check if the correct authentication key value has been entered.
cat /opt/NCP_AUTH_KEY
Check if the path of the script you want to execute has been specified in the first line of the Init Script, in the form of
#!/usr/bin/env python
,#!/bin/perl
,#!/bin/bash
, and so on.