{"id":19039,"date":"2024-11-19T14:15:40","date_gmt":"2024-11-19T06:15:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19039\/"},"modified":"2024-11-19T14:15:40","modified_gmt":"2024-11-19T06:15:40","slug":"%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e6%90%ad%e5%bb%bagitlab%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19039\/","title":{"rendered":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u642d\u5efaGitLab\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>centos gitlab\u642d\u5efa<\/p>\n<p>GitLab\u662f\u5f00\u6e90\u7684Git\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u534f\u540c\u5f00\u53d1\u3001\u4ee3\u7801\u7ba1\u7406\u4ee5\u53ca\u6301\u7eed\u96c6\u6210\u548c\u90e8\u7f72\u7b49\u4efb\u52a1\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5728CentOS\u670d\u52a1\u5668\u4e0a\u642d\u5efaGitLab\u7684\u65b9\u6cd5\u3002<\/p>\n<ol>\n<li>\u51c6\u5907\u5de5\u4f5c<\/li>\n<\/ol>\n<p>\u5728\u5f00\u59cb\u642d\u5efaGitLab\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fddCentOS\u670d\u52a1\u5668\u5df2\u7ecf\u5b89\u88c5\u4e86\u5fc5\u8981\u7684\u8f6f\u4ef6\u548c\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u6240\u9700\u7684\u8f6f\u4ef6\u548c\u5de5\u5177\uff1a<\/p>\n<ul>\n<li>CentOS 7.x \u6216\u66f4\u9ad8\u7248\u672c\uff08\u5177\u5907Root\u8bbf\u95ee\u6743\u9650\uff09<\/li>\n<li>curl \u548c openssh-server \u5df2\u5b89\u88c5<\/li>\n<li>2 GB \u4ee5\u4e0a\u7684RAM<\/li>\n<\/ul>\n<ol>\n<li>\u5b89\u88c5GitLab<\/li>\n<\/ol>\n<p>2.1 \u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56<\/p>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u3002\u6253\u5f00\u7ec8\u7aef\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>sudo yum install -y curl policycoreutils-python openssh-server<\/p>\n<p>2.2 \u6dfb\u52a0GitLab\u4ed3\u5e93\u6e90<\/p>\n<p>\u4e3a\u4e86\u5b89\u88c5GitLab\uff0c\u9700\u8981\u5148\u5c06\u5176\u4ed3\u5e93\u6e90\u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash<\/p>\n<p>2.3 \u5b89\u88c5GitLab<\/p>\n<p>GitLab\u6e90\u5df2\u7ecf\u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\uff0c\u73b0\u5728\u53ef\u4ee5\u5b89\u88c5\u5176\u8f6f\u4ef6\u5305\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>sudo yum install -y gitlab-ce<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u89c6\u7f51\u7edc\u901f\u5ea6\u800c\u5b9a\u3002<\/p>\n<p>2.4 \u542f\u52a8GitLab<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u542f\u52a8GitLab\u670d\u52a1\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>sudo gitlab-ctl reconfigure<\/p>\n<p>\u6b64\u547d\u4ee4\u5c06\u81ea\u52a8\u542f\u52a8GitLab\u670d\u52a1\u5e76\u914d\u7f6e\u5fc5\u8981\u7684\u9009\u9879\u3002<\/p>\n<ol>\n<li>\u8bbf\u95eeGitLab<\/li>\n<\/ol>\n<p>\u73b0\u5728\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeGitLab\u3002\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u670d\u52a1\u5668IP\u5730\u5740\u6216\u57df\u540d\u540e\uff0c\u5c06\u770b\u5230GitLab\u7684\u6b22\u8fce\u9875\u9762\u3002<\/p>\n<p>\u9996\u6b21\u8bbf\u95ee\u65f6\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u7ba1\u7406\u5458\u5e10\u6237\u3002\u6839\u636e\u63d0\u793a\u586b\u5199\u5fc5\u8981\u7684\u4fe1\u606f\u6765\u521b\u5efa\u7ba1\u7406\u5458\u5e10\u6237\u3002<\/p>\n<ol>\n<li>\u4f7f\u7528GitLab<\/li>\n<\/ol>\n<p>\u73b0\u5728\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u5e76\u542f\u52a8\u4e86GitLab\uff0c\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528\u4e86\u3002GitLab\u7684\u4e3b\u8981\u7279\u70b9\u4e4b\u4e00\u662f\u5b83\u7684\u7b80\u5355\u6613\u7528\u6027\u3002\u4ece\u7ba1\u7406\u9879\u76ee\u5230\u534f\u540c\u5f00\u53d1\uff0cGitLab\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u5404\u79cd\u4efb\u52a1\u3002<\/p>\n<ol>\n<li>\u603b\u7ed3<\/li>\n<\/ol>\n<p>\u672c\u6587\u4ecb\u7ecd\u4e86\u5728CentOS\u670d\u52a1\u5668\u4e0a\u642d\u5efaGitLab\u7684\u65b9\u6cd5\u3002\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u548c\u5de5\u5177\uff0c\u5e76\u6309\u7167\u6b65\u9aa4\u5b89\u88c5GitLab\u3002\u5982\u679c\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u67e5\u770b\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u652f\u6301\u3002<\/p>\n<p>GitLab\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u7528\u4e8e\u7ba1\u7406\u56e2\u961f\u7684\u4ee3\u7801\u534f\u4f5c\u548c\u90e8\u7f72\u3002\u5b83\u662f\u5efa\u7acb\u4e00\u4e2a\u5feb\u901f\u3001\u7b80\u5355\u548c\u5408\u7406\u7684\u5f00\u53d1\u548c\u534f\u4f5c\u73af\u5883\u7684\u7406\u60f3\u9009\u62e9\uff0c\u5f00\u53d1\u56e2\u961f\u53ef\u4ee5\u4fbf\u6377\u5730\u534f\u540c\u5f00\u53d1\u548c\u7ba1\u7406\u4ee3\u7801\u5e93\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5728CentOS\u670d\u52a1\u5668\u4e0a\u642d\u5efaGitLab\u7684\u65b9\u6cd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>centos gitlab\u642d\u5efa GitLab\u662f\u5f00\u6e90\u7684Git\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u534f\u540c\u5f00\u53d1\u3001\u4ee3\u7801\u7ba1\u7406\u4ee5\u53ca\u6301\u7eed\u96c6\u6210\u548c\u90e8\u7f72\u7b49\u4efb\u52a1\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5728CentOS\u670d\u52a1\u5668\u4e0a\u642d\u5efaGitLab\u7684\u65b9\u6cd5\u3002 \u51c6\u5907\u5de5\u4f5c \u5728\u5f00\u59cb\u642d\u5efaGitLab\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fddCentOS\u670d\u52a1\u5668\u5df2\u7ecf\u5b89\u88c5\u4e86\u5fc5\u8981\u7684\u8f6f\u4ef6\u548c\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u6240\u9700\u7684\u8f6f\u4ef6\u548c\u5de5\u5177\uff1a CentOS 7.x \u6216\u66f4\u9ad8\u7248\u672c\uff08\u5177\u5907Root\u8bbf\u95ee\u6743\u9650\uff09 curl \u548c openssh-server \u5df2\u5b89\u88c5 2 GB \u4ee5\u4e0a\u7684RAM \u5b89\u88c5GitLab 2.1 \u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56 \u5728\u5f00\u59cb\u5b89\u88c5GitLab\u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u3002\u6253\u5f00\u7ec8\u7aef\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo yum install -y curl policycoreutils-python openssh-server 2.2 \u6dfb\u52a0GitLab\u4ed3\u5e93\u6e90 \u4e3a\u4e86\u5b89\u88c5GitLab\uff0c\u9700\u8981\u5148\u5c06\u5176\u4ed3\u5e93\u6e90\u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a curl -sS https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.rpm.sh | sudo bash 2.3 \u5b89\u88c5GitLab GitLab\u6e90\u5df2\u7ecf\u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\uff0c\u73b0\u5728\u53ef\u4ee5\u5b89\u88c5\u5176\u8f6f\u4ef6\u5305\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo yum install -y gitlab-ce \u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u89c6\u7f51\u7edc\u901f\u5ea6\u800c\u5b9a\u3002 2.4 \u542f\u52a8GitLab \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u542f\u52a8GitLab\u670d\u52a1\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo gitlab-ctl reconfigure \u6b64\u547d\u4ee4\u5c06\u81ea\u52a8\u542f\u52a8GitLab\u670d\u52a1\u5e76\u914d\u7f6e\u5fc5\u8981\u7684\u9009\u9879\u3002 \u8bbf\u95eeGitLab \u73b0\u5728\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeGitLab\u3002\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u670d\u52a1\u5668IP\u5730\u5740\u6216\u57df\u540d\u540e\uff0c\u5c06\u770b\u5230GitLab\u7684\u6b22\u8fce\u9875\u9762\u3002 \u9996\u6b21\u8bbf\u95ee\u65f6\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u7ba1\u7406\u5458\u5e10\u6237\u3002\u6839\u636e\u63d0\u793a\u586b\u5199\u5fc5\u8981\u7684\u4fe1\u606f\u6765\u521b\u5efa\u7ba1\u7406\u5458\u5e10\u6237\u3002 \u4f7f\u7528GitLab [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19039","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19039"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19039\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}