1. 程式人生 > 其它 >|NO.Z.00014|——————————|CloudNative|——|CI/CD&GitLab操作 .V04|----------------------------------------------------|GitLab.UI初始化|

|NO.Z.00014|——————————|CloudNative|——|CI/CD&GitLab操作 .V04|----------------------------------------------------|GitLab.UI初始化|



[CloudNative:CI/CD&GitLab操作.V04]                                                                    [Applications.CloudNative] [|CI/CD|分散式版本控制系統|**3節點**|Jenkins|Git|——|Gitlab語言環境|Gitlab初始化|] [https|smtp|Gitlab取消使用者自動註冊|ssh|gitlab資料備份|定時備份|gitlab資料恢復|gitlab管理k8s叢集|]








一、GItlab.UI初始化
### --- 登入gitlab

~~~     Chrome: http://10.10.10.11/,
~~~     然後 change password: 並使用root使用者登入 
二、gitlab修改賬戶密碼
### --- 設定超級管理員使用者密碼

[root@server11 ~]# gitlab-rails console production
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>                                   // id為1的是超級管理員
irb(main):002:0> user.password = '1qaz2wsx'
=> "1qaz2wsx"                                           // 密碼必須至少8個字元
irb(main):003:0> user.save!                             // 如沒有問題 返回true
exit                                                    // 退出
### --- gitlab常用操作

[root@server11 ~]# gitlab-ctl start                     // 啟動所有 gitlab 元件;
[root@server11 ~]# gitlab-ctl stop                      // 停止所有 gitlab 元件;
[root@server11 ~]# gitlab-ctl restart                   // 重啟所有 gitlab 元件;
[root@server11 ~]# gitlab-ctl status                    // 檢視服務狀態;
[root@server11 ~]# gitlab-ctl reconfigure               // 初始化服務;
[root@server11 ~]# vim /etc/gitlab/gitlab.rb            // 修改預設的配置檔案;
[root@server11 ~]# gitlab-ctl tail                      // 檢視日誌;
三、登入gitlab後臺管理
### --- 修改nginx.port

~~~     如果需要手工修改nginx的port ,可以在gitlab.rb中設定 nginx['listen_port'] = 8000 ,
~~~     然後再次 gitlab-ctl reconfigure即可
四、登入 gitlab 如下所示(首次登陸設定 root 密碼): 五、gitlab配置一
### --- gitlab配置一

~~~     去掉使用者的自動註冊功能(安全)
~~~     ——>admin are -> settings -> Sign-up Restrictions 去掉鉤鉤,
~~~     然後拉到最下面儲存,重新登入 
### --- Gitlab配置二:

~~~     建立gitlab專案組
~~~     建立專案組:組名為Jenkins








===============================END===============================


Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart                                                                                                                                                    ——W.S.Landor



來自為知筆記(Wiz)