Linux installation Gitlab with iSCSI partition mount instructions

Source: Internet
Author: User

Because the Gitlab data is stored in shared storage, the play of this configuration is turned into Mount iSCSI.

Os:centos 7.2
ip:172.16.1.191/192.168.2.191

iSCSI Sub-target (server side) [disk cabinet] and initiator (client) [Windows,linux], this time the installation is the client.

1. Install the Iscsi-initiator kit:

[Email protected]/]# yum-y install Iscsi-initiator-utils

2. Configure the native iSCSI name:

[Email protected]/]# VIM/ETC/ISCSI/INITIATORNAME.ISCSI

Modify the initiator name as follows:

Initiatorname=iqn.1994-05.com.redhat:gitlab.17track.net

3. Scan the target device for shared volumes:

[Email protected]/]# iscsiadm-m discovery-t sendtargets-p 192.168.2.1
192.168.2.1:3260,5 iqn.1995-03.com.dothill:01.array.00c0ff261fd6192.168.2.2:3260,6 iqn.1995-03.com.dothill:01. array.00c0ff261fd6192.168.3.1:3260,7 iqn.1995-03.com.dothill:01.array.00c0ff261fd6192.168.3.2:3260,8 Iqn.1995-03.com.dothill:01.array.00c0ff261fd6

4, delete the 192.168.3.x network segment Connection (with 2.x network segment connection is enough)

[Email protected]/]# rm-rf/var/lib/iscsi/nodes/iqn.1995-03.com.dothill\:01.array.00c0ff261fd6/192.168.3.1\,3260 \,7/[[email protected]/]# rm-rf/var/lib/iscsi/nodes/iqn.1995-03.com.dothill\:01.array.00c0ff261fd6/192.168.3.2\, 3260\,8/

5. Mount the shared volume of the target device:

[Email protected]/]# iscsiadm-m node-p 192.168.2.1--login

6. View Mount Storage information:

[Email protected]/]# fdisk-l
disk/dev/sdb:32.0 GB, 31998345216 bytes, 62496768 sectorsunits = sectors of 1 * = bytessector size (logical/phys ical): bytes/4096 bytesi/o size (minimum/optimal): 4096 bytes/1048576 bytesdisk/dev/sda:32.0 GB, 31998345216 byt ES, 62496768 sectorsunits = sectors of 1 * = bytessector size (logical/physical): bytes/4096 bytesi/o Size ( Minimum/optimal): 4096 bytes/1048576 bytes

7. Install multi-Path Redundancy program:

[Email protected]/]# yum-y install Device-mapper-multipath

8. Configuring Multipath Redundancy (MultiPath)

[Email protected]/]# vim/etc/multipath.conf

Write the following content:

Defaults {        udev_dir                /        dev        polling_interval        path_selector           "Round-robin 0"        path_ Grouping_policy    multibus        prio                    alua        path_checker            readsector0        failback                Immediate        no_path_retry           fail        user_friendly_names     yes}

9. Restart multi-Path redundancy service:

[Email protected]/]# systemctl restart Multipathd.service

10. View multi-path virtual hard disk:

[Email protected]/]# fdisk-l
disk/dev/mapper/mpatha:32.0 GB, 31998345216 bytes, 62496768 sectorsunits = sectors of 1 * = bytessector size (lo gical/physical): bytes/4096 bytesi/o size (minimum/optimal): 4096 bytes/1048576 bytes

11. Format the hard drive:

[Email protected]/]# Mkfs.ext4/dev/mapper/mpatha

12. Mount the hard drive:

[Email protected]/]# mkdir/data[[email protected]/]# Mount/dev/mapper/mpatha/data

13. Add the hard drive automatically mount to the startup item:

[Email protected]/]# Vim/etc/fstab

Add the following entry at the end of the document (note that the device type is not default, but _netdev)

/dev/mapper/mpatha/data                        ext4    _netdev         0 0

--------------------------------------------------------------------------Configure Gitlab to start------------------------------------- ----------------------------------------

14, add Tsinghua Gitlab source

[Email protected]/]# Vim/etc/yum.repos.d/gitlab-ce.repo

Add the following entry in the document:

[Gitlab-ce]name=gitlab CE repositorybaseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ Gpgcheck=0enabled=1
[email protected]/]# Yum Makecache

15. Install Gitlab Community Edition:

[email protected]/]# Yum install Gitlab-ce

16. Initialize the Gitlab service:

# You can access the Gitlab service by IP address so far. Next, configure the HTTPS service.

17. Create the certificate directory and put in the certificate:

[[email protected]/]# mkdir/etc/gitlab/ssl[[email protected]/]# ll/etc/gitlab/ssltotal 16-rw-r--r--1 root root 4023 J UL 14:33 17track.crt-rw-r--r--1 root root 1957 Jul 14:33 17track.key-rw-r--r--1 root root 3083 Jul 14:33 17trac k.pfx-rw-r--r--1 root root  769 Jul 14:33 Dhparam.pem

18. Modify the Gitlab configuration file:

[Email protected]/]# VIM/ETC/GITLAB/GITLAB.RB

Modify the following items:

External_url ' https://git.17track.net:8099/' gitlab_rails[' gitlab_email_enabled '] = truegitlab_rails[' Gitlab_email _from '] = ' [email protected] ' gitlab_rails[' gitlab_email_display_name '] = ' admin ' gitlab_rails[' gitlab_email_ Reply_to '] = ' [email protected] ' gitlab_rails[' gitlab_email_subject_suffix '] = ' Git_data_dirs ({"Default" = {"Path" = "/data/gitlab-repository", ' gitaly_address ' = ' Unix:/var/opt/gitlab/gitaly/gitaly.socket '}}) gitlab_rails[' smtp_enable ' = truegitlab_rails[' smtp_address '] = "smtp.exmail.qq.com" gitlab_rails[' smtp_port '] = 465gitlab_rails[' smtp_user_name ' = "[email protected]" gitlab_rails[' smtp_password '] = "17Track_neT" Gitlab_ rails[' smtp_authentication ' = "Login" gitlab_rails[' smtp_enable_starttls_auto '] = truegitlab_rails[' smtp_tls '] = truegitlab_rails[' gitlab_email_from ' = ' [email protected] ' nginx[' enable '] = truenginx[' client_max_body_size ' ] = ' 8m ' nginx[' redirect_http_to_https '] = truenginx[' Redirect_http_to_https '] = truenginx[' ssL_certificate '] = "/etc/gitlab/ssl/17track.crt" nginx[' ssl_certificate_key '] = "/etc/gitlab/ssl/17track.key" nginx[' Ssl_ciphers '] = "ecdhe-rsa-aes256-gcm-sha384:ecdhe-rsa-aes128-gcm-sha256" nginx[' ssl_protocols '] = "TLSv1 TLSv1.1 TLSv1.2 "nginx[' ssl_session_cache '] =" builtin:1000 shared:ssl:10m "nginx[' hsts_max_age '] = 31536000nginx[' Hsts_ Include_subdomains '] = truelogrotate[' enable '] = Truepages_external_url "https://site.17track.net:8098/" gitlab_ pages[' Enable '] = truegitlab_pages[' use_http2 ') = truepages_nginx[' Enable '] = falsegitlab_rails[' pages_path '] = "/data /gitlab-pages "

19. Modify the NINGX configuration file:

[Email protected]/]# vim/opt/gitlab/embedded/conf/nginx.conf

To delete the project related to the server project, add the following:

    # HTTPS Server    #    server {        listen       443 SSL;        server_name  git.17track.net;        Ssl_certificate      /etc/gitlab/trusted-certs/dhparam.pem;        Ssl_certificate_key  /etc/gitlab/trusted-certs/17track.key;        SSL on;        Ssl_session_cache    shared:ssl:1m;        Ssl_session_timeout  5m;        Ssl_ciphers  high:!anull:! MD5;        Ssl_prefer_server_ciphers on  ;        Location/{            root   html;            Index  index.html index.htm;        }    }    server {        listen*:80;        server_name git.17track.net;        rewrite^ (. *) $https://$host $1permanent;    }

20. Restart Gitlab Service:

[Email protected]/]# gitlab-ctl restart

21, access to Gitlab services;
https://172.16.1.191:8099/
root/*******

[The END]

Linux installation Gitlab with iSCSI partition mount instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.