centos 6.5 安装gitlab安装注意的问题分析以及解决方法

人工智能

628人已加入

描述

删除按照官网进行操作,环境为centos 6.5

注意安装过程中执行命令

sudo gitlab-ctl reconfigure

出现错误,在/etc/gitlab/gitlab.rb 中修改域名后再执行一次方可启动成功

 

 

 

 

进页面提示502,用命令

sudo gitlab-ctl tail postgresql

查看提示内存不足,官方也是建议1g内存进行搭建,512m的话也可以安装但是要添加swap,不然启动后就会提示内存不足,我目前是512的,添加swap后访问成功,但是有点慢可能,还是升为1g了。

上图是我目前的配置,注意这里修改了gitlab默认的仓库存储路径,

Storing Git data in an alternative directory

我这里贴出来给大家看看

# Prevent users from writing to the repositories while you move them.

sudogitlab-ctl stop

# Only move 'repositories'; 'gitlab-satellites' will be recreated

# automatically. Note there is _no_ slash behind 'repositories', but there _is_ a

# slash behind 'git-data'.

sudorsync -av /var/opt/gitlab/git-data/repositories /mnt/nas/git-data/

# Fix permissions if necessary

sudogitlab-ctl reconfigure

# Double-check directory layout in /mnt/nas/git-data. Expected output:

# gitlab-satellites repositories

sudols /mnt/nas/git-data/

# Done! Start GitLab and verify that you can browse through the repositories in

# the web interface.

sudogitlab-ctl start

 

可以看到这是安装完成后gitlab一些文件和数据的路径

看到网上很多资料都不对,可能是过时了,所以搞gitlab建议大家还是以官网为主,说不定你在看我这个文章的时候也过时了

Omnibus-gitlab uses four different directories.

/opt/gitlab holds application code for GitLab and its dependencies.

/var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to.

/etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually.

/var/log/gitlab contains all log data generated by components of omnibus-gitlab.

有错误的时候尽量用 

sudo gitlab-ctl tail 

查看日志分析错误原因,我在配置邮件的时候也是试了很久才用上

接下来我们来配置邮件,我这里使用SMTP,用腾讯企业邮箱

还是修改/etc/gitlab/gitlab.rb 配置文件,再次提醒网上很多文章可以已经过时了

gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.exmail.qq.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "xx@xxx.com" gitlab_rails['smtp_password'] = "password" gitlab_rails['smtp_domain'] = "exmail.qq.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['gitlab_email_from'] = 'xx@xxx.com' ##修改gitlab配置的发信人 user["git_user_email"] = "xx@xxx.com"
保持发信人和登录邮箱一致,我配置这里的时候也出错了,原因是我在看腾讯官网时候写的是用的SSL,端口是465

但是gitlab好像不是用的ssl,gitlab的教程里也没找到是否启用ssl的配置,我也没去深究了,于是把端口号改为25,邮件发送成功。

大家在测试邮件的时候可以用忘记密码来发送邮件测试,然后用gitlab-ctl tail来查看,大概等1分钟就能看到发送邮件的日志,出错了再具体分析原因

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分