GitLab的一键安装方式以及使用Git工具上传代码
#rpm -ivh gitlab-ce-9.1.2-ce.0.el6.x86_64.rpmPreparing... ###########################################
1:gitlab-ce ###########################################
hostname: Host name lookup failure
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ ____ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:
sudo gitlab-ctl reconfigure
gitlab: GitLab should be reachable at http://gitlab.example.com
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
It looks like GitLab has not been configured yet; skipping the upgrade script.
根据上面的提示执行:
#sudo gitlab-ctl reconfigure
Starting Chef Client, version 12.12.15
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- package (0.0.0)
- runit (0.14.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Recipe: gitlab::default
* directory action create
- change mode from '0755' to '0775'
init (upstart 0.6.5)
Converging 378 resources
* directory action create (up to date)
* directory action create
- create new directory /var/opt/gitlab
- change mode from '' to '0755'
- change owner from '' to 'root'
- change group from '' to 'root'
* directory action create
- create new directory /opt/gitlab/embedded/etc
- change mode from '' to '0755'
- change owner from '' to 'root'
- change group from '' to 'root'
* template action create
- create new file /opt/gitlab/embedded/etc/gitconfig
- update content in file /opt/gitlab/embedded/etc/gitconfig from none to 5fe039
--- /opt/gitlab/embedded/etc/gitconfig 2017-05-25 10:46:30.027207736 +0800
+++ /opt/gitlab/embedded/etc/.chef-gitconfig20170525-6666-jc6wi6 2017-05-25 10:46:30.026207736 +0800
@@ -1 +1,10 @@
+
+threads = 1
+
+fsckObjects = true
+
+writeBitmaps = true
+
+hideRefs=^refs/tmp/
+hideRefs=^refs/keep-around/
- change mode from '' to '0755'
Recipe: gitlab::web-server
* group action create
- create group gitlab-www
* user action create
- create user gitlab-www
Recipe: gitlab::users
……………………………… #会输出很多初始化的信息
+
- change owner from '' to 'root'
- change group from '' to 'root'
* ruby_block action nothing (skipped due to action :nothing)
* file action delete (up to date)
* link action create
- create symlink at /opt/gitlab/init/gitlab-monitor to /opt/gitlab/embedded/bin/sv
* link action create
- create symlink at /opt/gitlab/service/gitlab-monitor to /opt/gitlab/sv/gitlab-monitor
* ruby_block action run
- execute the ruby block supervise_gitlab-monitor_sleep
* service action nothing (skipped due to action :nothing)
* execute action run
ok: run: gitlab-monitor: (pid 7720) 1s
- execute /opt/gitlab/bin/gitlab-ctl start gitlab-monitor
Recipe: gitlab::default
* link action delete (up to date)
* directory action delete (up to date)
Recipe: gitlab::gitlab-rails
* execute action run
- execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: gitlab::redis
* ruby_block action create
- execute the ruby block reload redis svlogd configuration
Recipe: gitlab::postgresql
* ruby_block action create
- execute the ruby block reload postgresql svlogd configuration
Recipe: gitlab::unicorn
* ruby_block action create
- execute the ruby block reload unicorn svlogd configuration
Recipe: gitlab::sidekiq
* ruby_block action create
- execute the ruby block reload sidekiq svlogd configuration
Recipe: gitlab::gitaly
* service action restart
- restart service service
* ruby_block action create
- execute the ruby block reload gitaly svlogd configuration
Recipe: gitlab::gitlab-workhorse
* service action restart
- restart service service
* ruby_block action create
- execute the ruby block reload gitlab-workhorse svlogd configuration
Recipe: gitlab::nginx
* ruby_block action create
- execute the ruby block reload nginx svlogd configuration
Recipe: gitlab::logrotate
* ruby_block action create
- execute the ruby block reload logrotate svlogd configuration
Recipe: gitlab::prometheus
* service action restart
- restart service service
* ruby_block action create
- execute the ruby block reload prometheus svlogd configuration
Recipe: gitlab::node-exporter
* ruby_block action create
- execute the ruby block reload node-exporter svlogd configuration
Recipe: gitlab::redis-exporter
* ruby_block action create
- execute the ruby block reload redis-exporter svlogd configuration
Recipe: gitlab::postgres-exporter
* service action restart
- restart service service
* ruby_block action create
- execute the ruby block reload postgres-exporter svlogd configuration
Recipe: gitlab::gitlab-monitor
* service action restart
- restart service service
* ruby_block action create
- execute the ruby block reload gitlab-monitor svlogd configuration
Running handlers:
Running handlers complete
Chef Client finished, 325/427 resources updated in 03 minutes 29 seconds
gitlab Reconfigured!
可以看到提示执行了3分钟29秒!
查看启动情况
#netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN 7685/redis_exporter
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 7839/prometheus
tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN 7850/postgres_expor
tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN 7638/node_exporter
tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN 7865/ruby
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 7519/unicorn master
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7561/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5506/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5585/master
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 7561/nginx
tcp 0 0 :::3306 :::* LISTEN 6289/mysqld
tcp 0 0 ::1:9168 :::* LISTEN 7865/ruby
tcp 0 0 :::22 :::* LISTEN 5506/sshd
tcp 0 0 ::1:25 :::* LISTEN 5585/master
关闭
# sudo gitlab-ctl stop
ok: down: gitaly: 0s, normally up
ok: down: gitlab-monitor: 1s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 0s, normally up
ok: down: nginx: 0s, normally up
ok: down: node-exporter: 0s, normally up
ok: down: postgres-exporter: 1s, normally up
ok: down: postgresql: 1s, normally up
ok: down: prometheus: 0s, normally up
ok: down: redis: 0s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 0s, normally up
启动
# sudo gitlab-ctl start
ok: run: gitaly: (pid 8296) 0s
ok: run: gitlab-monitor: (pid 8301) 0s
ok: run: gitlab-workhorse: (pid 8304) 1s
ok: run: logrotate: (pid 8312) 0s
ok: run: nginx: (pid 8318) 1s
ok: run: node-exporter: (pid 8324) 0s
ok: run: postgres-exporter: (pid 8329) 1s
ok: run: postgresql: (pid 8334) 0s
ok: run: prometheus: (pid 8342) 0s
ok: run: redis: (pid 8350) 1s
ok: run: redis-exporter: (pid 8354) 0s
ok: run: sidekiq: (pid 8359) 1s
ok: run: unicorn: (pid 8362) 0s
重启
#sudo gitlab-ctl restart #其实不加sudo也可以!
查看添加了几个用户,如下:
#tail -5 /etc/passwd
gitlab-www:x:498:499::/var/opt/gitlab/nginx:/bin/false
git:x:497:498::/var/opt/gitlab:/bin/sh
gitlab-redis:x:496:497::/var/opt/gitlab/redis:/bin/false
gitlab-psql:x:495:496::/var/opt/gitlab/postgresql:/bin/sh
gitlab-prometheus:x:494:495::/var/opt/gitlab/prometheus:/bin/sh
页:
[1]