我需要從備份(AWS快照)恢復我的詹金斯配置恢復詹金斯備份。我有一個EC2實例,跟隨並更新,失去了jenkins配置。我的第一個嘗試是將EC2 AMI恢復到更新前的位置,但仍然缺少jenkins配置。來自另一個系統
我們採取詹金斯的AWS快照夜間。從這裏我創建了一個卷並將其安裝到EC2盒子上。我將它安裝到/media/jenkins/
並看到jenkins數據在那裏。它進來了37Gb。我restinstalled詹金斯上的實例,並試圖符號鏈接/var/lib/jenkins/
到/media/jenkins/
然而,這引起Too many levels of symbolic links
這是jenkins_home這是37GB。 jenkins運行的EC2實例只有17 GB免費(這是一個40GB的Box)。因此,我假定備份中的所有數據都不是原來的框。
我的問題是,我需要複製整個37GB到的/ var/lib中/詹金斯/這似乎蠻力的方法,還是有挽回詹金斯一個更明智的方式。
這裏是我的空詹金斯配置
[10:43][ip-10-0-33-8:/var/lib/jenkins[1]]$ ls -la
total 8
drwxr-xr-x 2 root root 4096 Oct 4 12:06 .
drwxr-xr-x 27 root root 4096 Oct 4 11:04 ..
,並在備份安裝
[10:43][ip-10-0-33-8:/media/jenkins[1]]$ ls -la
total 12
drwxr-xr-x 3 jenkins jenkins 4096 Oct 4 12:10 .
drwxr-xr-x 3 root root 4096 Oct 4 10:42 ..
drwxr-xr-x 40 jenkins jenkins 4096 Sep 29 16:12 jenkins_home
而且裏面jenkins_home
[10:26][ip-10-0-33-8:/media/jenkins/jenkins_home]$ ls -la
total 476
drwxr-xr-x 40 jenkins jenkins 4096 Sep 29 16:12 .
drwxr-xr-x 3 jenkins jenkins 4096 Oct 4 12:10 ..
drwxr-xr-x 2 jenkins jenkins 4096 Sep 28 14:35 .apex
-rw------- 1 jenkins jenkins 2948 Aug 17 10:27 .bash_history
drwxr-xr-x 3 jenkins jenkins 4096 Feb 9 2017 .bower
drwxr-xr-x 3 jenkins jenkins 4096 Jan 28 2017 cache
drwxr-xr-x 6 jenkins jenkins 4096 Jul 11 13:36 .cache
drwxr-xr-x 9 jenkins jenkins 4096 Jun 21 15:08 caches
-rw-r--r-- 1 jenkins jenkins 252 Aug 16 16:47 com.chikli.hudson.plugin.naginator.NaginatorPublisher.xml
-rw-r--r-- 1 jenkins jenkins 120 Jan 29 2017 com.cloudbees.jenkins.GitHubPushTrigger.xml
-rw-r--r-- 1 jenkins jenkins 337 Aug 16 16:47 com.smartcodeltd.jenkinsci.plugins.buildmonitor.BuildMonitorView.xml
drwxr-xr-x 6 jenkins jenkins 4096 Aug 17 10:25 .config
-rw-r--r-- 1 jenkins jenkins 14794 Sep 25 08:43 config.xml
-rw-r--r-- 1 jenkins jenkins 0 Jan 29 2017 Connection Activity monitoring to slaves.log
-rw-r--r-- 1 jenkins jenkins 1155 Aug 7 15:29 credentials-configuration.xml
-rw-r--r-- 1 jenkins jenkins 4288 Jul 26 11:27 credentials.xml
drwxr-xr-x 3 jenkins jenkins 4096 Jan 28 2017 docs
-rw-r--r-- 1 jenkins jenkins 0 Jan 29 2017 Download metadata.log
drwxr-xr-x 258 jenkins jenkins 4096 Jan 28 2017 fingerprints
drwxr-xr-x 2 jenkins jenkins 4096 Jan 29 2017 .fontconfig
-rw-r--r-- 1 jenkins jenkins 214 Aug 16 16:47 github-plugin-configuration.xml
drwxr-xr-x 3 jenkins jenkins 4096 Jan 29 2017 .groovy
-rw-r--r-- 1 jenkins jenkins 808 Aug 16 16:47 hudson.maven.MavenModuleSet.xml
-rw-r--r-- 1 jenkins jenkins 159 Sep 25 08:42 hudson.model.UpdateCenter.xml
-rw-r--r-- 1 jenkins jenkins 288 Aug 16 16:47 hudson.plugins.analysis.core.GlobalSettings.xml
-rw-r--r-- 1 jenkins jenkins 1521 Aug 16 16:47 hudson.plugins.emailext.ExtendedEmailPublisher.xml
-rw-r--r-- 1 jenkins jenkins 322 Aug 16 16:47 hudson.plugins.git.GitSCM.xml
-rw-r--r-- 1 jenkins jenkins 370 May 15 16:04 hudson.plugins.git.GitTool.xml
-rw-r--r-- 1 jenkins jenkins 688 Aug 16 16:47 hudson.plugins.throttleconcurrents.ThrottleJobProperty.xml
-rw-r--r-- 1 jenkins jenkins 523 Aug 16 16:47 hudson.scm.CVSSCM.xml
-rw-r--r-- 1 jenkins jenkins 388 Aug 16 16:47 hudson.scm.SubversionSCM.xml
-rw-r--r-- 1 jenkins jenkins 145 May 15 16:04 hudson.tasks.Ant.xml
-rw-r--r-- 1 jenkins jenkins 626 Aug 16 16:47 hudson.tasks.Mailer.xml
-rw-r--r-- 1 jenkins jenkins 571 May 15 16:04 hudson.tasks.Maven.xml
-rw-r--r-- 1 jenkins jenkins 76 Aug 16 16:47 hudson.tasks.Shell.xml
-rw-r--r-- 1 jenkins jenkins 215 Aug 16 16:47 hudson.triggers.SCMTrigger.xml
-rw------- 1 jenkins jenkins 1680 Jan 29 2017 identity.key.enc
drwxr-xr-x 3 jenkins jenkins 4096 Jan 29 2017 .java
drwxr-xr-x 3 jenkins jenkins 4096 Jan 30 2017 .jenkins
-rw-r--r-- 1 jenkins jenkins 94 Jun 29 16:08 jenkins.CLI.xml
drwxr-xr-x 2 jenkins jenkins 4096 Jan 28 2017 jenkins.diagnostics.ooom.OutOfOrderBuildMonitor
-rw-r--r-- 1 jenkins jenkins 6 Jan 29 2017 jenkins.install.InstallUtil.lastExecVersion
-rw-r--r-- 1 jenkins jenkins 6 Jan 29 2017 jenkins.install.UpgradeWizard.state
-rw-r--r-- 1 jenkins jenkins 191 Aug 16 16:47 jenkins.metrics.api.MetricsAccessKey.xml
-rw-r--r-- 1 jenkins jenkins 159 Aug 16 16:47 jenkins.model.ArtifactManagerConfiguration.xml
-rw-r--r-- 1 jenkins jenkins 138 Jan 29 2017 jenkins.model.DownloadSettings.xml
-rw-r--r-- 1 jenkins jenkins 236 Aug 16 16:47 jenkins.model.JenkinsLocationConfiguration.xml
-rw-r--r-- 1 jenkins jenkins 247 May 15 16:04 jenkins.mvn.GlobalMavenConfig.xml
-rw-r--r-- 1 jenkins jenkins 457 May 15 16:04 jenkins.plugins.shiningpanda.tools.PythonInstallation.xml
-rw-r--r-- 1 jenkins jenkins 401 Aug 16 16:47 jenkins.plugins.slack.SlackNotifier.xml
-rw-r--r-- 1 jenkins jenkins 310 Aug 16 16:47 jenkins.plugins.slack.webhook.GlobalConfig.xml
-rw-r--r-- 1 jenkins jenkins 169 Jan 29 2017 jenkins.security.QueueItemAuthenticatorConfiguration.xml
drwxr-xr-x 87 jenkins jenkins 4096 Sep 14 11:52 jobs
drwxr-xr-x 3 jenkins jenkins 4096 Jan 31 2017 .local
drwxr-xr-x 5 jenkins jenkins 4096 Jan 28 2017 logs
drwxr-xr-x 3 jenkins jenkins 4096 Jan 30 2017 .m2
drwxr-xr-x 5 jenkins jenkins 4096 Jul 14 14:31 .node-gyp
-rw-r--r-- 1 jenkins jenkins 911 Sep 25 08:42 nodeMonitors.xml
drwxr-xr-x 5 jenkins jenkins 4096 Sep 30 07:49 nodes
drwxr-xr-x 938 jenkins jenkins 36864 Sep 4 13:57 .npm
-rw-r--r-- 1 jenkins jenkins 241 Aug 16 16:47 org.codefirst.SimpleThemeDecorator.xml
-rw-r--r-- 1 jenkins jenkins 298 May 15 16:04 org.jenkinsci.plugins.docker.commons.tools.DockerTool.xml
-rw-r--r-- 1 jenkins jenkins 1830 Sep 25 08:43 org.jenkinsci.plugins.ghprb.GhprbTrigger.xml
-rw-r--r-- 1 jenkins jenkins 255 May 15 16:04 org.jenkinsci.plugins.gitclient.JGitApacheTool.xml
-rw-r--r-- 1 jenkins jenkins 243 May 15 16:04 org.jenkinsci.plugins.gitclient.JGitTool.xml
-rw-r--r-- 1 jenkins jenkins 290 Aug 16 16:47 org.jenkinsci.plugins.pipeline.modeldefinition.config.GlobalConfig.xml
-rw-r--r-- 1 jenkins jenkins 46 Sep 29 15:57 org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml
-rw-r--r-- 1 jenkins jenkins 218 Aug 16 16:47 org.jenkinsci.plugins.workflow.libs.GlobalLibraries.xml
-rw-r--r-- 1 jenkins jenkins 367 Aug 16 16:47 org.jenkinsci.plugins.zap.ZAPBuilder.xml
-rw-r--r-- 1 jenkins jenkins 185 Aug 16 16:47 org.jvnet.hudson.plugins.SSHBuildWrapper.xml
-rw-r--r-- 1 jenkins jenkins 2630 Jan 29 2017 Out of order build detection.log
-rw-r--r-- 1 jenkins jenkins 46 Oct 1 00:35 .owner
drwxr----- 3 jenkins jenkins 4096 Jan 30 2017 .pki
drwxr-xr-x 2 jenkins jenkins 4096 Sep 14 14:45 .plotly
drwxr-xr-x 141 jenkins jenkins 20480 Sep 6 13:11 plugins
drwxr-xr-x 2 jenkins jenkins 4096 Aug 11 16:52 .pylint.d
drwxr-xr-x 3 jenkins jenkins 4096 Mar 3 2017 .python-eggs
-rw-r--r-- 1 jenkins jenkins 18064 Sep 25 08:42 queue.xml.bak
drwxr-xr-x 3 jenkins jenkins 4096 Jan 30 2017 .qws
-rw-r--r-- 1 jenkins jenkins 369 Jun 29 16:08 scriptApproval.xml
-rw-r--r-- 1 jenkins jenkins 64 Jan 29 2017 secret.key
-rw-r--r-- 1 jenkins jenkins 0 Jan 29 2017 secret.key.not-so-secret
drwx------ 4 jenkins jenkins 4096 Jun 29 16:00 secrets
drwx------ 2 jenkins jenkins 4096 Jul 3 14:51 .ssh
drwxrwxrwx 522 jenkins jenkins 20480 Sep 28 12:43 temp
drwxr-xr-x 3 jenkins jenkins 4096 Jan 28 2017 test
drwxr-xr-x 16 jenkins jenkins 4096 Jan 28 2017 tmp
drwxr-xr-x 3 jenkins jenkins 4096 Jan 28 2017 tools
drwxr-xr-x 2 jenkins jenkins 4096 Sep 30 08:43 updates
drwxr-xr-x 2 jenkins jenkins 4096 Jan 28 2017 userContent
drwxr-xr-x 77 jenkins jenkins 4096 Sep 18 14:07 users
-rw------- 1 jenkins jenkins 792 May 15 13:05 .viminfo
drwxr-xr-x 2 jenkins jenkins 4096 Jan 28 2017 workflow-libs
drwxr-xr-x 108 jenkins jenkins 12288 Sep 25 01:06 workspace
drwxr-xr-x 2 jenkins jenkins 4096 Aug 16 16:55 .ZAP
這有什麼好做詹金斯或AWS,而是與你的目錄樹結構如何做。不幸的是,你並沒有提供任何有關這方面的信息,但是我首先從(1)你用來做符號鏈接的確切命令開始,帶有錯誤,從終端__複製,和(2)'ls -al' '/ var/lib/jenkins'和'/ media/jenkins'。 – kdgregory
@kdgregory證明符號鏈接的問題是通過使用完整路徑而不是相對路徑來解決的。它仍然不能解決我的問題,因爲我需要執行jenkins的初始安裝,然後切換'JENKINS_HOME'變量。 – atomicfruitcake
這也與DevOps無關:-) – StephenKing