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:19] apereztransmission_of_audio_and_video:audio_and_video [2025/12/25 20:42] (current) aperez
Line 17: Line 17:
  
  
-====== Arranque Automático de Aplicaciones Java como Servicio en Windows (Guía Técnica Estándar) ====== 
  
-===== Propósito ===== +====== Automatic Startup of Java Application (VisionLiteas a Windows Service ======
-Esta guía describe el **procedimiento estándar y reutilizable** para configurar una aplicación Java (`.jar`como **Servicio de Windows** con arranque automático al iniciar el sistema, sin depender del inicio de sesión de un usuario.+
  
-El método utiliza **NSSM (Non-Sucking Service Manager)** y está orientado a **entornos productivos y servidores**.+===== 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
  
 --- ---
  
-===== Escenario de Uso ===== +===== Scenario ===== 
-Aplicaciones Java ejecutadas manualmente mediante:+Java application manually executed with:
  
 <code> <code>
-java -jar application.jar+java -jar VLite_2_3_169.jar
 </code> </code>
  
-Que deben+Requirement
-  * Iniciar automáticamente al arrancar Windows +The application must start automatically after every operating system reboot.
-  * Ejecutarse sin sesión iniciada +
-  * Reiniciarse si fallan +
-  * Permanecer operativas en segundo plano+
  
 --- ---
  
-===== Requisitos del Sistema =====+===== Requirements =====
   * Windows Server 2016+ / Windows 10+   * Windows Server 2016+ / Windows 10+
-  * Acceso administrativo +  * PowerShell with administrative privileges 
-  * Conectividad a Internet (para instalación inicial+  * Internet connectivity (initial installation
-  * PowerShell 5+ (recomendado PowerShell 7)+  * Java Runtime Environment (JRE) 
 +  * NSSM (Non-Sucking Service Manager)
  
 --- ---
  
-===== 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 previa ====+==== Verification ====
 <code powershell> <code powershell>
 choco -v choco -v
 </code> </code>
  
-Si no existe, instalarlo: +==== Installation (if not present) ====
 <code powershell> <code powershell>
 Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
Line 65: Line 67:
 </code> </code>
  
-Cerrar y abrir PowerShell nuevamente.+Close and reopen PowerShell.
  
 --- ---
  
-===== Paso 2 — Instalación de Java ===== +===== Step 2 — Java Installation and Verification ===== 
-Se recomienda **Java LTS (Java 8 11)** para aplicaciones legacy.+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>
  
-Ejemplo esperado:+Validated output in this environment:
 <code> <code>
 java version "1.8.0_261" java version "1.8.0_261"
Line 89: Line 91:
 --- ---
  
-===== Paso 3 — Identificación de la Ruta REAL de Java ===== +===== Step 3 — Identifying the REAL Java Path ===== 
-⚠️ **No usar** 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>
  
-==== Validar 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 esperado:+Result:
 <code> <code>
 True True
 </code> </code>
  
-Ruta estándar utilizada:+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 112: Line 114:
 --- ---
  
-===== Paso 4 — Instalación de NSSM ===== +===== Step 4 — NSSM Installation ===== 
-NSSM permite ejecutar aplicaciones como servicios Windows de forma segura.+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 127: Line 129:
 --- ---
  
-===== Paso 5 — Preparación de la Aplicación ===== +===== Step 5 — Service Verification ===== 
-Buenas prácticas recomendadas: +Check whether the service already exists:
- +
-  * Ubicar la aplicación fuera del Desktop (producción) +
-  * Ejemplo recomendado: +
-<code> +
-C:\Services\VisionLite\ +
-</code> +
- +
-Contenido típico: +
-  * VLite_2_3_169.jar +
-  * Carpetas de configuración (Presets, logs, etc.) +
- +
---- +
- +
-===== Paso 6 — Creación / Verificación del Servicio ===== +
-Comprobar si el servicio ya existe:+
  
 <code powershell> <code powershell>
 Get-Service *vision* | Format-Table Name,DisplayName,Status Get-Service *vision* | Format-Table Name,DisplayName,Status
 +</code>
 +
 +Validated result:
 +<code>
 +Name        DisplayName   Status
 +VisionLite VisionLite    Stopped
 </code> </code>
  
 --- ---
  
-===== Paso 7 — Configuración del Servicio con NSSM ===== +===== Step 6 — VisionLite Service Configuration ===== 
-Ejecutar **PowerShell como Administrador**.+All commands must be executed in **PowerShell as Administrator**.
  
-==== Definición del ejecutable ====+==== 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 ====+==== 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 (CRÍTICO) ====+==== 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 ====+==== Automatic restart on failure ====
 <code powershell> <code powershell>
 nssm set VisionLite AppExit Default Restart nssm set VisionLite AppExit Default Restart
Line 182: Line 175:
 --- ---
  
-===== Paso 8 — Inicio y Validación =====+===== Step 7 — Service Start and Validation =====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
Line 188: Line 181:
 </code> </code>
  
-Estado esperado:+Validated state:
 <code> <code>
 STATE : 4  RUNNING STATE : 4  RUNNING
 </code> </code>
  
-==== Confirmar Auto Start ====+==== Auto-start confirmation ====
 <code powershell> <code powershell>
 sc qc VisionLite sc qc VisionLite
 +</code>
 +
 +Result:
 +<code>
 +START_TYPE : 2  AUTO_START
 </code> </code>
  
 --- ---
  
-===== Paso 9 — Validación Completa (Dump) =====+===== Step 8 — Best Practice Correction ===== 
 +A user Desktop–based path is **NOT recommended** for production. 
 + 
 +==== Standard path defined ==== 
 +<code> 
 +C:\Services\VisionLite 
 +</code> 
 + 
 +--- 
 + 
 +===== Step 9 — Service Migration to Standard Path ===== 
 + 
 +==== Stop the service ==== 
 +<code powershell> 
 +nssm stop VisionLite 
 +</code> 
 + 
 +==== Create production directory ==== 
 +<code powershell> 
 +mkdir C:\Services\VisionLite 
 +</code> 
 + 
 +==== Migrate application files ==== 
 +<code powershell> 
 +Move-Item "C:\Users\Administrator\Desktop\Software\*" "C:\Services\VisionLite\" -Force 
 +</code> 
 + 
 +==== Update service working directory ==== 
 +<code powershell> 
 +nssm set VisionLite AppDirectory "C:\Services\VisionLite" 
 +</code> 
 + 
 +==== Restart the service ==== 
 +<code powershell> 
 +nssm start VisionLite 
 +sc query VisionLite 
 +</code> 
 + 
 +--- 
 + 
 +===== Step 10 — Final Validation ===== 
 +===NSSM configuration dump ====
 <code powershell> <code powershell>
 nssm dump VisionLite nssm dump VisionLite
 </code> </code>
 +
 +Confirm:
 +<code>
 +AppDirectory C:\Services\VisionLite
 +</code>
 +
 +==== Recommended test ====
 +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 218: Line 265:
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
-Síntoma Posible causa Solución +Symptom Probable cause Corrective action 
-El servicio se detiene Directorio incorrecto Revisar AppDirectory | +Service stops Incorrect directory Verify AppDirectory | 
-El JAR no encuentra archivos Rutas relativas Usar directorio correcto +| 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 | 
-Java no inicia Ruta incorrecta Validar java.exe real |+Files not found Relative paths Use standard path |
  
 --- ---
  
-===== Buenas Prácticas ===== +===== Best Practices ===== 
-  * Usar carpetas dedicadas (`C:\Services`) +  * Use `C:\Services` or `C:\ProgramData` 
-  * Configurar logs stdout/stderr +  * Avoid user-profile-dependent paths 
-  * Usar usuario de servicio dedicado si es crítico +  * Document changes in Wiki 
-  * Documentar cambios en Wiki+  * Centralize management with NSSM 
 +  * Consider a dedicated service account for critical services
  
 --- ---
  
-===== Nota Final ===== +===== Final Note ===== 
-Una vez configurado el servicio+Once configured as a service: 
-❌ **NO ejecutar manualmente**+ 
 +❌ DO NOT manually execute:
 <code> <code>
-java -jar application.jar+java -jar VLite_2_3_169.jar
 </code> </code>
  
-✅ Gestionar únicamente mediante NSSM / Services.msc+✅ Manage exclusively as a Windows service.
  
 --- ---
  
-**Autor:** Antonio Pérez   +<code powershell> 
-**Rol:** Network Engineer   +nssm stop VisionLite 
-**Uso:** Manual Operativo Producción  +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.1766693942.txt.gz · Last modified: by aperez

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki