Jenkins服务在备份后不会启动
我的组织需要对我们严格定制的Jenkins实例进行备份。在对用于备份Jenkins的不同方法进行了一些研究之后,我们决定使用xcopy
复制整个Jenkins目录,然后将备份移动到另一台计算机上的新实例。 (之所以使用xcopy
是它的唯一的方式保留他们各自的工作范围内的符号链接文件)Jenkins服务在备份后不会启动
下面是我所采取的步骤:
- 一个批处理文件使用
xcopy
复制整个D:\Jenkins
从旧机器在每晚都会目录 - 我一个新的服务器
- 上安装詹金斯的新鲜比如我停止詹金斯服务运行
- 我删除当前詹金斯DIRECTO RY在新机,然后
xcopy
在其位置备份 - 我尝试启动詹金斯服务,我遇到了以下错误:
The Jenkins service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
我曾尝试在命令行中运行jenkins.war
这只会导致一个Jenkins实例启动,不会注册为Windows服务,并且我无法登录(即使在禁用useSecurity
后),并且看起来没有我们的修改。
我也尝试清除应用程序日志,并没有帮助。
我不知道如何让Jenkins服务启动并运行。
您需要备份的一个文件夹是一个由the environment variable JENKINS_HOME
引用它最好是保持该文件夹从像C:\Program Files (x86)\jenkins
安装文件夹分开。
然后,我更喜欢使用tomcat instance, and copy the jenkins.war in it:它是更容易升级:
Simply overwrite your jenkins.war with the new version. Tomcat should automatically redeploy the application.
@TaylorLiss直接作为'Java的罐子jenkins.war',我想? – VonC
我检查了Jenkins的配置页面,并将'Home Directory'设置为'D:/ Jenkins'。所以,这并不意味着我需要复制整个文件夹(正如我一直试图做的那样?) –
@TaylorLiss是的,除了需要运行jenkins本身的文件(如jenkins.war)。这就是为什么我建议设置Jenkins的主目录而不是jenkins.war的位置。否则,您将获得https://stackoverflow.com/a/38606016/6309 – VonC