Porta On Prem VM Helpers
このコンテンツはまだ日本語訳がありません。
Helper Commands & Scripts
Section titled “Helper Commands & Scripts”Helpers that can be run from the command line when accessing the VM shell terminal via SSH, or directly in the VirtualBox VM terminal.
Helpers for General VM Tasks
Section titled “Helpers for General VM Tasks”Commands
Section titled “Commands”These commands are often shortcuts to the script files of similar names. You can simply type the command into the terminal and hit Enter.
| Command | Notes | |
|---|---|---|
collect_data | • Run various diagnostics to gather system and app data • Results stored in ~/logs/collected_data/YYYYMMDD/HH-SS/ | 0.9.14.2+ |
view_hosts_file | Print the contents of the hosts file located at /etc/hosts | |
check_diskspace | Simple disk space check | |
check_diskspace_sorted | Disk space check sorted by size | |
docker_disk_usage | Check Docker’s disk usage by images, containers, and volumes | |
docker_volume_size | • Inspect Docker volume sizes • Usage: docker_volume_size <volume_name> |
Scripts
Section titled “Scripts”VM Location: ~/scripts/
| Script | Notes | Versions |
|---|---|---|
reset_identity.sh | • Give the VM a new hostname and unique machine ID. • Should be run when importing the VM image multiple times to avoid conflicts with other VMs. | All |
reset_dhcp.sh | • When not using static IP, use this to assign a new IP address to the VM. | All |
setup_static_ip.sh | • Sets up a static IP address for the VM. • ⛔The VM setup PowerShell script automatically sets static IP, so this script should only be needed if the setup script fails to complete properly. • ⚠️If executed over SSH, your connection will drop — use VirtualBox terminal instead. | All |
static_ip_info.sh | • Print info about the static IP configuration in /etc/netplan/ | All |
vm_info.sh | • Print info about the VM (hostname, IP, MAC address, and /etc/hosts contents) | All |
disable_static_ip.sh | • Attempt to disable static IP configuration by renaming /etc/netplan/99-portacfg.yaml | All |
Helpers for Porta Manager Tasks
Section titled “Helpers for Porta Manager Tasks”Commands
Section titled “Commands”These commands are often shortcuts to the script files of similar names. You can simply type the command into the terminal and hit Enter.
| Command | Notes | Versions |
|---|---|---|
update_manager | • Update Porta Manager • This will automatically download the latest version of Porta Manager and run the update script. • Calls the script ~/scripts/porta-manager/install-manager.sh. | All |
install_manager | • Alias of update_manager.• Currently, unlike during a Porta install, there is no database wipe of the Porta Manager during installation. | All |
mngr_check_version | Print Porta Manager version info | |
mngr_horizon_logs | View the installer wizard server processing logs | |
mngr_app_logs | View Porta Manager application logs | |
mngr_task_logs | View Porta Manager task logs | |
mngr_init_user | Initialize Porta Manager user | |
mngr_backup_env | Backup Porta Manager environment | |
mngr_restore_env | Restore Porta Manager environment | |
mngr_recreate | • Recreate containers from existing images • Needed if IP is manually changed (without running a script) • Manager containers must currently be running | |
⚠️ mngr_wipe_recreate | • Wipe the manager completely (including data and storage volumes) and recreate it from existing images • ⚠️THIS IS A DESTRUCTIVE ACTION |
Scripts
Section titled “Scripts”VM Location: ~/scripts/porta-manager/
| Script | Notes | Versions |
|---|---|---|
install-manager.sh | • Install or update Porta Manager • This will automatically download the latest version of Porta Manager and run the update script | All |
check-manager-version.sh | Display the current version of Porta Manager that is installed on the VM | All |
view-logs.sh | • Follow or view the last X lines of logs from a Porta Manager container. • Defaults to following the horizon container logs. • Usage: ~/scripts/porta-manager/view-logs.sh [container_type] [number_of_lines]• container_type: app, horizon, or tasknumber_of_lines: Number of lines to tail, or ‘f’ to follow• Example for viewing the last 300 lines of the horizon log file: ~/scripts/porta-manager/view-logs.sh app 300 | All |
check-conn-cache.sh | Check the contents of the cached connections (cache file), loaded connections (config() in memory), and database connection cache for all Porta Manager containers | All |
init-manager-user.sh | • Initialize the first Porta Manager user. • Only needed if you have fully wiped the Porta Manager database. | All |
backup-env.sh | • Copy an .env file from the porta manager app container to ${MNGR_CONFIG_DIR}/.envAPP_KEY• Is run automatically when updating with update_manager.sh | All |
Helpers for Porta Tasks
Section titled “Helpers for Porta Tasks”Commands
Section titled “Commands”These commands are often shortcuts to the script files or existing helpers of similar names. You can simply type the command into the terminal and hit Enter.
| Command | Notes | Versions |
|---|---|---|
porta_diag | Run the full Porta servers diagnostics | 0.9.14.2+ |
porta_all_group_status | • View group replication status as reported by each machine in the group. • ⚠️ Machine IPs must be correct in /etc/hosts | 0.9.14.2+ |
porta_group_status | View group replication status as reported by the local machine | 0.9.14.2+ |
porta_check_version | View Porta app version information | 0.9.14.2+ |
porta_bootstrap | • Bootstraps the replication group from this machine. • Before running, make sure no other machine is already primary (check with porta_all_group_status first) | 0.9.14.2+ |
porta_start_repl | Starts the replication on this machine | 0.9.14.2+ |
porta_stop_repl | Stops the replication on this machine | 0.9.14.2+ |
porta_backup_db | • Creates a backup of the Porta database. • Uses the artisan command | 0.9.14.2+ |
porta_restore_db | Restores the Porta database from a backup | 0.9.14.2+ |
porta_reset_db | • Resets the Porta database. • ⚠️ THIS WIPES ALL DATA! | 0.9.14.2+ |
porta_set_bootstrap_ON | • Sets the bootstrap flag to ON on this machine. • ⚠️ This machine will ALWAYS set itself as primary when starting up. • Useful for single VM setups. • ⛔ If running multiple Porta VMs in a replication group, DO NOT run this command. | 0.9.14.2+ |
porta_set_bootstrap_OFF | • Sets the bootstrap flag to OFF on this machine. • Causes this machine to NOT set itself as primary when starting up | 0.9.14.2+ |
porta_laravel_logs | View logs for Porta | 0.9.14.2+ |
porta_laravel_logs_follow | Follow logs for Porta | 0.9.14.2+ |
porta_php_errors | View PHP error logs for Porta | 0.9.14.2+ |
porta_php_errors_follow | Follow PHP error logs for Porta | 0.9.14.2+ |
porta_task_logs | View Porta task runner logs | 0.9.14.2+ |
porta_task_logs_follow | Follow Porta task runner logs | 0.9.14.2+ |
porta_horizon_logs | View Porta Horizon queue logs | 0.9.14.2+ |
porta_horizon_logs_follow | Follow Porta Horizon queue logs | 0.9.14.2+ |
porta_main_db_logs | View Porta database logs (if this is the Main machine) | 0.9.14.2+ |
porta_main_db_logs_follow | Follow Porta database logs (if this is the Main machine) | 0.9.14.2+ |
porta_backup_db_logs | View Porta database logs (if this is the Backup machine) | 0.9.14.2+ |
porta_backup_db_logs_follow | Follow Porta database logs (if this is the Backup machine) | 0.9.14.2+ |
porta_arbiter_db_logs | View Porta database logs (if this is the Arbiter machine) | 0.9.14.2+ |
porta_arbiter_db_logs_follow | Follow Porta database logs (if this is the Arbiter machine) | 0.9.14.2+ |
porta_db_dump | • mysqldump the Porta database.• Defaults to porta-db and porta database. • Usage: porta_db_dump [db_container_name] [db_name] | 0.9.14.2+ |
porta_db_restore | • Restore database from a mysqldump.• Defaults to porta-db and porta database. • Usage: porta_db_restore [db_container_name] [db_name]• Will prompt the user with a list from the local dumps directory | 0.9.14.2+ |
porta_playout_history | • View last 50 items in scheduler playout history. • (if this is the Main machine) | 0.9.14.2+ |
porta_playouts | • View last 50 scheduler playouts (includes actively playing and next). • (if this is the Main machine) | 0.9.14.2+ |
porta_backup_playout_history | • View last 50 items in scheduler playout history. • (if this is the Backup machine) | 0.9.14.2+ |
porta_backup_playouts | • View last 50 scheduler playouts (includes actively playing and next). • (if this is the Backup machine) | 0.9.14.2+ |
porta_arbiter_playout_history | • View last 50 items in scheduler playout history. • (if this is the Arbiter machine) | 0.9.14.2+ |
porta_arbiter_playouts | • View last 50 scheduler playouts (includes actively playing and next). • (if this is the Arbiter machine) | 0.9.14.2+ |
Scripts
Section titled “Scripts”VM Location: ~/scripts/porta/
| Script | Notes | Versions |
|---|---|---|
view-ALL-group-repl-status.sh | • View group replication status as reported by each machine in the group. • ⚠️ Machine IPs must be correct in /etc/hosts | All |