User Tools

Site Tools


transmission_of_audio_and_video:audio_and_video

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
transmission_of_audio_and_video:audio_and_video [2025/12/25 20:34] apereztransmission_of_audio_and_video:audio_and_video [2025/12/25 20:42] (current) aperez
Line 18: Line 18:
  
  
 +====== Automatic Startup of Java Application (VisionLite) as a Windows Service ======
  
 +===== Purpose =====
 +Establish a standard, reproducible, and best-practice-aligned procedure to run a Java (.jar)
 +application as a **Windows Service**, ensuring:
  
- +  Automatic startup when the server boots 
- +  * Independence from user login 
- +  * Automatic restart on failures 
- +  * Use of standard production paths
- +
- +
- +
- +
- +
- +
- +
- +
- +
-====== Arranque Automático de Aplicación Java (VisionLite) como Servicio en Windows ====== +
- +
-===== Propósito ===== +
-Establecer un procedimiento estándar, reproducible y alineado a buenas prácticas para +
-ejecutar una aplicación Java (.jar) como **Servicio de Windows**, garantizando: +
- +
-  Arranque automático al iniciar el servidor +
-  * Independencia del login de usuario +
-  * Reinicio automático ante fallos +
-  * Uso de rutas estándar de producción+
  
 --- ---
  
-===== Escenario ===== +===== Scenario ===== 
-Aplicación Java ejecutada manualmente con:+Java application manually executed with:
  
 <code> <code>
Line 53: Line 38:
 </code> </code>
  
-Requerimiento+Requirement
-Ejecutarse automáticamente tras cada reinicio del sistema operativo.+The application must start automatically after every operating system reboot.
  
 --- ---
  
-===== Requisitos =====+===== Requirements =====
   * Windows Server 2016+ / Windows 10+   * Windows Server 2016+ / Windows 10+
-  * PowerShell con privilegios administrativos +  * PowerShell with administrative privileges 
-  * Conectividad a Internet (instalación inicial)+  * Internet connectivity (initial installation)
   * Java Runtime Environment (JRE)   * Java Runtime Environment (JRE)
   * NSSM (Non-Sucking Service Manager)   * NSSM (Non-Sucking Service Manager)
Line 67: Line 52:
 --- ---
  
-===== Paso 1 — Instalación de Chocolatey ===== +===== Step 1 — Chocolatey Installation ===== 
-Chocolatey es el gestor de paquetes estándar para Windows.+Chocolatey is the standard Windows package manager.
  
-==== Verificación ====+==== Verification ====
 <code powershell> <code powershell>
 choco -v choco -v
 </code> </code>
  
-==== Instalación (si no existe) ====+==== Installation (if not present) ====
 <code powershell> <code powershell>
 Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
Line 82: Line 67:
 </code> </code>
  
-Cerrar y abrir PowerShell nuevamente.+Close and reopen PowerShell.
  
 --- ---
  
-===== Paso 2 — Instalación y Verificación de Java ===== +===== Step 2 — Java Installation and Verification ===== 
-Se recomienda Java LTS (Java 8 11).+Java LTS is recommended (Java 8 or 11).
  
-==== Instalación Java 8 ====+==== Java 8 Installation ====
 <code powershell> <code powershell>
 choco install jre8 -y choco install jre8 -y
 </code> </code>
  
-==== Verificación ====+==== Verification ====
 <code powershell> <code powershell>
 java -version java -version
 </code> </code>
  
-Salida validada en este entorno:+Validated output in this environment:
 <code> <code>
 java version "1.8.0_261" java version "1.8.0_261"
Line 106: Line 91:
 --- ---
  
-===== Paso 3 — Identificación de la Ruta REAL de Java ===== +===== Step 3 — Identifying the REAL Java Path ===== 
-⚠️ No utilizar el wrapper:+⚠️ Do NOT use the wrapper:
 <code> <code>
 C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
 </code> </code>
  
-==== Validación del binario real ====+==== Validate the real binary ====
 <code powershell> <code powershell>
 Test-Path "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" Test-Path "C:\Program Files\Java\jre1.8.0_261\bin\java.exe"
 </code> </code>
  
-Resultado:+Result:
 <code> <code>
 True True
 </code> </code>
  
-Ruta confirmada:+Confirmed path:
 <code> <code>
 C:\Program Files\Java\jre1.8.0_261\bin\java.exe C:\Program Files\Java\jre1.8.0_261\bin\java.exe
Line 129: Line 114:
 --- ---
  
-===== Paso 4 — Instalación de NSSM ===== +===== Step 4 — NSSM Installation ===== 
-NSSM permite ejecutar aplicaciones como servicios de Windows de forma controlada.+NSSM allows applications to run as controlled Windows services.
  
-==== Instalación ====+==== Installation ====
 <code powershell> <code powershell>
 choco install nssm -y choco install nssm -y
 </code> </code>
  
-==== Verificación ====+==== Verification ====
 <code powershell> <code powershell>
 nssm version nssm version
Line 144: Line 129:
 --- ---
  
-===== Paso 5 — Verificación del Servicio ===== +===== Step 5 — Service Verification ===== 
-Comprobar si el servicio ya existe:+Check whether the service already exists:
  
 <code powershell> <code powershell>
Line 151: Line 136:
 </code> </code>
  
-Resultado validado:+Validated result:
 <code> <code>
 Name        DisplayName   Status Name        DisplayName   Status
Line 159: Line 144:
 --- ---
  
-===== Paso 6 — Configuración del Servicio VisionLite ===== +===== Step 6 — VisionLite Service Configuration ===== 
-Todos los comandos deben ejecutarse en **PowerShell como Administrador**.+All commands must be executed in **PowerShell as Administrator**.
  
-==== Definición del ejecutable Java ====+==== Java executable definition ====
 <code powershell> <code powershell>
 nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe"
 </code> </code>
  
-==== Parámetros de ejecución ====+==== Execution parameters ====
 <code powershell> <code powershell>
 nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar" nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar"
 </code> </code>
  
-==== Directorio de trabajo inicial ====+==== Initial working directory ====
 <code powershell> <code powershell>
 nssm set VisionLite AppDirectory "C:\Users\Administrator\Desktop\Software" nssm set VisionLite AppDirectory "C:\Users\Administrator\Desktop\Software"
 </code> </code>
  
-==== Arranque automático ====+==== Automatic startup ====
 <code powershell> <code powershell>
 nssm set VisionLite Start SERVICE_AUTO_START nssm set VisionLite Start SERVICE_AUTO_START
 </code> </code>
  
-==== Reinicio automático si falla ====+==== Automatic restart on failure ====
 <code powershell> <code powershell>
 nssm set VisionLite AppExit Default Restart nssm set VisionLite AppExit Default Restart
Line 190: Line 175:
 --- ---
  
-===== Paso 7 — Inicio y Validación del Servicio =====+===== Step 7 — Service Start and Validation =====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
Line 196: Line 181:
 </code> </code>
  
-Estado validado:+Validated state:
 <code> <code>
 STATE : 4  RUNNING STATE : 4  RUNNING
 </code> </code>
  
-==== Confirmación de Auto-Start ====+==== Auto-start confirmation ====
 <code powershell> <code powershell>
 sc qc VisionLite sc qc VisionLite
 </code> </code>
  
-Resultado:+Result:
 <code> <code>
 START_TYPE : 2  AUTO_START START_TYPE : 2  AUTO_START
Line 213: Line 198:
 --- ---
  
-===== Paso 8 — Corrección por Buenas Prácticas ===== +===== Step 8 — Best Practice Correction ===== 
-La ruta basada en el Desktop del usuario **NO es recomendada** para producción.+A user Desktop–based path is **NOT recommended** for production.
  
-==== Ruta estándar definida ====+==== Standard path defined ====
 <code> <code>
 C:\Services\VisionLite C:\Services\VisionLite
Line 223: Line 208:
 --- ---
  
-===== Paso 9 — Migración del Servicio a Ruta Estándar =====+===== Step 9 — Service Migration to Standard Path =====
  
-==== Detener el servicio ====+==== Stop the service ====
 <code powershell> <code powershell>
 nssm stop VisionLite nssm stop VisionLite
 </code> </code>
  
-==== Crear directorio de producción ====+==== Create production directory ====
 <code powershell> <code powershell>
 mkdir C:\Services\VisionLite mkdir C:\Services\VisionLite
 </code> </code>
  
-==== Migrar archivos de la aplicación ====+==== Migrate application files ====
 <code powershell> <code powershell>
 Move-Item "C:\Users\Administrator\Desktop\Software\*" "C:\Services\VisionLite\" -Force Move-Item "C:\Users\Administrator\Desktop\Software\*" "C:\Services\VisionLite\" -Force
 </code> </code>
  
-==== Actualizar directorio de trabajo del servicio ====+==== Update service working directory ====
 <code powershell> <code powershell>
 nssm set VisionLite AppDirectory "C:\Services\VisionLite" nssm set VisionLite AppDirectory "C:\Services\VisionLite"
 </code> </code>
  
-==== Reiniciar el servicio ====+==== Restart the service ====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
Line 253: Line 238:
 --- ---
  
-===== Paso 10 — Validación Final ===== +===== Step 10 — Final Validation ===== 
-==== Dump de configuración NSSM ====+==== NSSM configuration dump ====
 <code powershell> <code powershell>
 nssm dump VisionLite nssm dump VisionLite
 </code> </code>
  
-Confirmar:+Confirm:
 <code> <code>
 AppDirectory C:\Services\VisionLite AppDirectory C:\Services\VisionLite
 </code> </code>
  
-==== Prueba recomendada ==== +==== Recommended test ==== 
-Reiniciar el servidor y verificar que el servicio se encuentre en estado RUNNING.+Reboot the server and verify the service is in RUNNING state.
  
 --- ---
  
-===== Operación Diaria =====+===== Daily Operations =====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
Line 280: Line 265:
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
-Síntoma Causa probable Acción correctiva +Symptom Probable cause Corrective action 
-El servicio se detiene Directorio incorrecto Verificar AppDirectory | +Service stops Incorrect directory Verify AppDirectory | 
-El JAR no inicia Ruta Java incorrecta Validar java.exe real +| JAR does not start Incorrect Java path Validate real java.exe | 
-No arranca tras reboot | No AUTO_START | Verificar sc qc | +Does not start after reboot | Not AUTO_START | Verify sc qc | 
-Archivos no encontrados Rutas relativas Usar ruta estándar |+Files not found Relative paths Use standard path |
  
 --- ---
  
-===== Buenas Prácticas ===== +===== Best Practices ===== 
-  * Usar `C:\Services` `C:\ProgramData` +  * Use `C:\Services` or `C:\ProgramData` 
-  * Evitar rutas dependientes del perfil de usuario +  * Avoid user-profile-dependent paths 
-  * Documentar cambios en Wiki +  * Document changes in Wiki 
-  * Centralizar gestión mediante NSSM +  * Centralize management with NSSM 
-  * Considerar usuario dedicado para servicios críticos+  * Consider a dedicated service account for critical services
  
 --- ---
  
-===== Nota Final ===== +===== Final Note ===== 
-Una vez configurado como servicio:+Once configured as a service:
  
-❌ NO ejecutar manualmente:+❌ DO NOT manually execute:
 <code> <code>
 java -jar VLite_2_3_169.jar java -jar VLite_2_3_169.jar
 </code> </code>
  
-✅ Gestionar exclusivamente como servicio Windows.+✅ Manage exclusively as a Windows service.
  
 --- ---
  
-**Autor:** Antonio Pérez   +<code powershell> 
-**Rol:** Network Engineer   +nssm stop VisionLite 
-**Estado:** Implementación final validada  +sc query VisionLite 
 + 
 +nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" 
 +nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar" 
 +nssm set VisionLite AppDirectory "C:\Services\VisionLite" 
 +nssm set VisionLite Start SERVICE_AUTO_START 
 +nssm set VisionLite AppExit Default Restart 
 +nssm set VisionLite AppRestartDelay 60000 
 + 
 +nssm start VisionLite 
 +sc query VisionLite 
 + 
 +sc qc VisionLite 
 + 
 +nssm dump VisionLite 
 + 
 +nssm start VisionLite 
 +nssm stop VisionLite 
 +nssm restart VisionLite 
 +sc query VisionLite 
 +</code> 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
  
  
transmission_of_audio_and_video/audio_and_video.1766694863.txt.gz · Last modified: by aperez

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki