美文网首页
安装与配置

安装与配置

作者: perfect_jimmy | 来源:发表于2017-04-24 14:31 被阅读15次

环境:centos7
http://www.jianshu.com/p/7a0d6917e009
http://blog.csdn.net/orangeann/article/details/45040227
http://blog.csdn.net/wmq880204/article/details/70141771?locationNum=11&fps=1--ci

  • 安装依赖
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
Paste_Image.png
  • 启动
sudo gitlab-ctl reconfigure
  • 查看运行状态
[root@localhost ~]# sudo gitlab-ctl status
run: gitaly: (pid 5132) 237s; run: log: (pid 4864) 275s
run: gitlab-monitor: (pid 5182) 235s; run: log: (pid 5074) 249s
run: gitlab-workhorse: (pid 5142) 237s; run: log: (pid 4885) 269s
run: logrotate: (pid 4915) 266s; run: log: (pid 4914) 266s
run: nginx: (pid 4894) 268s; run: log: (pid 4893) 268s
run: node-exporter: (pid 5019) 259s; run: log: (pid 5018) 259s
run: postgres-exporter: (pid 5169) 236s; run: log: (pid 5046) 255s
run: postgresql: (pid 4687) 319s; run: log: (pid 4686) 319s
run: prometheus: (pid 5157) 236s; run: log: (pid 5002) 260s
run: redis: (pid 4630) 326s; run: log: (pid 4629) 326s
run: redis-exporter: (pid 5033) 257s; run: log: (pid 5032) 257s
run: sidekiq: (pid 4855) 277s; run: log: (pid 4854) 277s
run: unicorn: (pid 4823) 278s; run: log: (pid 4822) 278s

配置

  • 修改IP地址
1.进入/etc/gitlab/gitlab.rb
2.修改 external_url 'http://localhost'为指定地址
3.重启 sudo gitlab-ctl reconfigure
4.访问 http://xxx.xxx.xx.xx/
  • 备份
    一些属性gitlab.rb:
gitlab_rails['manage_backup_path'] = true
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups" #备份目录
gitlab_rails['backup_archive_permissions'] = 0644 #生成的文件权限
gitlab_rails['backup_keep_time'] = 864000  #保留10天

1 备份配置文件

2 备份数据文件
默认备份地址:/var/opt/gitlab/backups
修改备份地址:

vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml(或者修改gitlab.rb)
path改为: path: "/usr/local/src/repositories",执行重启命令后执行备份
[root@localhost ~]# gitlab-rake gitlab:backup:create
Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]//当中省略
done
Deleting old backups ... skipping

定时备份:
cron表达式

# Minute   Hour   Day of Month       Month          Day of Week        Command    
# (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)                
    0        2          12             *                *            /usr/bin/find

运行

执行:crontab -e
# 每天17点40分点执行备份
40 17 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
  • 恢复
    1 恢复配置文件
    2 恢复数据文件
sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/
# 停止连接数据库的进程
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# 恢复1393513186这个备份文件,将覆盖GitLab数据库!
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186
# 启动 GitLab
sudo gitlab-ctl start
# 检查 GitLab
sudo gitlab-rake gitlab:check SANITIZE=true
  • 持续集成(GitLab-CI)

相关文章

  • 软件安装

    Git Bash的安装与配置 Node.js的安装与配置 Git 的安装与配置 VSCode的安装和配置 错误言论...

  • 2018-08-15

    Dart 开发与运行环境配置 本章内容安装与配置Dart SDK安装与配置VSCode验证 1 安装与配置Dart...

  • Android开发环境搭建--Android Studio(长期

    JDK的安装与配置 Android Studio的安装与配置 JDK的安装与配置 JDK的下载与安装 去官网下载J...

  • Mac 下 Flutter 的安装与配置

    Mac 下 Flutter 的安装与配置 Homebrew 安装与更新 Flutter 的安装与配置 Homebr...

  • Drf-解决跨域问题

    目录 安装与配置 localhost/127.0.0.1的区别 1. 安装与配置 安装包 pip install ...

  • 简书第一篇文章

    Windows系统下的安卓软件安装与环境配置 一、java软件的安装与环境配置(即jdk的安装与配置) 1、jdk...

  • node.js安装与配置

    node.js安装与配置 node.js 安装 配置

  • Spring Boot项目环境搭建

    需要用到的软件 一、JDK8自行安装与配置二、 MySQL自行安装与配置三、Maven安装与配置 下载地址:htt...

  • 2018-11-21

    Ubuntu系统下Nginx服务器与Redis安装配置 一、Nginx安装与配置 1.安装 ...

  • postgresql集群的搭建

    目录 架构图 部署详情 postgresql的安装与配置 pgpool的安装与配置 写在安装前 postgresq...

网友评论

      本文标题:安装与配置

      本文链接:https://www.haomeiwen.com/subject/gmiuzttx.html