Всем привет.
Потребовалось обновить OSS Nexus 3 до последней, на момент написания заметки, версии — 3.76.0
Nexus — это система для организации репозиториев будь то для docker или чего-то другого.
Начиная с версии 3.71 отказались от OrientDB и надо выполнить миграцию на H2 или Potgresql. Так же больше не поддерживается Java 8 или 11 версии.
Начнем…
!!!НЕ забывайте про резервное копирование Nexus перед началом обновления и\или любые другими действиями, которые могут привести к повреждению\потере данных!!!
Подготовка.
На момент заметки у нас была установлена вот такая версия:
Для начала обновимся до последней версии, которая еще поддерживает OrientDB — 3.70.3 (ссылка внизу на всякий случай).
Скачать архив:
1 | wget https://download.sonatype.com/nexus/3/nexus-3.70.3-01-unix.tar.gz |
Распаковать:
1 | tar xf nexus-3.70.3-01-unix.tar.gz |
можно добавить ключ -v для вывода в консоль.
Теперь переместим распакованный каталог, где находится Nexus. У меня это /opt:
1 | sudo mv nexus-3.70.3-01 /opt/ |
Тут же у меня символическая ссылка
Остановим службу:
1 | sudo systemctl stop nexus |
Удалим ссылку:
1 | sudo rm nexus |
и создадим новую:
1 | sudo ln -s /opt/nexus-3.70.3-01 /opt/nexus |
проверим:
Теперь или скопируем файлы конфигурации из прошлой версии, либо отредактируем — кому как удобно. Файлы:
- bin/nexus.rc
- bin/nexus.vmoptions
Назначим права на каталоги:
1 | sudo chown -R nexus:nexus /opt/nexus /opt/sonatype-work |
Запустим сервис:
1 | sudo systemctl start nexus |
Проверим статус сервиса:
1 | sudo systemctl status nexus |
Проверим в браузере:
Как посмотреть что используется OrientDB?
Залогинимся под админской учеткой и перейдем:
Support —> System Information
И тут либо поискать, либо промотать и найти nexus.orient.enabled
Т.к. новая версия хочет Java 17, то надо установить, если еще не установлена:
1 | sudo apt install openjdk-17-jdk |
И проверить:
1 | java --version |
Миграция БД OrientDB -> H2
Теперь надо сделать миграцию БД с Orinet в Postgresql или H2.
Т.к. для миграции на PostgreSQL надо иметь PRO версию, то буду пробовать на H2, хотя с ней никогда не работал ранее.
Для начала сделаем резервную копию БД, т.к. это одно из условий миграции:
Perform a full backup using the backup task.
Copy the backup to a clean working location on a different filesystem so that any extraction doesn’t impact the existing production system.
Это делается в самом Nexus: Configuration (шестеренка) —> Tasks —> Create task
Жмём на Create task и выбираем — Admin — Export databases for backup
Тут указываем:
- Task name: — название задачи. Произвольное, понятное для вас;
- Backup location: — расположение где будет лежать резервная копия (я заранее подготовил каталог);
- Task frequency: — когда выполнять. Я указал Manual.
- Остальные параметры по своему усмотрению.
Жмём Create task.
Вернулись к списку заданий. Теперь можем перейти в новое задание и запустить его:
И увидим, что задача запущена:
И можно посмотреть, что создаются резервные копии:
1 | ls -l /mnt/nexus_blob/backup/nexus_orient_db/ |
А в списке задач будет наше задание в состоянии выполнения:
Ждем выполнения. Потом задание должно перейти в статус Waiting и результат Ok:
Скачаем утилиту миграции:
1 | wget https://download.sonatype.com/nexus/nxrm3-migrator/nexus-db-migrator-3.70.3-01.jar |
Проверим версию Java.
1 | java --version |
Должна быть 8 или 11 во время миграции БД. Потом можно будет изменить на 17-ю, т.к. новая версия Nexus не поддерживает 8-ю или 11-ю версию. Изменить можно так:
1 | sudo update-alternatives --config java |
И выбрать 8-ю версию. Потом еще раз проверить командой:
1 | java -version |
Одно из условий миграции звучит так:
If migrating off of OrientDB, you will run the database migrator utility from this location.
Стало быть скопируем или переместим утилиту к БД:
1 | cp nexus-db-migrator-3.70.3-01.jar /opt/sonatype-work/nexus3/orient |
Запустим миграцию:
1 2 3 | java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M \ -jar nexus-db-migrator-*.jar \ --migration_type=h2 |
До запуска надо оставить nexus, но если этого не сделать, то будет запрос на его установку:
И утилита написала вот такую ошибку:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 09:58:55 [main] WARN c.s.n.d.migrator.MigratorApplication - Please ensure any Nexus Repository instance has been gracefully shut down before proceeding. 09:58:55 [main] INFO c.s.n.d.migrator.MigratorApplication - Do you want to continue [y/n]? y 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - --content_migration parameter is absent. Setting it to true. 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - Force parameter wasn't found. Setting it to false by default. 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------ 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - Java version: Private Build 1.8.0_432 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - JVM arguments: -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - Migrator arguments: --migration_type=h2 --content_migration=true --export_json=false --force=false 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------ 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - Starting MigratorApplication v3.70.3-01 using Java 1.8.0_432 on worker-server with PID 149216 (/opt/sonatype-work/nexus3/orient/nexus-db-migrator-3.70.3-01.jar started by root in /opt/sonatype-work/nexus3/orient) 10:00:38 [main] INFO c.s.n.d.migrator.MigratorApplication - No active profile set, falling back to 1 default profile: "default" 10:00:41 [main] INFO o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2 10:00:41 [main] INFO c.s.n.d.migrator.MigratorApplication - Started MigratorApplication in 3.148 seconds (JVM running for 106.659) 10:00:41 [main] INFO o.s.b.a.b.JobLauncherApplicationRunner - Running default command line with: [--migration_type=h2, --content_migration=true, --export_json=false, --force=false] 10:00:41 [main] INFO c.s.n.d.m.validator.PathValidator - Validating Orient directory contains .bak files: /opt/sonatype-work/nexus3/orient 10:00:41 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener - Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 10:00:41 [main] ERROR o.s.boot.SpringApplication - Application run failed java.lang.IllegalStateException: Failed to execute ApplicationRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763) at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at com.sonatype.nexus.db.migrator.MigratorApplication.main(MigratorApplication.java:117) Caused by: com.sonatype.nexus.db.migrator.exception.InvalidMigrationFilesException: The migration files in /opt/sonatype-work/nexus3/orient do not match the expected requirements: No backup files (*.bak) found. |
No backup files (*.bak)
Перенесу ее в каталог с бэкапами и оттуда запущу.
Большой лог под спойлером:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | root@worker-server:/mnt/nexus_blob/backup/nexus_orient_db# java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M -jar nexus-db-migrator-*.jar --migration_type=h2 10:03:53 [main] WARN c.s.n.d.migrator.MigratorApplication - Please ensure any Nexus Repository instance has been gracefully shut down before proceeding. 10:03:53 [main] INFO c.s.n.d.migrator.MigratorApplication - Do you want to continue [y/n]? y 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - --content_migration parameter is absent. Setting it to true. 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - Force parameter wasn't found. Setting it to false by default. 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------ 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - Java version: Private Build 1.8.0_432 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - JVM arguments: -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - Migrator arguments: --migration_type=h2 --content_migration=true --export_json=false --force=false 10:03:55 [main] INFO c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------ 10:03:56 [main] INFO c.s.n.d.migrator.MigratorApplication - Starting MigratorApplication v3.70.3-01 using Java 1.8.0_432 on worker-server with PID 149445 (/mnt/nexus_blob/backup/nexus_orient_db/nexus-db-migrator-3.70.3-01.jar started by root in /mnt/nexus_blob/backup/nexus_orient_db) 10:03:56 [main] INFO c.s.n.d.migrator.MigratorApplication - No active profile set, falling back to 1 default profile: "default" 10:03:58 [main] INFO o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2 10:03:58 [main] INFO c.s.n.d.migrator.MigratorApplication - Started MigratorApplication in 3.18 seconds (JVM running for 5.735) 10:03:59 [main] INFO o.s.b.a.b.JobLauncherApplicationRunner - Running default command line with: [--migration_type=h2, --content_migration=true, --export_json=false, --force=false] 10:03:59 [main] INFO c.s.n.d.m.validator.PathValidator - Validating Orient directory contains .bak files: /mnt/nexus_blob/backup/nexus_orient_db 10:03:59 [main] INFO c.s.n.d.m.validator.PathValidator - Validating Orient directory does not contain database files: /mnt/nexus_blob/backup/nexus_orient_db 10:03:59 [main] INFO c.s.n.d.m.validator.PathValidator - Validating Orient directory contains .bak files: /mnt/nexus_blob/backup/nexus_orient_db 10:03:59 [main] INFO c.s.n.d.m.validator.PathValidator - Validating Orient directory does not contain database files: /mnt/nexus_blob/backup/nexus_orient_db 10:03:59 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - Migration job started at Fri Jan 17 10:03:59 MSK 2025 10:03:59 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [startHealthCheckDeciderStep] 10:03:59 [main] INFO o.s.batch.core.step.AbstractStep - Step: [startHealthCheckDeciderStep] executed in 12ms 10:03:59 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [unzipArchivesStep] 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /mnt/nexus_blob/backup/nexus_orient_db/component-2025-01-17-09-38-35-3.70.3-01.bak to /mnt/nexus_blob/backup/nexus_orient_db/component 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /mnt/nexus_blob/backup/nexus_orient_db/component-2025-01-17-09-38-35-3.70.3-01.bak successfully 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /mnt/nexus_blob/backup/nexus_orient_db/config-2025-01-17-09-38-35-3.70.3-01.bak to /mnt/nexus_blob/backup/nexus_orient_db/config 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /mnt/nexus_blob/backup/nexus_orient_db/config-2025-01-17-09-38-35-3.70.3-01.bak successfully 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipping /mnt/nexus_blob/backup/nexus_orient_db/security-2025-01-17-09-38-35-3.70.3-01.bak to /mnt/nexus_blob/backup/nexus_orient_db/security 10:03:59 [main] INFO c.s.n.d.m.t.UnzipArchivesTasklet - Unzipped /mnt/nexus_blob/backup/nexus_orient_db/security-2025-01-17-09-38-35-3.70.3-01.bak successfully 10:03:59 [main] INFO o.s.batch.core.step.AbstractStep - Step: [unzipArchivesStep] executed in 552ms 10:03:59 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [checkModelVersionsStep] 10:04:01 [main] WARN c.s.n.d.m.c.SchemaVersionsValidator - Missing some schema configurations. Suspecting Nexus Repository Manager to be an OSS instance. 10:04:01 [main] INFO o.s.batch.core.step.AbstractStep - Step: [checkModelVersionsStep] executed in 1s596ms 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [initDatabaseStep] 10:04:01 [main] INFO o.s.batch.core.step.AbstractStep - Step: [initDatabaseStep] executed in 302ms 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [processFullDatabase] 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateQuartzJobDetailsStep] 10:04:01 [main] INFO c.s.n.d.m.p.QuartzJobDetailProcessor - Filtered QuartzJobDetail record Storage facet cleanup 10:04:01 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateQuartzJobDetailsStep migrated 9 records, skipped 0 records 10:04:01 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateQuartzJobDetailsStep] executed in 86ms 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateQuartzJobTriggersStep] 10:04:01 [main] INFO c.s.n.d.m.p.QuartzTriggerProcessor - Filtered QuartzTrigger record Storage facet cleanup 10:04:01 [main] INFO c.s.n.d.m.p.QuartzTriggerProcessor - Filtered QuartzTrigger record MT_8vyjwr8xmbu1 in state BLOCKED 10:04:01 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateQuartzJobTriggersStep migrated 9 records, skipped 0 records 10:04:01 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateQuartzJobTriggersStep] executed in 45ms 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateQuartzJobCalendarsStep] 10:04:01 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateQuartzJobCalendarsStep migrated 0 records, skipped 0 records 10:04:01 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateQuartzJobCalendarsStep] executed in 8ms 10:04:01 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateUsersStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateUsersStep migrated 3 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateUsersStep] executed in 534ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateUserRoleMappingsStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateUserRoleMappingsStep migrated 3 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateUserRoleMappingsStep] executed in 19ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateAnonymousConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateAnonymousConfigurationStep migrated 1 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateAnonymousConfigurationStep] executed in 11ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migratePrivilegesStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migratePrivilegesStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migratePrivilegesStep] executed in 7ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateRolesStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateRolesStep migrated 3 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateRolesStep] executed in 14ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateEmailConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateEmailConfigurationStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateEmailConfigurationStep] executed in 6ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateHttpClientConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateHttpClientConfigurationStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateHttpClientConfigurationStep] executed in 6ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateRealmConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateRealmConfigurationStep migrated 1 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateRealmConfigurationStep] executed in 10ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateDeploymentIdentifierStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateDeploymentIdentifierStep migrated 1 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateDeploymentIdentifierStep] executed in 10ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateScriptsStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateScriptsStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateScriptsStep] executed in 7ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateHealthCheckConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateHealthCheckConfigurationStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateHealthCheckConfigurationStep] executed in 7ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateLdapConfigurationStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateLdapConfigurationStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateLdapConfigurationStep] executed in 6ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateCapabilitiesStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateCapabilitiesStep migrated 8 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateCapabilitiesStep] executed in 20ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateCleanupPoliciesStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateCleanupPoliciesStep migrated 1 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateCleanupPoliciesStep] executed in 11ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateContentSelectorsStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateContentSelectorsStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateContentSelectorsStep] executed in 7ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateApiKeysStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateApiKeysStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateApiKeysStep] executed in 6ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateRepositoriesStep] 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: nuget-hosted nuget-hosted 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'nuget-hosted' to format 'nuget' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: prxmx_mbd_rep raw-hosted 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'prxmx_mbd_rep' to format 'raw' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: nuget.org-proxy nuget-proxy 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'nuget.org-proxy' to format 'nuget' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: docker_mbd_repos2 docker-hosted 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'docker_mbd_repos2' to format 'docker' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: nuget-group nuget-group 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'nuget-group' to format 'nuget' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: maven-releases maven2-hosted 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'maven-releases' to format 'maven2' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: maven-snapshots maven2-hosted 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'maven-snapshots' to format 'maven2' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: maven-central maven2-proxy 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'maven-central' to format 'maven2' 10:04:02 [main] INFO c.s.n.d.m.p.RepositoryProcessor - Processing repository: maven-public maven2-group 10:04:02 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Adding repository name 'maven-public' to format 'maven2' 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateRepositoriesStep migrated 9 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateRepositoriesStep] executed in 44ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateRoutingRulesStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateRoutingRulesStep migrated 0 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateRoutingRulesStep] executed in 9ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateBlobStoresStep] 10:04:02 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateBlobStoresStep migrated 1 records, skipped 0 records 10:04:02 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateBlobStoresStep] executed in 85ms 10:04:02 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateBucketsStep] 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'nuget' for repository name 'nuget-hosted' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'raw' for repository name 'prxmx_mbd_rep' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'nuget' for repository name 'nuget.org-proxy' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'docker' for repository name 'docker_mbd_repos2' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'nuget' for repository name 'nuget-group' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'maven2' for repository name 'maven-releases' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'maven2' for repository name 'maven-snapshots' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'maven2' for repository name 'maven-central' 10:04:03 [main] INFO c.s.n.d.m.utils.RepositoryUtils - Getting format 'maven2' for repository name 'maven-public' 10:04:03 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateBucketsStep migrated 9 records, skipped 0 records 10:04:03 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateBucketsStep] executed in 504ms 10:04:03 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateComponentsStep] 10:04:03 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateComponentsStep migrated 236 records, skipped 0 records 10:04:03 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateComponentsStep] executed in 272ms 10:04:03 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateAssetsStep] 10:04:07 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateAssetsStep migrated 9508 records, skipped 0 records 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateAssetsStep] executed in 3s942ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateDockerForeignLayersStep] 10:04:07 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateDockerForeignLayersStep migrated 0 records, skipped 0 records 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateDockerForeignLayersStep] executed in 6ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateDeletedBlobIndexStep] 10:04:07 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateDeletedBlobIndexStep migrated 0 records, skipped 0 records 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateDeletedBlobIndexStep] executed in 5ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [migrateKeyStoreStep] 10:04:07 [main] INFO c.s.n.d.m.l.ProcessRecordStepListener - migrateKeyStoreStep migrated 2 records, skipped 0 records 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [migrateKeyStoreStep] executed in 26ms 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [processFullDatabase] executed in 5s818ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [createRebuildRepositoryTasksStep] 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [createRebuildRepositoryTasksStep] executed in 5ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [resetTableSequencesStep] 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [resetTableSequencesStep] executed in 52ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [finalDatabaseStep] 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [finalDatabaseStep] executed in 1ms 10:04:07 [main] INFO o.s.batch.core.job.SimpleStepHandler - Executing step: [checkUserDirectoryStep] 10:04:07 [main] WARN c.s.n.d.m.t.CheckUserDirectoryTasklet - You must move the H2 database created by the db-migrator to the $data-dir/db directory before starting Nexus Repository Manager. 10:04:07 [main] INFO o.s.batch.core.step.AbstractStep - Step: [checkUserDirectoryStep] executed in 1ms 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - Migration job finished at Fri Jan 17 10:04:07 MSK 2025 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - Migration job took 8 seconds to execute 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - 9807 records were processed 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - 3 records were filtered 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - 0 records were skipped 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - 9804 records were migrated 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - Created 'Rebuild repository browse' and 'Rebuild repository search' tasks. They will automatically one-time run after starting your Nexus Repository instance. 10:04:07 [main] INFO c.s.n.d.m.l.ProvidingJobInfoListener - Migrated the following formats: [APT, COCOAPODS, CONAN, CONDA, DOCKER, GITLFS, GO, HELM, MAVEN2, NPM, NUGET, P2, PYPI, R, RAW, RUBYGEMS, YUM] |
На выходе получилось вот такое:
Теперь надо сделать так:
Copy the resultant nexus.mv.db file to your $data-dir/db directory.
1 | cp nexus.mv.db /opt/sonatype-work/nexus3/db/ |
И поправим права:
1 | sudo chown nexus:nexus /opt/sonatype-work/nexus3/db/ -R |
Теперь такое:
Edit the $data-dir/etc/nexus.properties file and add the following line:
nexus.datastore.enabled=true
1 | sudo nano /opt/sonatype-work/nexus3/etc/nexus.properties |
У меня это выгляди так:
А теперь вообще вот такое пишут:
Проверим статус и запустим, если не запущено:
1 | sudo systemctl status nexus |
Обновление Nexus до последней версии.
Скачать новый релиз, на момент написания — 3.76.0-03:
1 | wget https://download.sonatype.com/nexus/3/nexus-3.76.0-03-unix.tar.gz |
Процесс обновления описан выше.
После переключить Java на 17-ю версию.
Для удаленного доступа к БД H2 надо:
Остановить Nexus:
1 | sudo systemctl stop nexus |
Добавить в файл — /opt/sonatype-work/nexus3/etc/nexus.properties следующие строки:
1 2 | nexus.h2.httpListenerEnabled=true nexus.h2.httpListenerPort=1234 |
Но тем не менее, БД доступна только локально. Пока, как вариант, надо пробросить туннель и в таком случае можно будет зайти.
Ссылки:
установка Nexus в Ubuntu 22.04 | сохраненная копия
If you found an error, highlight it and press Shift + Enter or to inform us.