{"id":6595,"date":"2018-06-01T11:17:09","date_gmt":"2018-06-01T03:17:09","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=6595"},"modified":"2018-06-01T11:34:22","modified_gmt":"2018-06-01T03:34:22","slug":"gitlab%e4%bb%8e7-1-1%e5%8d%87%e7%ba%a7%e5%88%b010-6-6","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/6595.html","title":{"rendered":"Gitlab\u4ece 7.1.1 \u5347\u7ea7\u5230 10.6.6"},"content":{"rendered":"<h3 id=\"\u53c2\u8003\">\u53c2\u8003<\/h3>\n<ul>\n<li>https:\/\/blog.securityevaluators.com\/upgrading-gitlab-ce-from-a-6-9-2-source-installation-to-10-1-0-omnibus-a-novel-cf8c4f78bf99<\/li>\n<li>https:\/\/fak3r.com\/2017\/12\/11\/upgrading-gitlab-from-6x-to-10x\/<\/li>\n<li>https:\/\/www.huangzz.xyz\/gitlab-8-upgrading-gitlab-10-considerations.html<\/li>\n<\/ul>\n<h3 id=\"\u5b89\u88c5\u5305\u4e0b\u8f7d\">\u5b89\u88c5\u5305\u4e0b\u8f7d<\/h3>\n<ul>\n<li>https:\/\/about.gitlab.com\/downloads\/archives\/<\/li>\n<li>https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce<\/li>\n<\/ul>\n<h3 id=\"\u5b89\u88c5-7.1.1-\u7248\u672c\u8fc1\u79fb\u6570\u636e\">\u5b89\u88c5 7.1.1 \u7248\u672c\uff0c\u8fc1\u79fb\u6570\u636e<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -ivh gitlab-7.1.1_omnibus-1.el6.x86_64.rpm\r\nmkdir -p \/etc\/gitlab\r\nvim \/etc\/gitlab\/gitlab.rb\r\nvim \/var\/opt\/gitlab\/gitlab-rails\/etc\/gitlab.yml\r\n\r\nmkdir -p \/data\/gitlab\/git-data\/repositories \/data\/gitlab\/backups \/data\/gitlab\/git-data\/gitlab-satellites; chown -R git:git \/data\/gitlab\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncat \/etc\/gitlab\/gitlab.rb\r\n\r\n# Change the external_url to the address your users will type in their browser\r\nexternal_url 'http:\/\/gitlab.xxx.com'\r\ngit_data_dir '\/data\/gitlab\/git-data\/'\r\ngitlab_rails&#x5B;'backup_path'] = '\/data\/gitlab\/backups'\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\ngitlab-ctl stop unicorn\r\ngitlab-ctl stop sidekiq\r\ngitlab-ctl status\r\n\r\ngitlab-rake gitlab:backup:restore BACKUP={{LATEST,timestamp_only}}\r\n# \u7a7a\u4ed3\u5e93\u4f1a FAILED  \u8017\u65f62\u5c0f\u65f6\r\n\r\ngitlab-ctl restart\r\n\r\ngitlab-rake gitlab:check SANITIZE=true\r\n#\u3000\u7136\u540efix error\r\n\r\ngitlab-rake gitlab:satellites:create RAILS_ENV=production\r\n# gitlab.yml \u4e2d\u914d\u7f6e\u7684 \/var\/opt\/gitlab\/git-data\/gitlab-satellites \u76ee\u5f55\u88ab\u5199\u6ee1\u4e86\r\n# \u4fee\u6539\u6210 \/data\/gitlab\/git-data\/gitlab-satellites\uff0c\u628a\u539f\u6587\u4ef6\u5939\u4e0b\u9762\u5168\u5220\u4e86\uff0c\u518d\u91cd\u65b0\u8fd0\u884c\u547d\u4ee4\r\n<\/pre>\n<p>fix check errors<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit config --global user.name  &quot;GitLab&quot;\r\ngit config --global user.email &quot;gitlab@xxx.com&quot;\r\nchmod -R ug+rwX,o-rwx \/data\/gitlab\/git-data\/repositories\r\nchmod -R ug-s \/data\/gitlab\/git-data\/repositories\r\nfind \/data\/gitlab\/git-data\/repositories -type d -print0 | sudo xargs -0 chmod g+s\r\nchmod u+rwx,g=rx,o-rwx \/data\/gitlab\/git-data\/gitlab-satellites\r\n<\/pre>\n<p>\u6d4b\u8bd5\u53ef\u7528\u6027\uff1a<\/p>\n<ul>\n<li>web<\/li>\n<li>git clone, push<\/li>\n<li>LDAP login<\/li>\n<\/ul>\n<h3 id=\"\u5347\u7ea7\u5230-7.2.3\">\u5347\u7ea7\u5230 7.2.3<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-7.2.3_omnibus-1.el6.x86_64.rpm\r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\n<\/pre>\n<h3 id=\"\u5347\u7ea7\u5230-7.10.4\">\u5347\u7ea7\u5230 7.10.4<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-7.10.4_omnibus-1.x86_64.rpm\r\n\r\n# If you just upgraded from GitLab 7.9 or earlier, please run \r\nln -sf   \/opt\/gitlab\/bin\/gitlab-ctl   \/opt\/gitlab\/bin\/gitlab-rake   \/opt\/gitlab\/bin\/gitlab-rails   \/opt\/gitlab\/bin\/gitlab-ci-rake   \/opt\/gitlab\/bin\/gitlab-ci-rails  \/usr\/bin\/\r\n\r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\n<\/pre>\n<p>\u67e5\u770b\u4ed3\u5e93\u5927\u5c0f<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd \/data\/gitlab\/git-data\/repositories\r\nfind -name &quot;*.git&quot; | xargs -i du -sh \\{} |grep 'G' | sort -nrk1\r\n<\/pre>\n<h3 id=\"\u5347\u7ea7\u5230-8.10.0\">\u5347\u7ea7\u5230 8.10.0<\/h3>\n<p>8.2\u7248\u672c\u4ee5\u4e0a\u6709\u65b0\u7279\u6027\uff1aGit LFS\uff0cManaging large files such as audio, video and graphics files has always been one of the shortcomings of Git. https:\/\/docs.gitlab.com\/ee\/workflow\/lfs\/manage_large_binaries_with_git_lfs.html<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-8.10.0-ce.1.el6.x86_64.rpm\r\n\r\n# \u4f1adump database , migrate \u7b49\u3002\u3002\u3002\u3002\r\n<\/pre>\n<p>\u5347\u7ea7\u540e\uff0cgitlab.yml\u4f1a\u88ab\u4fee\u6539\uff0cLDAP\u914d\u7f6e\u4e22\u5931\uff0c\u9700\u8981\u91cd\u65b0\u624b\u52a8\u4fee\u6539\u52a0\u4e0a\uff0c\u4e0d\u80fd\u76f4\u63a5\u4fee\u6539 gitlab.yml\uff0c\u56e0\u4e3agitlab.yml\u4f1a\u88ab gitlab-ctl reconfigure \u547d\u4ee4\u8986\u76d6\u6389\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/gitlab\/gitlab.rb\r\n\r\ngitlab_rails&#x5B;'ldap_enabled'] = true\r\ngitlab_rails&#x5B;'ldap_host'] = '172.18.8.xx'\r\ngitlab_rails&#x5B;'ldap_port'] = 389\r\ngitlab_rails&#x5B;'ldap_uid'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_method'] = 'plain'\r\ngitlab_rails&#x5B;'ldap_bind_dn'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_password'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_allow_username_or_email_login'] = true\r\ngitlab_rails&#x5B;'ldap_base'] = 'xxx'\r\n<\/pre>\n<p>\u4fee\u6539\u914d\u7f6e\uff0c\u5f00\u542f LFS \u529f\u80fd<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/gitlab\/gitlab.rb\r\n\r\ngitlab_rails&#x5B;'lfs_enabled'] = true\r\ngitlab_rails&#x5B;'lfs_storage_path'] = &quot;\/data\/gitlab\/git-data\/lfs-objects&quot;\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmkdir \/data\/gitlab\/git-data\/lfs-objects\r\nchown -R git:git \/data\/gitlab\/git-data\/lfs-objects\r\n\r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\n<\/pre>\n<p>\u5982\u4f55\u4f7f\u7528 git lfs : https:\/\/github.com\/git-lfs\/git-lfs\/wiki\/Tutorial<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# install git lfs from https:\/\/packagecloud.io\/github\/git-lfs\/install\r\ncurl -s https:\/\/packagecloud.io\/install\/repositories\/github\/git-lfs\/script.deb.sh | sudo bash\r\nsudo apt-get install git-lfs\r\ngit lfs install\r\n<\/pre>\n<p>\u5982\u679c\u662f\u4e00\u4e2a\u65b0\u7684\u4ed3\u5e93\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit lfs track &quot;*.psd&quot;\r\ngit add .gitattributes\r\ngit commit -m &quot;track *.psd files using Git LFS&quot;\r\ngit push origin master\r\n<\/pre>\n<p>\u5c06\u65e7\u7684\u4ed3\u5e93\u8f6c\u6362\u6210LFS\u6587\u4ef6\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit rm --cached *.psd\r\ngit add *.psd\r\ngit commit -m &quot;Convert last commit to LFS&quot;\r\n\r\ngit lfs ls-files\r\n<\/pre>\n<p>push lfs \u6587\u4ef6\u540e\u62a5\u9519<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nNo such file or directory - git-lfs-authenticate (Errno::ENOENT)\r\n<\/pre>\n<p>\u539f\u56e0\u662f git-lfs-authenticate \u662f gitlab 8.12\u4e4b\u540e\u624d\u652f\u6301\u7684\u529f\u80fd \uff0c\u6240\u4ee5\u5347\u7ea7\u5427<\/p>\n<h3 id=\"\u5347\u7ea7\u5230-8.11.0\">\u3000\u5347\u7ea7\u5230 8.11.0<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-8.11.0-ce.1.el6.x86_64.rpm\r\ngitlab-rake gitlab:check SANITIZE=true\r\n\r\n# fixing....\r\nchown -R git \/var\/opt\/gitlab\/gitlab-rails\/uploads\r\nfind \/var\/opt\/gitlab\/gitlab-rails\/uploads -type f -exec chmod 0644 {} \\;\r\nfind \/var\/opt\/gitlab\/gitlab-rails\/uploads -type d -not -path \/var\/opt\/gitlab\/gitlab-rails\/uploads -exec chmod 0700 {} \\;\r\n\r\ngitlab-ctl restart\r\n<\/pre>\n<h3 id=\"\u5347\u7ea7\u5230-8.15.0\">\u5347\u7ea7\u5230 8.15.0<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-8.15.0-ce.0.el6.x86_64.rpm\r\n<\/pre>\n<h3 id=\"\u5347\u7ea7\u5230-10.1.0\">\u5347\u7ea7\u5230 10.1.0<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-10.1.0-ce.0.el6.x86_64.rpm \r\n# \u62a5\u9519\uff0c\u8bf4 PostgreSQL \u7248\u672c\u592a\u4f4e\r\n<\/pre>\n<p>\u90a3\u4e48\u53ea\u80fd\u5148\u5347\u7ea7\u5185\u90e8 PostgreSQL\uff0c\u53c2\u8003 https:\/\/docs.gitlab.com\/omnibus\/settings\/database.html#upgrade-packaged-postgresql-server<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngitlab-ctl upgrade\r\ngitlab-ctl pg-upgrade\r\n<\/pre>\n<p>\u518d\u5347\u7ea7<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-10.1.0-ce.0.el6.x86_64.rpm \r\ngitlab-rake gitlab:check SANITIZE=true \r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\n\r\n<\/pre>\n<p>\u786e\u8ba4\u6ca1\u95ee\u9898\u540e\uff0c\u53ef\u4ee5\u5220\u9664\u8001\u7248\u672c PostgreSQL \u7684\u6587\u4ef6<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrm -rf \/var\/opt\/gitlab\/postgresql\/data.9.2.18\r\n<\/pre>\n<h3 id=\"\u5347\u7ea7\u5230-10.6.6\">\u5347\u7ea7\u5230 10.6.6<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nrpm -Uvh gitlab-ce-10.6.6-ce.0.el6.x86_64.rpm\r\ngitlab-ctl reconfigure\r\ngitlab-ctl restart\r\n<\/pre>\n<h3 id=\"gitlab.rb\u5185\u5bb9\">gitlab.rb\u5185\u5bb9<\/h3>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\n# Change the external_url to the address your users will type in their browser\r\nexternal_url 'http:\/\/gitlab.xxx.com'\r\ngit_data_dir '\/data\/gitlab\/git-data\/'\r\ngitlab_rails&#x5B;'backup_path'] = '\/data\/gitlab\/backups'\r\n\r\ngitlab_rails&#x5B;'ldap_enabled'] = true\r\ngitlab_rails&#x5B;'ldap_host'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_port'] = 389\r\ngitlab_rails&#x5B;'ldap_uid'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_method'] = 'plain'\r\ngitlab_rails&#x5B;'ldap_bind_dn'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_password'] = 'xxx'\r\ngitlab_rails&#x5B;'ldap_allow_username_or_email_login'] = true\r\ngitlab_rails&#x5B;'ldap_base'] = 'xxx'\r\n\r\ngitlab_rails&#x5B;'lfs_enabled'] = true\r\ngitlab_rails&#x5B;'lfs_storage_path'] = &quot;\/data\/gitlab\/git-data\/lfs-objects&quot;\r\n<\/pre>\n<h3 id=\"\u5907\u4efd\u6570\u636e\">\u5907\u4efd\u6570\u636e<\/h3>\n<p>\u65b0\u7248\u672c\u6709copy\u65b9\u5f0f\u8fdb\u884c\u5907\u4efd\uff0c\u53ef\u4ee5\u907f\u514d\u201cdata changes while\u00a0<code>tar<\/code>\u00a0is reading it, the error\u00a0<code>file changed as we read it<\/code>\u00a0may occur \u201d \u8fd9\u4e2a\u95ee\u9898\u3002 \u8fd9\u79cd\u5907\u4efd\u65b9\u5f0f\u4f1a\u591a\u5360\u7528\u4e00\u500d\u989d\u5916\u7684\u786c\u76d8\u7a7a\u95f4\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngitlab-rake gitlab:backup:create STRATEGY=copy\r\n<\/pre>\n<h3 id=\"\u914d\u7f6essh\u8bbf\u95ee\u6743\u9650\">\u914d\u7f6essh\u8bbf\u95ee\u6743\u9650<\/h3>\n<p>\u4e0eorg\u670d\u52a1\u5668\u4fdd\u6301\u4e00\u81f4<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/hosts.allow\r\n\r\nsshd:172.30.15.27\r\nsshd:172.28.6.204\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003 https:\/\/blog.securityevaluators.com\/upgrading-gitlab [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6595","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=6595"}],"version-history":[{"count":4,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6595\/revisions"}],"predecessor-version":[{"id":6600,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6595\/revisions\/6600"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=6595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=6595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=6595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}