Este tema describe los problemas comunes y sus soluciones durante la instalación y el despliegue de host con Alibaba Cloud DevOps.
Problemas del agente de host: Flow Runner
Solución de problemas de Flow Runner
Antes de solucionar problemas relacionados con despliegues de host o aprovisionamiento de entornos para máquinas de compilación privadas, compruebe primero el estado de Flow Runner en la máquina.
Uso de la herramienta de diagnóstico
Esta herramienta solo es compatible con sistemas Linux.
-
Descargue la herramienta:
wget "https://rdc-public-software.oss-cn-hangzhou.aliyuncs.com/runner/runnerStatusCheck" -O runnerStatusCheck -
Otorgue permisos de ejecución:
chmod u+x runnerStatusCheck -
Ejecute la herramienta:
./runnerStatusCheck -
Siga las instrucciones que muestra la salida de la herramienta, como se observa en el siguiente ejemplo.
[INFO] prepare to check disk check disk output Filesystem Size Used Avail Use% Mounted on /dev/root 99G 59G 36G 62% / devtmpfs 3.7G 0 3.7G 0% /dev tmpfs 3.7G 0 3.7G 0% /dev/shm tmpfs 3.7G 600K 3.7G 1% /run tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup tmpfs 748M 0 748M 0% /run/user/0 [INFO] prepare to check runner status RunnerService: runner-v0.0.7-be-1fy1ifhg1ylcvqv7rwinqpgh.service status is active running RunnerService: runner-v0.0.7-be-3n5goas4jkp3clmcaopzeebj.service status is active running RunnerService: runner-v0.0.7-be-6fcm3z72s2fsnrkcjl7pbpsa.service status is not running , please exeute 'systemctl restart runner-v0.0.7-be-6fcm3z72s2fsnrkcjl7pbpsa.service ' to restart runner service RunnerService: runner-v0.0.7-be-7srpetjhkcy40btoontpsy8a.service status is not running , please exeute 'systemctl restart runner-v0.0.7-be-7srpetjhkcy40btoontpsy8a.service ' to restart runner service RunnerService: runner-v0.0.7-be-7ypo76lza21lljapgp5xtopi.service status is active running RunnerService: runner-v0.0.7-be-9zouh99ta6ycx2dq3iggekk9.service status is not running , please exeute 'systemctl restart runner-v0.0.7-be-9zouh99ta6ycx2dq3iggekk9.service ' to restart runner service RunnerService: runner-v0.0.7-be-ao81clhgw56bo0jopj5jgwn3.service status is active running RunnerService: runner-v0.0.7-be-bn9wuh8n4kiba0aa0a8dcirb.service status is active running RunnerService: runner-v0.0.7-be-fsr2gvdefe5yxl3nyijp36d3.service status is active running RunnerService: runner-v0.0.7-be-haphfbrhuudbxkzwpcuhn0hk.service status is not running , please exeute 'systemctl restart runner-v0.0.7-be-haphfbrhuudbxkzwpcuhn0hk.service ' to restart runner service RunnerService: runner-v0.0.7-be-mwkcqcv2hbwozrwmmczopzgm.service status is active running RunnerService: runner-v0.0.7-be-qdiyjifmn0bbkafobtfpkrst.service status is not running , please exeute 'systemctl restart runner-v0.0.7-be-qdiyjifmn0bbkafobtfpkrst.service ' to restart runner service RunnerService: runner-v0.0.7-be-qx6gaxojjjpzeblor692hrwk.service status is active running RunnerService: runner-v0.0.7-be-s5f7tixziynazefazqhls9ob.service status is active running RunnerService: runner-v0.0.7-be-uwdlmn516wd8emqebhgqwq6x.service status is active running RunnerService: runner-v0.0.7-be-xjmxrlbzrtksuafv4oyg8qtf.service status is active running Check runner service status finished.
Solución manual de problemas
-
Compruebe si su versión de Linux es compatible.
Ejecute el comando
lsb_release -apara verificar su distribución de Linux. Flow Runner unificado admite las siguientes distribuciones:CentOS 6+
Ubuntu 16.04+
Alibaba Cloud Linux 2/3
-
Revise el estado y los registros del servicio de Flow Runner.
Ejecute el comando
ls -al /etc/systemd/system | grep runnerpara encontrar el nombre del servicio. Este suele tener el formato runner-{version}-{tenant-name}.service.[root@ecs-for-batch-deploy-1 ~]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 8.2.2004 (Core) Release: 8.2.2004 Codename: Core [root@ecs-for-batch-deploy-1 ~]# ls -al /etc/systemd/system | grep runner -rw-r--r-- 1 root root 550 Oct 11 10:50 runner-v0.xxx.service [root@ecs-for-batch-deploy-1 ~]#Ejecute el comando
systemctl status runner-{version}-{tenant-name}.servicepara comprobar el estado del servicio. Si el estado es active (running), el servicio funciona correctamente.Release: 8.2.2004 Codename: Core [root@ecs-for-batch-deploy-1 ~]# ls -al /etc/systemd/system | gr -rw-r--r-- 1 root root 550 Oct 11 10:50 runner-v0.0.5-be-bnyxxx...yt.service [root@ecs-for-batch-deploy-1 ~]# systemctl status runner-v0.0.5-be-bnyxxx...yt.service ● runner-v0.0.5-be-bnxxx...yt.service - Aliyun yunxiao runner polling jo Loaded: loaded (/etc/systemd/system/runner-v0.xxx...yt.service) Active: active (running) since Tue 2022-10-11 10:50:56 CST; 2h ago Main PID: 1405243 (runner) Tasks: 10 (limit: 48875) Memory: 13.6M CGroup: /system.slice/runner-v0.0.5-be-brxxx...yt.service └─1405243 /usr/local/share/yunxiao-runner/v0.0.5/runner run --configPath=/r... Oct 11 11:01:03 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:01:03+08:00] Oct 11 11:01:03 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:01:03+08:00] Oct 11 11:01:18 ecs-for-batch-deploy-1 runner[1405243]: WARN[2022-10-11T11:01:18+08:00]Para consultar los registros de ejecución en tiempo real, ejecute el comando
journalctl -u runner-{version}-{tenant-name}.service -a --no-pager --since '5 minutes ago' -f.
Fallos en despliegues entre regiones
Al desplegar entre distintas regiones geográficas (por ejemplo, de China (Hong Kong) a Malasia) a través de Internet, pueden ocurrir fallos debido a la latencia o inestabilidad de la red.
Además de revisar el estado de Flow Runner y el espacio en disco, compruebe lo siguiente:
Pruebe la latencia de red y la pérdida de paquetes desde el host de destino hasta el endpoint del servicio de Alibaba Cloud DevOps mediante
pingotraceroute.Si la red es inestable, considere optimizar el enlace de red o utilizar una conexión dedicada entre regiones para mejorar la confiabilidad.
No se generan registros o el host está sin conexión durante la compilación o el despliegue
Ejecute
df -hlpara comprobar si el disco del host está lleno. Si lo está, libere espacio e inténtelo de nuevo.-
Revise el estado del servicio de Flow Runner. Si el estado no es
active(running), reinicie el servicio siguiendo estos pasos:-
Obtenga el nombre del servicio. El formato es
runner-{version}-{tenant-name}.service.systemctl | grep "runner-v" | awk '{print $1}' -
Reemplace
$SERVICE_NAMEen el siguiente comando con el nombre del servicio y ejecútelo para reiniciar el servicio de Flow Runner.systemctl restart $SERVICE_NAME
-
-
Compruebe si existen problemas de conectividad de red.
-
Ejecute
systemctl status runner-{version}-{tenant-name}.servicepara consultar el estado del servicio de Flow Runner y localizar el parámetro--configPath, como se muestra a continuación:[root@ecs-for-batch-deploy-1 ~]# systemctl status runner-v0.0.5-be-bnyxxx1llzpci0q606yt.service ● runner-v0.0.5-be-xxx...yt.service - Aliyun yunxiao runner polling jobs to execute Loaded: loaded (/etc/systemd/system/runner-v0.0.5-be-bxxx...yt.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2022-10-11 10:50:56 CST; 41min ago Main PID: 1405243 (runner) Tasks: 10 (limit: 48875) Memory: 13.7M CGroup: /system.slice/runner-v0.0.5-be-bnyxxx...yt.service └─1405243 /usr/local/share/yunxiao-runner/v0.0.5/runner run --configPath=/root/yunxiao/be-bnykv60t831llzpci0q606yt/runner/config Oct 11 11:31:46 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:31:46+08:00] [runner] no new job, skip. runner=9e7073c92b2fa8b35bc0efd3eec051f8 Oct 11 11:31:46 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:31:46+08:00] counter current: 0, limit: 50 Oct 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: WARN[2022-10-11T11:32:01+08:00] Response status code: 204 body data: Oct 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] POST /api/v2/builds/request, time spent 15.07 s Oct 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] [runner] no new job, skip. runner=9e7073c92b2fa8b35bc0efd3eec051f8 Oct 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] counter current: 0, limit: 50 Oct 11 11:32:16 ecs-for-batch-deploy-1 runner[1405243]: WARN[2022-10-11T11:32:16+08:00] ... -
Consulte la URL en configPath ejecutando
cat {PATH_TO_CONFIG}/config.yml | grep url.[root@ecs-for-batch-deploy-1 config]# cat /root/yunxiao/be-bnykv60t83lllzpci0q606yt/runner/config/config.yml | grep url url: https://xxx.com [root@ecs-for-batch-deploy-1 config]# -
Ejecute el siguiente comando para comprobar la accesibilidad de la URL.
# Note: Replace {url} in the command below with your actual URL. curl '{url}/api/v2/runner/storage/latest?os=linux&arch=amd64'
-
El despliegue de host falla con el error MachineGroupNotHaveMachine
Este error indica que el grupo de despliegue no tiene máquinas disponibles, por lo que la tarea de despliegue no se puede enviar al host de destino.
Para solucionar este problema:
En la consola de Alibaba Cloud DevOps, vaya a la configuración de la tarea de despliegue del pipeline y compruebe si el grupo de despliegue asociado contiene máquinas. Si está vacío, agregue primero los hosts de destino.
Si el grupo de despliegue ya contiene máquinas, verifique que estén en línea. Si alguna está sin conexión, inicie sesión en el servidor, compruebe el estado del servicio de Runner y reinícielo.
Una vez que confirme que el grupo de despliegue tiene máquinas disponibles y en línea, vuelva a activar la tarea de despliegue.
¿Cómo evito errores por solicitudes que llegan a los servicios durante el inicio en un despliegue multinodo?
Alibaba Cloud DevOps no incluye control de tráfico integrado durante los despliegues. Para gestionar el tráfico y evitar que las solicitudes lleguen a servicios que aún están iniciando, utilice el siguiente enfoque:
Divida sus hosts en dos grupos de hosts y configure despliegues secuenciales en el pipeline. Esto controla el orden de despliegue y garantiza que un grupo esté completamente disponible antes de actualizar el otro.
Utilice la interceptación de solicitudes a nivel de puerta de enlace o configure reglas de reenvío con Application Load Balancer (ALB) para dirigir el tráfico lejos de los nodos que aún están iniciando.