gitlab´î½¨ºóÔõôÅþÁ¬Êý¾Ý¿â
Ôڴ gitlab µÄÀú³ÌÖУ¬Êý¾Ý¿âÊÇÒ»¸öÐëÒªµÄ×é¼þ¡£ÔڴÍê³Éºó£¬ÐèÒª½« gitlab ÓëÊý¾Ý¿âÅþÁ¬ÆðÀ´²Å»ªÕý³£Ê¹Óᣱ¾ÎĽ«ÏÈÈÝÔõÑùÅþÁ¬ gitlab ÓëÊý¾Ý¿â£¬ÈÃÄãµÄ gitlab ˳ËìÔËÐÐÆðÀ´¡£
Ò»¡¢×°ÖÃÊý¾Ý¿â
Ê×ÏÈÐèҪװÖÃÊý¾Ý¿â¡£GitLab Ö§³ÖÁ½ÖÖÊý¾Ý¿â£ºPostgreSQL ºÍ MySQL¡£ÔÚÕâÀÎÒÃÇÒÔ PostgreSQL ΪÀýÏÈÈÝ¡£
×°ÖÃ PostgreSQL
ͨ¹ýÒÔÏÂÏÂÁî×°Öà PostgreSQL£º
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
µÇ¼ºó¸´ÖÆ
½¨Éè PostgreSQL Óû§ºÍÊý¾Ý¿â
ÔÚ½¨Éè GitLab Êý¾Ý¿â֮ǰ£¬ÐèÒª½¨ÉèÒ»¸öÓÃÓÚÅþÁ¬Êý¾Ý¿âµÄÓû§¡£Ê¹ÓÃÒÔÏÂÏÂÁÉèÒ»¸öÃûΪ¡°gitlab¡±µÄÓû§£º
sudo -u postgres psql -c "CREATE USER gitlab CREATEDB;"
µÇ¼ºó¸´ÖÆ
Õ⽫½¨ÉèÒ»¸öÃûΪ¡°gitlab¡±µÄÓû§£¬²¢ÊÚÓè¸ÃÓû§½¨ÉèÊý¾Ý¿âµÄȨÏÞ¡£½ÓÏÂÀ´£¬Ê¹ÓÃÒÔÏÂÏÂÁÉèÒ»¸öÃûΪ¡°gitlabhq_production¡±µÄÊý¾Ý¿â£º
sudo -u postgres psql -c "CREATE DATABASE gitlabhq_production OWNER gitlab;"
µÇ¼ºó¸´ÖÆ
¶þ¡¢ÉèÖà GitLab ÅþÁ¬Êý¾Ý¿â
ÉèÖÃÊý¾Ý¿âÅþÁ¬
ÔÚ /etc/gitlab/gitlab.rb ÎļþÖеġ°production¡±Çø¿éÖÐÉèÖà GitLab ÅþÁ¬Êý¾Ý¿â¡£·¿ª¸ÃÎļþ£º
sudo vi /etc/gitlab/gitlab.rb
µÇ¼ºó¸´ÖÆ
ÕÒµ½ÏÂÃæÕâÐдúÂ룬°Ñ×¢ÊÍ·û#ɾ³ý²¢½«Æä¸ÄΪtrue£º
# postgresql['enable'] = false postgresql['enable'] = true
µÇ¼ºó¸´ÖÆ
Ö®ºó£¬½«ÒÔÏ´úÂëÌí¼Óµ½ÎļþµÄĩβ£º
gitlab_rails['db_adapter'] = 'postgresql' gitlab_rails['db_encoding'] = 'unicode' gitlab_rails['db_database'] = 'gitlabhq_production' gitlab_rails['db_username'] = 'gitlab' gitlab_rails['db_password'] = 'password' gitlab_rails['db_host'] = 'localhost' gitlab_rails['db_port'] = '5432'
µÇ¼ºó¸´ÖÆ
ÕâЩÉèÖÃÑ¡Ïî¸æËß GitLab ÔõÑùÅþÁ¬µ½ PostgreSQL Êý¾Ý¿â¡£
ÖØÐÂÉèÖÃ GitLab
ÔÚ /etc/gitlab Ŀ¼ÏÂÖ´ÐÐÒÔÏÂÏÂÁ
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ
Õ⽫ʹ GitLab ¶ÁÈ¡ /etc/gitlab/gitlab.rb ÎļþÖеÄÉèÖò¢¾ÙÐÐÏìÓ¦µÄ¸ü¸Ä¡£
Èý¡¢²âÊÔ GitLab ÊÇ·ñÅþÁ¬ÀÖ³É
Íê³ÉÉÏÊö°ì·¨ºó£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî²âÊÔ GitLab ÊÇ·ñÄܹ»ÀÖ³ÉÅþÁ¬µ½ PostgreSQL Êý¾Ý¿â£º
sudo gitlab-rake gitlab:check SANITIZE=true --trace
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁ¼ì²é GitLab ÉèÖ㬲¢½«Ð§¹ûÊä³öµ½¿ØÖÆ̨¡£ÈôÊÇÒ»ÇÐÕý³££¬½«¿´µ½¡°Database config exists? … yes¡±ºÍ¡°Database is SQLite … no¡±µÄÊä³ö¡£ÕâÅú×¢ GitLab ÀÖ³ÉÅþÁ¬µ½ PostgreSQL Êý¾Ý¿â¡£
×ܽá
ÒÔÉϾÍÊÇ GitLab ÔõÑùÅþÁ¬Êý¾Ý¿âµÄËùÓа취¡£Í¨¹ýÕâЩ°ì·¨£¬Ä㽫Äܹ»Ê¹ GitLab ˳ËìÔËÐÐÆðÀ´£¬²¢×îÏÈʹÓà GitLab µÄÐ×÷ºÍ°æ±¾¿ØÖƹ¦Ð§¡£
ÒÔÉϾÍÊÇgitlab´î½¨ºóÔõôÅþÁ¬Êý¾Ý¿âµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡