The nexus book: http://www.sonatype.com/books/nexus-book/reference/. Does not seem to spend any time on how one should go about backing up a nexus repository. If I am installing my snapshot and releases into this local repository, it seems that it would behoove me to back it up. However, I'm not really interested in backing up anything that can easily be downloaded from a remote repository.
nexus书:http://www.sonatype.com/books/nexus-book/reference/。似乎没有花时间考虑如何备份nexus存储库。如果我正在安装我的快照并将其发布到这个本地存储库中,那么我可能需要备份它。但是,我真的不想备份任何可以从远程存储库轻松下载的东西。
Some google searches do not seem to reveal the canonical answer either, so perhaps for posterity it can be recorded here.
一些谷歌搜索似乎也没有透露规范的答案,所以也许后人可以在这里记录。
Thanks, Nathan
2 个解决方案
#1
When you install Nexus, you'll end up with two directories:
安装Nexus时,最终会有两个目录:
nexus-webapp-1.3.1.1/
sonatype-work/
We've separated the application from the data and configuration. The Nexus application is in nexus-webapp-1.3.1.1/
and the data and configuration is in sonatype-work/nexus
. This was mainly done to facilitate easier upgrades, but it also has the side-effect of making it very easy to backup a Nexus installation.
我们已将应用程序与数据和配置分开。 Nexus应用程序位于nexus-webapp-1.3.1.1 /中,数据和配置为sonatype-work / nexus。这主要是为了便于升级,但它也具有使备份Nexus安装变得非常容易的副作用。
The Simple Answer
简单的答案
Nexus doesn't store repositories in a database or do anything that would preclude a simple backup of the file system under sonatype-work/nexus
. If you need to create a complete backup, just archive the contents of the sonatype-work/nexus
.
Nexus不会将存储库存储在数据库中,也不会执行任何会妨碍在sonatype-work / nexus下对文件系统进行简单备份的操作。如果需要创建完整备份,只需归档sonatype-work / nexus的内容。
Better Answer
If you want a more intelligent approach to backing up a Nexus installation, you will certainly want to backup everything under sonatype-work/nexus/conf
, sonatype-work/nexus/storage
, sonatype-work/nexus/template-store
. If you want to backup the metadata and file attributes that Nexus keeps for proxy repository, backup sonatype-work/nexus/proxy
, although this isn't required as the information about the proxy repository will be generated on-demand as attributes are requested.
如果您想要一种更智能的方法来备份Nexus安装,您肯定希望在sonatype-work / nexus / conf,sonatype-work / nexus / storage,sonatype-work / nexus / template-store下备份所有内容。如果要备份Nexus为代理存储库保留的元数据和文件属性,请备份sonatype-work / nexus / proxy,尽管这不是必需的,因为有关代理存储库的信息将在请求属性时按需生成。
You don't need to backup sonatype-work/nexus/logs
and you don't need to backup the Lucene indexes in sonatype-work/nexus/indexer
.
您不需要备份sonatype-work / nexus / logs,也不需要在sonatype-work / nexus / indexer中备份Lucene索引。
Nexus Pro Answer
Nexus Pro答案
There is a Nexus Professional plugin which can automate the process of creating a backup of the Nexus configuration data. This plugin is going to address the contents of the sonatype-work/nexus/conf
directory. If you need to backup the sonatype-work/nexus/storage
directory, you will need to configure some backup system to backup the contents of that filesystem. Once again, as with Nexus Open Source, there is currently no real benefit in backing up the contents of sonatype-work/nexus/indexer
or sonatype-work/nexus/logs
.
有一个Nexus Professional插件可以自动创建Nexus配置数据备份的过程。这个插件将解决sonatype-work / nexus / conf目录的内容。如果需要备份sonatype-work / nexus / storage目录,则需要配置一些备份系统来备份该文件系统的内容。再次,与Nexus Open Source一样,目前没有真正的好处来备份sonatype-work / nexus / indexer或sonatype-work / nexus / logs的内容。
Excluding Storage for Remote Repositories
排除远程存储库的存储
In your question you mention that you want to exclude the storage devoted to the local cache of a remote repository. If you are interested in doing this, you'll have to take a further level of granularity and just exclude the directories under sonatype-work/nexus/storage
that correspond to the remote repositories.
在您的问题中,您提到要排除专用于远程存储库的本地缓存的存储。如果您对此感兴趣,则必须进一步细化级别,并且只需排除sonatype-work / nexus / storage下与远程存储库对应的目录。
Do you need to shut Nexus down for a backup?
你需要关闭Nexus进行备份吗?
Brian Fox told me no, the only real chance for file contention is going to be the files in the indexer/
directory. You shouldn't have a problem backing up the sonatype-work filesystem with a running instance of Nexus.
Brian Fox告诉我不,文件争用的唯一真正机会是索引器/目录中的文件。使用正在运行的Nexus实例备份sonatype-work文件系统应该没有问题。
BTW, thanks for the question, this answer will likely be incorporated into the next version of the Nexus book.
顺便说一句,感谢这个问题,这个答案可能会被纳入下一版本的Nexus书中。
#2
afaik nexus (free version) does not have any backup features, but it should be as simple, as knowing your companies groupId and grabbing it from the storage directories in nexus
afaik nexus(免费版)没有任何备份功能,但它应该像知道你的公司groupId并从nexus中的存储目录中获取它一样简单
but i would schedule a complete repository backup too, you never know when the remote repositories are down, when you need them the most
但是我也会安排一个完整的存储库备份,你永远都不知道远程存储库什么时候关闭,什么时候最需要它们
#1
When you install Nexus, you'll end up with two directories:
安装Nexus时,最终会有两个目录:
nexus-webapp-1.3.1.1/
sonatype-work/
We've separated the application from the data and configuration. The Nexus application is in nexus-webapp-1.3.1.1/
and the data and configuration is in sonatype-work/nexus
. This was mainly done to facilitate easier upgrades, but it also has the side-effect of making it very easy to backup a Nexus installation.
我们已将应用程序与数据和配置分开。 Nexus应用程序位于nexus-webapp-1.3.1.1 /中,数据和配置为sonatype-work / nexus。这主要是为了便于升级,但它也具有使备份Nexus安装变得非常容易的副作用。
The Simple Answer
简单的答案
Nexus doesn't store repositories in a database or do anything that would preclude a simple backup of the file system under sonatype-work/nexus
. If you need to create a complete backup, just archive the contents of the sonatype-work/nexus
.
Nexus不会将存储库存储在数据库中,也不会执行任何会妨碍在sonatype-work / nexus下对文件系统进行简单备份的操作。如果需要创建完整备份,只需归档sonatype-work / nexus的内容。
Better Answer
If you want a more intelligent approach to backing up a Nexus installation, you will certainly want to backup everything under sonatype-work/nexus/conf
, sonatype-work/nexus/storage
, sonatype-work/nexus/template-store
. If you want to backup the metadata and file attributes that Nexus keeps for proxy repository, backup sonatype-work/nexus/proxy
, although this isn't required as the information about the proxy repository will be generated on-demand as attributes are requested.
如果您想要一种更智能的方法来备份Nexus安装,您肯定希望在sonatype-work / nexus / conf,sonatype-work / nexus / storage,sonatype-work / nexus / template-store下备份所有内容。如果要备份Nexus为代理存储库保留的元数据和文件属性,请备份sonatype-work / nexus / proxy,尽管这不是必需的,因为有关代理存储库的信息将在请求属性时按需生成。
You don't need to backup sonatype-work/nexus/logs
and you don't need to backup the Lucene indexes in sonatype-work/nexus/indexer
.
您不需要备份sonatype-work / nexus / logs,也不需要在sonatype-work / nexus / indexer中备份Lucene索引。
Nexus Pro Answer
Nexus Pro答案
There is a Nexus Professional plugin which can automate the process of creating a backup of the Nexus configuration data. This plugin is going to address the contents of the sonatype-work/nexus/conf
directory. If you need to backup the sonatype-work/nexus/storage
directory, you will need to configure some backup system to backup the contents of that filesystem. Once again, as with Nexus Open Source, there is currently no real benefit in backing up the contents of sonatype-work/nexus/indexer
or sonatype-work/nexus/logs
.
有一个Nexus Professional插件可以自动创建Nexus配置数据备份的过程。这个插件将解决sonatype-work / nexus / conf目录的内容。如果需要备份sonatype-work / nexus / storage目录,则需要配置一些备份系统来备份该文件系统的内容。再次,与Nexus Open Source一样,目前没有真正的好处来备份sonatype-work / nexus / indexer或sonatype-work / nexus / logs的内容。
Excluding Storage for Remote Repositories
排除远程存储库的存储
In your question you mention that you want to exclude the storage devoted to the local cache of a remote repository. If you are interested in doing this, you'll have to take a further level of granularity and just exclude the directories under sonatype-work/nexus/storage
that correspond to the remote repositories.
在您的问题中,您提到要排除专用于远程存储库的本地缓存的存储。如果您对此感兴趣,则必须进一步细化级别,并且只需排除sonatype-work / nexus / storage下与远程存储库对应的目录。
Do you need to shut Nexus down for a backup?
你需要关闭Nexus进行备份吗?
Brian Fox told me no, the only real chance for file contention is going to be the files in the indexer/
directory. You shouldn't have a problem backing up the sonatype-work filesystem with a running instance of Nexus.
Brian Fox告诉我不,文件争用的唯一真正机会是索引器/目录中的文件。使用正在运行的Nexus实例备份sonatype-work文件系统应该没有问题。
BTW, thanks for the question, this answer will likely be incorporated into the next version of the Nexus book.
顺便说一句,感谢这个问题,这个答案可能会被纳入下一版本的Nexus书中。
#2
afaik nexus (free version) does not have any backup features, but it should be as simple, as knowing your companies groupId and grabbing it from the storage directories in nexus
afaik nexus(免费版)没有任何备份功能,但它应该像知道你的公司groupId并从nexus中的存储目录中获取它一样简单
but i would schedule a complete repository backup too, you never know when the remote repositories are down, when you need them the most
但是我也会安排一个完整的存储库备份,你永远都不知道远程存储库什么时候关闭,什么时候最需要它们