Instalar um agente
O agente é executado do seu lado, junto ao servidor de ficheiros. Liga-se de volta ao seu espaço por HTTPS e faz o trabalho de SFTP, FTP, FTPS, SMB e NFS.
Criar o agente
- Abra Agentes e crie um agente. O guia de implementação abre com o ID do agente e o seu segredo.
- Copie o segredo agora. Só é mostrado uma vez; um guia reaberto mais tarde mostra
<agent-secret>. - Decida o endereço HTTPS público em que o xEvolve pode alcançar o agente. Introduza-o como
XEVOLVE_AGENT_URL.
Definições
| Variável | Valor |
|---|---|
AGENT_SECRET | O segredo do agente mostrado no guia. |
XEVOLVE_API_URL | O endereço do seu espaço, por exemplo https://<workspace>.xevolve.io. Não use api.xevolve.io: não tem espaço e responde workspace_not_ready. |
XEVOLVE_API_TOKEN | O segredo do agente, outra vez. |
XEVOLVE_AGENT_ID | O ID do agente mostrado no guia. |
XEVOLVE_AGENT_URL | O URL público em que o xEvolve alcança o agente. |
PORT | 3100 |
Docker
docker run -d --name xevolve-agent \
-p 3100:3100 \
-e AGENT_SECRET=<agent-secret> \
-e XEVOLVE_API_URL=https://<workspace>.xevolve.io \
-e XEVOLVE_API_TOKEN=<agent-secret> \
-e XEVOLVE_AGENT_ID=<agent-id> \
-e XEVOLVE_AGENT_URL=https://your-agent-url.example.com \
--restart unless-stopped \
ghcr.io/spot-techno/xevolve-agent:latestAzure Web App for Containers
az group create -n xevolve-agent-rg -l westeurope
az appservice plan create -n xevolve-agent-plan -g xevolve-agent-rg \
--is-linux --sku B1
az webapp create -n xevolve-agent -g xevolve-agent-rg \
-p xevolve-agent-plan \
-i ghcr.io/spot-techno/xevolve-agent:latest
az webapp config appsettings set -n xevolve-agent -g xevolve-agent-rg \
--settings \
AGENT_SECRET=<agent-secret> \
XEVOLVE_API_URL=https://<workspace>.xevolve.io \
XEVOLVE_API_TOKEN=<agent-secret> \
XEVOLVE_AGENT_ID=<agent-id> \
XEVOLVE_AGENT_URL=https://xevolve-agent.azurewebsites.net \
WEBSITES_PORT=3100AWS ECS (Fargate)
Isto pressupõe que já existem uma VPC, uma sub-rede e um cluster ECS chamado xevolve.
aws ecs register-task-definition --cli-input-json file://task-def.json
aws ecs create-service \
--cluster xevolve \
--service-name xevolve-agent \
--task-definition xevolve-agent \
--desired-count 1 \
--launch-type FARGATE \
--network-configuration "awsvpcConfiguration={subnets=[<subnet-id>],securityGroups=[<security-group-id>],assignPublicIp=ENABLED}"O ficheiro task-def.json:
{
"family": "xevolve-agent",
"containerDefinitions": [{
"name": "agent",
"image": "ghcr.io/spot-techno/xevolve-agent:latest",
"portMappings": [{"containerPort": 3100}],
"environment": [
{"name": "AGENT_SECRET", "value": "<agent-secret>"},
{"name": "XEVOLVE_API_URL", "value": "https://<workspace>.xevolve.io"},
{"name": "XEVOLVE_API_TOKEN", "value": "<agent-secret>"},
{"name": "XEVOLVE_AGENT_ID", "value": "<agent-id>"},
{"name": "XEVOLVE_AGENT_URL", "value": "https://your-agent-url.example.com"}
]
}],
"cpu": "256", "memory": "512",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"]
}Confirmar que funciona
- Abra Agentes e escolha Testar agente no cartão do agente. Isto verifica se o xEvolve alcança o endereço do agente.
- Aguarde um minuto. O agente envia um sinal de presença a cada 60 segundos e o cartão mostra quando foi visto pela última vez.
- Adicione ou edite uma ligação SFTP, FTP, FTPS, SMB ou NFS, selecione este agente e teste a ligação.
Testar agente não verifica o segredo do agente. Um segredo errado nota-se pela ausência de sinal de presença.