### Setup SIR Indexing Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Install the database schema required for SIR (Search Index Replication) indexing. This is a prerequisite for building search indexes. ```bash admin/setup-sir install ``` -------------------------------- ### Install Docker and Git on Ubuntu Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Installs necessary software for running Docker and Git on Ubuntu systems. Ensures Docker service is enabled and started. ```bash sudo apt-get update && \ sudo apt-get install docker.io docker-compose-v2 git && \ sudo systemctl enable --now docker.service ``` -------------------------------- ### Configure and Start Replication Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Grants access to the replication token and restarts the Docker services to apply the configuration. ```bash admin/configure add replication-token ``` ```bash docker compose up -d ``` -------------------------------- ### Start MusicBrainz Docker Compose Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Starts the MusicBrainz services in detached mode. This makes the local website available at http://localhost:5000. ```bash docker compose up -d ``` -------------------------------- ### Set Up MusicBrainz Docker for Testing Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Commands to set up a MusicBrainz Docker instance with sample data for testing. This setup downloads a sample data dump and runs MusicBrainz Server in standalone mode. ```bash git clone https://github.com/metabrainz/musicbrainz-docker.git cd musicbrainz-docker admin/configure add musicbrainz-standalone docker compose build docker compose run --rm musicbrainz createdb.sh -sample -fetch docker compose up -d ``` -------------------------------- ### Set up Local MusicBrainz Server Development Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Clone the MusicBrainz Server and Docker repositories, configure environment variables, build, and run the development environment. This setup enables automatic recompilation of JavaScript and resources, and restarts on Perl file changes. ```bash git clone https://github.com/metabrainz/musicbrainz-server.git MUSICBRAINZ_SERVER_LOCAL_ROOT=$PWD/musicbrainz-server git clone https://github.com/metabrainz/musicbrainz-docker.git cd musicbrainz-docker echo MUSICBRAINZ_DOCKER_HOST_IPADDRCOL=127.0.0.1: >> .env echo MUSICBRAINZ_SERVER_LOCAL_ROOT="$MUSICBRAINZ_SERVER_LOCAL_ROOT" >> .env admin/configure add musicbrainz-dev docker compose build docker compose run --rm musicbrainz createdb.sh -sample -fetch docker compose up -d ``` -------------------------------- ### Configure for Database-Only Mirror Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Configures the MusicBrainz Docker setup to mirror only the PostgreSQL database, excluding the website and web API. This command should be run as a first step. ```bash admin/configure with alt-db-only-mirror ``` -------------------------------- ### Set up Local Search Index Rebuilder Development Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Configure and build the Search Index Rebuilder (SIR) for local development. This involves setting environment variables in .env, running the configure script, building the indexer image, and starting the services. ```bash admin/configure add sir-dev docker compose build indexer docker compose up -d ``` -------------------------------- ### Build Docker Images Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Builds the Docker images for the services defined in the Docker Compose file. This command should be run once before starting the services. ```bash docker compose build ``` -------------------------------- ### Customize Memory Settings for DB and Search Services Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Create a YAML file to customize memory settings for 'db' and 'search' services. This example sets 4GB RAM for both. After creating the file, use the 'admin/configure' script to add it and restart Docker Compose. ```yaml # Description: Customize memory settings services: db: command: postgres -c "shared_buffers=4GB" search: environment: - SOLR_HEAP=4g ``` ```bash admin/configure add local/compose/memory-settings.yml docker compose up -d ``` -------------------------------- ### Publish Database Port Only Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md This command is for database-only mirror setups, publishing only the 'db' service port. Ensure Docker Compose is up to date. ```bash admin/configure add publishing-db-port docker compose up -d ``` -------------------------------- ### Clone MusicBrainz Docker Repository Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Clones the MusicBrainz Docker repository and changes the current directory to the cloned repository. This is the initial step for installation. ```bash git clone https://github.com/metabrainz/musicbrainz-docker.git cd musicbrainz-docker ``` -------------------------------- ### Get Help for Admin Scripts Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Display help information for the admin helper scripts. These scripts are used for various administrative tasks when running MusicBrainz services locally. ```bash admin/configure --help ``` ```bash admin/setup-sir --help ``` ```bash admin/purge-message-queues --help ``` ```bash admin/set-replication-token --help ``` -------------------------------- ### Schedule Regular Search Index Rebuild with Cron Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Example cron job to schedule regular rebuilding of search indexes. Ensure YOUR_USER_NAME is replaced with the actual username. ```crontab 0 1 * * 7 YOUR_USER_NAME cd ~/musicbrainz-docker && /usr/bin/docker compose exec -T indexer python -m sir reindex ``` -------------------------------- ### Get MusicBrainz Service Logs Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Retrieve logs for the musicbrainz service to diagnose issues like loadable library and Perl binary mismatches. ```bash docker compose logs --timestamps musicbrainz ``` -------------------------------- ### Rebuild Python Dependencies Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Execute these commands within the indexer service to remove existing Python packages and cache, forcing a fresh installation upon restart. ```bash docker compose exec indexer rm -fr /code/.cache /code/venv-musicbrainz-docker docker compose restart indexer ``` -------------------------------- ### Rebuild Search Indexes Manually Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Manually rebuilds search indexes from the installed database. This can be time-consuming and requires sufficient RAM for the search server (Solr). Consider adjusting Java heap settings. ```bash docker compose exec indexer python -m sir reindex ``` -------------------------------- ### Disable Replication Cron Job Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Before enabling live indexing, disable the replication cron job if it was previously enabled. This ensures a stable setup for the experimental live indexing feature. ```bash admin/configure rm replication-cron docker compose up -d ``` -------------------------------- ### Download Pre-built Search Indexes Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Downloads and loads pre-built search indexes from backup archives. This is a faster alternative to manual rebuilding but requires significant disk space. ```bash docker compose up -d musicbrainz search ``` ```bash docker compose exec search fetch-backup-archives ``` ```bash docker compose exec search load-backup-archives ``` -------------------------------- ### Schedule Replication with Docker Compose Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Configures the MusicBrainz service to automatically run replication daily at 3 am UTC. This command should be run as root. ```bash admin/configure add replication-cron ``` ```bash docker compose up -d ``` -------------------------------- ### Create MusicBrainz Database Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Downloads the latest full data dumps and creates the MusicBrainz database. It's recommended to adjust memory settings before running this command. ```bash docker compose run --rm musicbrainz createdb.sh -fetch ``` -------------------------------- ### Enable Live Indexing Search Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Configure the indexer to watch for reindex messages to enable live indexing. This command should be run after setting up the database schema and building search indexes. ```bash admin/configure add live-indexing-search docker compose up -d ``` -------------------------------- ### Run Replication Once and Monitor Log Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Executes the replication script once and tails the mirror log file to monitor progress. Runs replication in the background. ```bash bash -c 'docker compose exec musicbrainz replication.sh &' && docker compose exec musicbrainz /usr/bin/tail -f mirror.log ``` -------------------------------- ### Publish Ports for All Services Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Use this command to publish ports for 'db', 'valkey', and 'search' services, in addition to 'musicbrainz'. Ensure Docker Compose is up to date. ```bash admin/configure add publishing-all-ports docker compose up -d ``` -------------------------------- ### Build Materialized Tables with Docker Compose Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Optional step to improve performance by building denormalized tables. Ensure the MusicBrainz server is configured to use these tables. ```bash docker compose run --rm musicbrainz bash -c 'carton exec -- ./admin/BuildMaterializedTables --database=MAINTENANCE all' ``` -------------------------------- ### Recreate MusicBrainz Database with New Data Dumps Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Recreate the MusicBrainz database and fetch new data dumps before doing so. This command requires the postgres password from postgres.env. ```bash docker compose run --rm musicbrainz recreatedb.sh -fetch ``` -------------------------------- ### Recreate Database with Indexed Search Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Use this sequence of commands to stop the current services, fetch an indexed database dump, purge message queues, and restart the search service with the new database. Ensure you have the correct PostgreSQL password when prompted. ```bash admin/configure rm replication-cron # if replication is enabled docker compose stop docker compose run --rm musicbrainz fetch-dump.sh indexed admin/purge-message-queues docker compose up -d search docker compose exec search fetch-backup-archives docker compose exec search load-backup-archives # See the note no. 1 below docker compose run --rm musicbrainz recreatedb.sh docker compose up -d admin/setup-sir install admin/configure add replication-cron docker compose up -d # See the note no. 2 below ``` -------------------------------- ### Gather Version Information for Issues Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md When reporting issues, collect detailed version information for MusicBrainz Docker, Docker Compose, and the Docker client/server to aid in troubleshooting. ```bash echo MusicBrainz Docker: `git describe --always --broken --dirty --tags` && \ echo Docker Compose: `docker compose version --short` && \ docker version -f 'Docker Client/Server: {{.Client.Version}}/{{.Server.Version}}' ``` -------------------------------- ### Check Current Version Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Determine the currently checked out version of the MusicBrainz Docker project, including any local modifications. ```bash git describe --dirty ``` -------------------------------- ### Diagnose InitDb.pl Failure on macOS Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md This log output indicates a database connection issue during initialization on macOS. It suggests increasing container memory. ```log Wed Feb 24 14:29:01 2021 : Creating indexes ... (CreateIndexes.sql) Wed Feb 24 14:29:12 2021 : psql:/musicbrainz-server/admin/sql/CreateIndexes.sql:467: server closed the connection unexpectedly Wed Feb 24 14:29:12 2021 : This probably means the server terminated abnormally Wed Feb 24 14:29:12 2021 : before or while processing the request. Wed Feb 24 14:29:12 2021 : psql:/musicbrainz-server/admin/sql/CreateIndexes.sql:467: fatal: connection to server was lost Error during CreateIndexes.sql at /musicbrainz-server/admin/InitDb.pl line 117. Wed Feb 24 14:29:12 2021 : InitDb.pl failed ``` -------------------------------- ### Clean and Reinstall Perl Modules Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Remove the existing Perl modules and restart the musicbrainz service to force reinstallation with the correct Perl version. ```bash sudo rm -fr "$MUSICBRAINZ_SERVER_LOCAL_ROOT/perl_modules/ docker compose restart musicbrainz ``` -------------------------------- ### View Docker Compose Configuration Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Inspect the environment variables that will be passed to the Docker containers. This command helps in verifying your `.env` file settings. ```bash docker compose config ``` -------------------------------- ### Complete Docker Removal Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Execute this command from the MusicBrainz Docker project directory to stop and remove all associated containers, networks, images, and volumes for a complete uninstallation. ```bash docker compose down --remove-orphans --rmi all --volumes ``` -------------------------------- ### Inspect File Permissions in Dockerfile Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Add 'RUN ls -l file' commands to your Dockerfile to diagnose file permission issues that might cause 'Unknown error executing apt-key'. ```dockerfile # Add RUN ls -l file commands here to debug permissions ``` -------------------------------- ### Recreate MusicBrainz Database Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Recreate the MusicBrainz database within the Docker container. This command requires the postgres password from postgres.env. ```bash docker compose run --rm musicbrainz recreatedb.sh ``` -------------------------------- ### Resolve apt-key Errors During Docker Build Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md This error message during Docker image build for the musicbrainz service suggests issues with GPG key verification for repositories. It may be related to file permission problems. ```log Err:1 https://deb.nodesource.com/node_20.x nodistro InRelease Unknown error executing apt-key [...] W: GPG error: https://deb.nodesource.com/node_20.x nodistro InRelease: Unknown error executing apt-key E: The repository 'https://deb.nodesource.com/node_20.x nodistro InRelease' is not signed. ``` -------------------------------- ### Restart MusicBrainz Server Container Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Restart the MusicBrainz Server container after making code changes in the musicbrainz-server directory. ```bash docker compose restart musicbrainz ``` -------------------------------- ### View Replication Log Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Displays the content of the replication log file, following new entries in real-time. Useful for monitoring replication status. ```bash docker compose exec musicbrainz tail --follow mirror.log ``` -------------------------------- ### Reinstall Perl Module and Restart Service Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Use this command to resolve issues with missing ICU libraries by recompiling the affected Perl module and restarting the MusicBrainz service. ```bash docker compose exec musicbrainz bash -c 'cpanm --reinstall Unicode::ICU::Collator' && \ docker compose restart musicbrainz ``` -------------------------------- ### Troubleshoot Perl Dependency Mismatch Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md This log indicates a mismatch between Perl binaries and loadable libraries, often occurring after changing musicbrainz-server branches. Remove and reinstall Perl modules. ```log ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xcd00080) ``` -------------------------------- ### Inspect Docker Bridge Network Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Use this command to inspect the Docker bridge network configuration when facing 'Temporary failure resolving' errors during Docker image builds. ```bash docker network inspect bridge ``` -------------------------------- ### Restart Docker Daemon Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md Restart the Docker daemon if network resolution issues persist after inspecting the bridge network. ```bash sudo service docker restart ``` -------------------------------- ### Set Replication Token Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Sets the MetaBrainz access token for replication. The token is stored in local/secrets/metabrainz_access_token. ```bash admin/set-replication-token ``` -------------------------------- ### Remove Fetched Archive Files Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md After successfully recreating the database and confirming search results, use this command to clean up the fetched archive files and free up disk space. ```bash sudo docker-compose exec search remove-backup-archives ``` -------------------------------- ### Apply File Permissions Fix in Dockerfile Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md If file permission issues persist, especially on systems like Unraid, use additional 'chmod' commands in your Dockerfile as a workaround. ```dockerfile # Add chmod commands here if needed, e.g., RUN chmod +r /path/to/file ``` -------------------------------- ### Prune Unused Docker Images Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Regularly clean up your Docker environment by removing all unused images, containers, and volumes to free up disk space. Be cautious as this command can affect other Docker projects. ```bash docker system prune --all ``` -------------------------------- ### Diagnose Python ImportError Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/TROUBLESHOOTING.md This error indicates missing Python modules in the indexer service. It can be resolved by clearing the cache and virtual environment. ```log Traceback (most recent call last): [...] ImportError: No module named [...] ``` -------------------------------- ### Check Git Working Tree Status Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Verify that your working tree is clean before making local changes. It is recommended not to modify files tracked by Git directly. ```bash git status ``` -------------------------------- ### Rebuild Specific Search Index Entities Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Rebuilds search indexes for specific entity types (e.g., artist, release) instead of all at once. Useful for targeted updates. ```bash docker compose exec indexer python -m sir reindex --entity-type artist --entity-type release ``` -------------------------------- ### Remove Downloaded Search Index Archives Source: https://github.com/metabrainz/musicbrainz-docker/blob/master/README.md Removes the downloaded search index archive files after they have been loaded. Frees up disk space. ```bash docker compose exec search remove-backup-archives ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.