rsync和gitlab使用、svn安装

rsync和gitlab使用、svn安装

1.rsync简介

rsynclinux系统下的数据镜像备份工具。使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他SSHrsync主机同步。

2.rsync特性

rsync支持很多特性:

  • 可以镜像保存整个目录树和文件系统
  • 可以很容易做到保持原来文件的权限、时间、软硬链接等等
  • 无须特殊权限即可安装
  • 快速:第一次同步时rsync会复制全部内容,但在下一次只传输修改过的文件。rsync在传输数据的过程中可以实行压缩及解压缩操作,因此可以使用更少的带宽
  • 安全:可以使用scpssh等方式来传输文件,当然也可以通过直接的socket连接
  • 支持匿名传输,以方便进行网站镜像

3.rsync的ssh认证协议

rsync命令来同步系统文件之前要先登录remote主机认证,认证过程中用到的协议有2种:

  • ssh协议
  • rsync协议
rsync server`端不用启动`rsync`的`daemon`进程,只要获取`remote host`的用户名和密码就可以直接`rsync`同步文件
`rsync server`端因为不用启动`daemon`进程,所以也不用配置文件`/etc/rsyncd.conf

ssh认证协议跟scp的原理是一样的,如果在同步过程中不想输入密码就用ssh-keygen -t rsa打通通道

//这种方式默认是省略了 -e ssh 的,与下面等价:
rsync -avz /SRC -e ssh root@172.16.12.129:/DEST 
    -a  //文件宿主变化,时间戳不变
    -z  //压缩数据传输
 
//当遇到要修改端口的时候,我们可以:
rsync -avz /SRC -e "ssh -p2222" root@172.16.12.129:/DEST  
//修改了ssh 协议的端口,默认是22

4.rsync命令

//Rsync的命令格式常用的有以下三种:
    rsync [OPTION]... SRC DEST
    rsync [OPTION]... SRC [USER@]HOST:DEST
    rsync [OPTION]... [USER@]HOST:SRC DEST

对应于以上三种命令格式,rsync有三种不同的工作模式

1。拷贝本地文件。当SRC和DES路径信息都不报行有单个冒号“:”分隔符时就启动这种工作模式。如

[root@node1 ~]# yum -y install rsync
上次元数据过期检查:21:16:45 前,执行于 2021年10月10日 星期日 04时56分57秒。
[root@node1 ~]# rsync -a zabbix_server.sh shen.sh
[root@node1 ~]# ll
总用量 12
-rw-------. 1 root root 1087 7月  13 02:30 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 2228 10月  7 10:43 shen.sh
-rwxr-xr-x. 1 root root 2228 10月  7 10:43 zabbix_server.sh
[root@node1 ~]# 

2。使用一个远程shell程序,来实现讲本地机器的内容拷贝到远程机器,当DST路径地址包 \ 含单个冒号“:”分隔符时启动该模式

[root@node1 ~]# rsync -avz shen.sh root@192.168.100.147:/root   //把node1上的shen.sh同步到node2上去
The authenticity of host '192.168.100.147 (192.168.100.147)' can't be established.
ECDSA key fingerprint is SHA256:r5uhMkBRTNxvYYvWxormTvBxafc0DHlna23cHgnhfl4.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.100.147' (ECDSA) to the list of known hosts.
root@192.168.100.147's password: 
sending incremental file list
shen.sh

sent 1,182 bytes  received 35 bytes  347.71 bytes/sec
total size is 2,228  speedup is 1.83
[root@node1 ~]# 

[root@node2 ~]# ls    //查看
shen.sh
[root@node2 ~]# 

3。使用一个远程shell程序来实现讲远程机器的内容拷贝到本地机器,当SRC地址路径包含单个冒号“:”分隔符时启动该模式。如:

[root@node1 ~]# ls
anaconda-ks.cfg  zabbix_server.sh
[root@node1 ~]# rsync -avz root@192.168.100.147:/root/shen.sh .
root@192.168.100.147's password: 
receiving incremental file list
shen.sh

sent 43 bytes  received 1,182 bytes  490.00 bytes/sec
total size is 2,228  speedup is 1.82
[root@node1 ~]# 
[root@node1 ~]# ls
anaconda-ks.cfg  shen.sh  zabbix_server.sh
[root@node1 ~]# 

常用选项

    -a, --archive       //归档
    -v, --verbose       //啰嗦模式
    -q, --quiet         //静默模式
    -r, --recursive     //递归
    -p, --perms         //保持原有的权限属性
    -z, --compress      //在传输时压缩,节省带宽,加快传输速度
    --delete            //在源服务器上做的删除操作也会在目标服务器上同步

5.rsync+inotify

rsync与传统的cptar备份方式相比,rsync具有安全性高、备份迅速、支持增量备份等优点,通过rsync可以解决对实时性要求不高的数据备份需求,例如定期的备份文件服务器数据到远端服务器,对本地磁盘定期做数据镜像等。
随着应用系统规模的不断扩大,对数据的安全性和可靠性也提出的更好的要求,rsync在高端业务系统中也逐渐暴露出了很多不足,首先,rsync同步数据时,需要扫描所有文件后进行比对,进行差量传输。如果文件数量达到了百万甚至千万量级,扫描所有文件将是非常耗时的。而且正在发生变化的往往是其中很少的一部分,这是非常低效的方式。其次,rsync不能实时的去监测、同步数据,虽然它可以通过linux守护进程的方式进行触发同步,但是两次触发动作一定会有时间差,这样就导致了服务端和客户端数据可能出现不一致,无法在应用故障时完全的恢复数据。基于以上原因,rsync+inotify组合出现了!

Inotify是一种强大的、细粒度的、异步的文件系统事件监控机制,linux内核从2.6.13起,加入了Inotify支持,通过Inotify可以监控文件系统中添加、删除,修改、移动等各种细微事件,利用这个内核接口,第三方软件就可以监控文件系统下文件的各种变化情况,而inotify-tools就是这样的一个第三方软件。
在前面有讲到,rsync可以实现触发式的文件同步,但是通过crontab守护进程方式进行触发,同步的数据和实际数据会有差异,而inotify可以监控文件系统的各种变化,当文件有任何变动时,就触发rsync同步,这样刚好解决了同步数据的实时性问题。

环境说明

服务器类型ip地址应用操作系统
源服务器192.168.100.146rsync inotify-tools脚本centos8
目标服务器192.168.100.147rsynccentos8

需求

  • 把源服务器上/etc目录实时同步到目标服务器的/tmp/下

在目标服务器上做一下操作

5.1关闭防火墙和selinux
[root@node2 ~]# systemctl stop firewalld
[root@node2 ~]# systemctl disable firewalld     
[root@node2 ~]# getenforce 
Enforcing
[root@node2 ~]# setenforce 0
[root@node2 ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/sysconfig/selinux
[root@node2 ~]# 
5.2.安装rsync服务端软件
[root@node2 ~]# yum -y install rsync  rsync-daemon
上次元数据过期检查:0:15:49 前,执行于 2021年10月11日 星期一 02时17分35秒。
5.3.设置rsyncd.conf配置文件
[root@node2 ~]# cat /etc/rsyncd.conf 
log file = /var/log/rsyncd.log   
pidfile = /var/run/rsyncd.pid     
lock file = /var/run/rsync.lock   
secrets file = /etc/rsync.pass    

[etc_from_client]     
path = /tmp/        
comment = sync etc from client
uid = root        
gid = root        
port = 873        
ignore errors     
read only = no    
list = no     
max connections = 200     
timeout = 600     
auth users = admin       
hosts allow = 192.168.100.146
[root@node2 ~]# 
5.4.创建用户认证文件
[root@node2 ~]# echo 'admin:123456' > /etc/rsync.pass
[root@node2 ~]# cat /etc/rsync.pass
admin:123456
[root@node2 ~]# 
5.6设置用户权限
[root@node2 ~]# chmod 600 /etc/rsync*
[root@node2 ~]# ll /etc/rsync*
-rw-------. 1 root root 427 10月 11 02:36 /etc/rsyncd.conf
-rw-------. 1 root root  13 10月 11 02:37 /etc/rsync.pass
[root@node2 ~]# 
5.5.启动rsync服务并设置开机自启动
[root@node2 ~]# systemctl start rsyncd
[root@node2 ~]# systemctl enable rsyncd
Created symlink /etc/systemd/system/multi-user.target.wants/rsyncd.service → /usr/lib/systemd/system/rsyncd.service.
[root@node2 ~]# 
[root@node2 ~]# ss -antl
State   Recv-Q  Send-Q   Local Address:Port         Peer Address:Port       Process       
LISTEN  0       128            0.0.0.0:22                0.0.0.0:*                        
LISTEN  0       128            0.0.0.0:10050             0.0.0.0:*                        
LISTEN  0       128            0.0.0.0:10051             0.0.0.0:*                        
LISTEN  0       128          127.0.0.1:9000              0.0.0.0:*                        
LISTEN  0       5              0.0.0.0:873               0.0.0.0:*                        
LISTEN  0       128                  *:80                      *:*                        
LISTEN  0       128               [::]:22                   [::]:*                        
LISTEN  0       5                 [::]:873                  [::]:*                        
LISTEN  0       80                   *:3306                    *:*                        
[root@node2 ~]# 

在源服务器上做以下操作:

5.1关闭防火墙和selinux
[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# systemctl disable firewalld     
[root@node1 ~]# getenforce 0
Enforcing
[root@node1 ~]# setenforce 0
[root@node1 ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/sysconfig/selinux
[root@node1 ~]# 
5.2下载epel源
[root@node1 ~]# yum -y install epel-release
上次元数据过期检查:21:56:51 前,执行于 2021年10月10日 星期日 04时56分57秒。
5.3安装rsync服务端软件,只需要安装,不要启动,不需要配置
[root@node1 ~]# yum -y install rsync
上次元数据过期检查:21:59:22 前,执行于 2021年10月10日 星期日 04时56分57秒。
5.4创建认证密码文件
[root@node1 ~]# echo '123456' > /etc/rsync.pass
[root@node1 ~]# cat /etc/rsync.pass
123456
[root@node1 ~]# 
5.6设置文件权限,只设置所有者具有读取、写入权限
[root@node1 ~]# chmod 600 /etc/rsync.pass
[root@node1 ~]# ll /etc/rsync.pass
-rw-------. 1 root root 7 10月 11 02:56 /etc/rsync.pass
[root@node1 ~]# 

在源服务器上创建测试目录,然后再源服务器运行一下命令

[root@node1 ~]# mkdir -pv /root/etc/test
mkdir: 已创建目录 '/root/etc'
mkdir: 已创建目录 '/root/etc/test'
[root@node1 ~]# rsync -avH --port 873 --progress --delete /root/etc/ admin@192.168.100.147::etc_from_client --password-file=/etc/rsync.pass
sending incremental file list
deleting vmware-root_929-3980167385/
deleting systemd-private-f0f28bbe429841d7a4e552036d113fbd-chronyd.service-85RkUe/tmp/
deleting systemd-private-f0f28bbe429841d7a4e552036d113fbd-chronyd.service-85RkUe/
deleting zabbix_server_preprocessing.sock
deleting zabbix_server_lld.sock
deleting zabbix_server_availability.sock
deleting zabbix_server_alerter.sock
deleting zabbix_server.pid
deleting zabbix_server.log
deleting zabbix_agentd.pid
deleting zabbix_agentd.log
deleting mysql.sock.lock
deleting mysql.sock
./
test/

sent 77 bytes  received 458 bytes  1,070.00 bytes/sec
total size is 0  speedup is 0.00
[root@node1 ~]# 

[root@node2 ~]# ls /tmp
test
[root@node2 ~]# 
5.7安装inotify-tools工具,实时触发rsync进行同步
[root@node1 ~]# ll /proc/sys/fs/inotify/
总用量 0
-rw-r--r--. 1 root root 0 10月 11 03:02 max_queued_events
-rw-r--r--. 1 root root 0 10月 11 03:02 max_user_instances
-rw-r--r--. 1 root root 0 10月 11 03:02 max_user_watches
[root@node1 ~]# 
//如果有这三个max开头的文件则表示服务器内核支持inotify

安装

[root@node1 ~]# yum -y install make gcc gcc-c++ inotify-tools
上次元数据过期检查:22:06:31 前,执行于 2021年10月10日 星期日 04时56分57秒。

写同步脚本,此步乃最最重要的一步,请慎之又慎。让脚本自动去检测我们制定的目录下文件发生的变化,然后再执行rsync的命令把它同步到我们的服务器端去
[root@node1 ~]# mkdir /scripts
[root@node1 ~]# touch /scripts/inotify.sh
[root@node1 ~]# chmod 755 /scripts/inotify.sh 
[root@node1 ~]# ll /scripts/inotify.sh 
-rwxr-xr-x. 1 root root 0 10月 11 03:06 /scripts/inotify.sh
[root@node1 ~]# 
[root@node1 ~]# vim /scripts/inotify.sh 
[root@node1 ~]# cat /scripts/inotify.sh 
host=192.168.100.147      
src=/etc        
des=etc_from_client  
password=/etc/rsync.pass
inotifywait=/usr/bin/inotifywait

$inotifywait -mrq --timefmt '%Y%m%d %H:%M' --format '%T %w%f%e' -e modify,delete,create,attrib $src \
        | while read files;do
    rsync -avzP --delete  --timeout=100 --password-file=${password} $src $user@$host::$des
        echo "${files} was rsynced" >>/tmp/rsync.log 2>&1
done
[root@node1 ~]# 

启动

[root@node1 ~]# nohup bash /scripts/inotify.sh &
[1] 125005
[root@node1 etc]# ps -ef|grep inotify
root       30222   19186  0 03:43 pts/0    00:00:00 bash /scripts/inotify.sh
root       30223   30222  0 03:43 pts/0    00:00:00 /usr/bin/inotifywait -mrq --timefmt %Y%m%d %H:%M --format %T %w%f%e -e modify,delete,create,attrib /etc
root       30224   30222  0 03:43 pts/0    00:00:00 bash /scripts/inotify.sh
root       66722   19186  0 04:03 pts/0    00:00:00 grep --color=auto inotify
[root@node1 etc]# 
5.8测试

在源服务器上生成一个新文件

[root@node2 ~]# ls /etc/yum.repos.d/
CentOS-Stream-AppStream.repo
CentOS-Stream-BaseOS.repo
CentOS-Stream-Debuginfo.repo
CentOS-Stream-Extras.repo
CentOS-Stream-HighAvailability.repo
CentOS-Stream-Media.repo
CentOS-Stream-PowerTools.repo
CentOS-Stream-RealTime.repo
epel-modular.repo
epel-next.repo
epel-next-testing.repo
epel-playground.repo
epel.repo
epel-testing-modular.repo
epel-testing.repo
[root@node2 ~]# echo "hello world" > /etc/yum.repos.d/test
[root@node2 ~]# 
//查看inotify生成的日志
[root@node1 etc]# tail /tmp/rsync.log
20211011 03:23 /etc/yum.repos.d/testCREATE was rsynced
[root@node1 etc]# 

设置基本开机自动启动

[root@centos8-1 ~]# chmod +x /etc/rc.d/rc.local
[root@centos8-1 ~]# ll /etc/rc.d/rc.local
-rwxr-xr-x. 1 root root 474 12月  1 2020 /etc/rc.d/rc.local
[root@centos8-1 ~]# echo 'nohup /bin/bash /scripts/inotify.sh' >> /etc/rc.d/rc.local
[root@centos8-1 ~]# tail /etc/rc.d/rc.local
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

nohup /bin/bash /scripts/inotify.sh
[root@centos8-1 ~]# 

到目标服务器上去查看是否把新生成的文件自动传上去了:

[root@node2 tmp]# ls
test
[root@node2 tmp]# ls /etc/yum.repos.d
CentOS-Stream-AppStream.repo
CentOS-Stream-BaseOS.repo
CentOS-Stream-Debuginfo.repo
CentOS-Stream-Extras.repo
CentOS-Stream-HighAvailability.repo
CentOS-Stream-Media.repo
CentOS-Stream-PowerTools.repo
CentOS-Stream-RealTime.repo
epel-modular.repo
epel-next.repo
epel-next-testing.repo
epel-playground.repo
epel.repo
epel-testing-modular.repo
epel-testing.repo
test
[root@node2 tmp]# 

版本控制gitlab

1.版本控制介绍

版本控制是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理,是软件配置管理的核心思想之一。

版本控制最主要的功能就是追踪文件的变更。它将什么时候、什么人更改了文件的什么内容等信息忠实地了记录下来。每一次文件的改变,文件的版本号都将增加。除了记录版本变更外,版本控制的另一个重要功能是并行开发。软件开发往往是多人协同作业,版本控制可以有效地解决版本的同步以及不同开发者之间的开发通信问题,提高协同开发的效率。并行开发中最常见的不同版本软件的错误(Bug)修正问题也可以通过版本控制中分支与合并的方法有效地解决。
具体来说,在每一项开发任务中,都需要首先设定开发基线,确定各个配置项的开发初始版本,在开发过程中,开发人员基于开发基线的版本,开发出所需的目标版本。当发生需求变更时,通过对变更的评估,确定变更的影响范围,对被影响的配置项的版本进行修改,根据变更的性质使配置项的版本树继续延伸或产生新的分支,形成新的目标版本,而对于不受变更影响的配置项则不应发产生变动。同时,应能够将变更所产生的对版本的影响进行记录和跟踪。必要时还可以回退到以前的版本。例如当开发需求或需求变更被取消时,就需要有能力将版本回退到开发基线版本。在曾经出现过的季度升级包拆包和重新组包的过程中,其实就是将部分配置项的版本回退到开发基线,将对应不同需求的不同分支重新组合归并,形成新的升级包版本。
版本控制是软件配置管理的核心功能。所有置于配置库中的元素都应自动予以版本的标识,并保证版本命名的唯一性。版本在生成过程中,自动依照设定的使用模型自动分支、演进。除了系统自动记录的版本信息以外,为了配合软件开发流程的各个阶段。还需要定义、收集一些元数据来记录版本的辅助信息和规范开发流程,并为今后对软件过程的度量做好准备。当然如果选用的工具支持,这些辅助数据将能直接统计出过程数据,从而方便软件过程改进活动的进行。对于配置库中的各个基线控制项,应该根据其基线的位置和状态来设置相应的访问权限。一般来说,对于基线版本之前的各个版本都应处于被锁定的状态,如需要对它们进行变更,则应按照变更控制的流程来进行操作。

常用的版本控制工具:

  • gitlab
  • subversion

2.gitlab部署

下载epel源

[root@localhost ~]# yum -y install epel-release
上次元数据过期检查:23:01:41 前,执行于 2021年10月10日 星期日 05时29分26秒。
依赖关系解决。

安装git和依赖包

[root@localhost ~]# yum -y install git curl openssh-server openssh-clients postfix cronie policycoreutils-python-utils

启动postfix服务并设置开机自启

[root@localhost ~]# systemctl restart postfix
[root@localhost ~]# systemctl enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# 

下载gitlab的rpm包

  [root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
--2021-10-11 06:07:56--  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
正在连接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:961561901 (917M) [application/x-redhat-package-manager]
正在保存至: “gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm.2”

gitlab-ce-14.3.2-ce.0.el8. 100%[======================================>] 917.02M  5.50MB/s  用时 5m 8s   

2021-10-11 06:13:06 (2.97 MB/s) - 已保存 “gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm.2” [961561901/961561901])

[root@localhost src]# ls
debug
gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
kernels
wget-log
[root@localhost src]# 

安装gitlab

[root@localhost src]# rpm -ivh gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm 
警告:gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:gitlab-ce-14.3.2-ce.0.el8        ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=14-3

[root@localhost src]# 

修改配置文件

[root@localhost ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.100.152'    //写上自己的ip地址

重新加载配置文件并重新启动gitlab

[root@localhost ~]# gitlab-ctl reconfigure
略。。。。。。
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 156524) 1s
ok: run: gitaly: (pid 156643) 0s
ok: run: gitlab-exporter: (pid 156679) 0s
ok: run: gitlab-workhorse: (pid 156702) 0s
ok: run: grafana: (pid 156711) 1s
ok: run: logrotate: (pid 156767) 0s
ok: run: nginx: (pid 156779) 1s
ok: run: node-exporter: (pid 156842) 0s
ok: run: postgres-exporter: (pid 156903) 1s
ok: run: postgresql: (pid 156934) 0s
ok: run: prometheus: (pid 156968) 0s
ok: run: puma: (pid 157002) 0s
ok: run: redis: (pid 157015) 0s
ok: run: redis-exporter: (pid 157037) 1s
ok: run: sidekiq: (pid 157421) 1s
[root@localhost ~]# 

查看当前的版本

[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 14.3.2
[root@localhost ~]# 

设置密码并关闭防火墙

[root@localhost ~]# gitlab-rails console -e production

Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
GitLab: 14.3.2 (92acfb1b8a9) FOSS
GitLab Shell: 13.21.1
PostgreSQL: 12.7

Loading production environment (Rails 6.1.3.2)
irb(main):001:0>
irb(main):002:0>
irb(main):003:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):004:0> user.password = ‘shenlongfei123’
=> “shenlongfei123”
irb(main):005:0> user.password_confirmation = ‘shenlongfei123’
=> “shenlongfei123”
irb(main):006:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 32d0af50-5f24-4e64-b588-83209dbcf691) to Sidekiq(mailers) with arguments: “DeviseMailer”, “password_change”, “deliver_now”, {:args=>[#<GlobalID:0x00007f5ce960fc50 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):007:0> exit
[root@localhost ~]#

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]#


测试登录

![请添加图片描述](https://img-blog.csdnimg.cn/4efead7b489448ebb6b572fa39c240fc.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![请添加图片描述](https://img-blog.csdnimg.cn/2643c813dd8b4e6c861cbecc0faa498b.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![请添加图片描述](https://img-blog.csdnimg.cn/a3692e5b648d42399af3abba9237c758.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)


# svn安装

### 1.下载

下载地址: https://tortoisesvn.net/downloads.html

进入界面安装
![请添加图片描述](https://img-blog.csdnimg.cn/f952fed0fb0a494f90a8663f6cd1ada6.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![请添加图片描述](https://img-blog.csdnimg.cn/97bf42b5dc464de792b93d675ed1993b.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![请添加图片描述](https://img-blog.csdnimg.cn/0327c2a39dad476096452097bbdce72e.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![请添加图片描述](https://img-blog.csdnimg.cn/cb0e654cccbb4b39af6536e976397e9f.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
![在这里插入图片描述](https://img-blog.csdnimg.cn/b9c10f88760e43ff83ab196e015c70b7.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)
安装完毕后,在任意地方右键查看快捷菜单。发现TortoiseSVN即表示安装成功。
![在这里插入图片描述](https://img-blog.csdnimg.cn/391aa31c0f3c4a59995b62a2f6293da8.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBATGZlaTUxMjA=,size_20,color_FFFFFF,t_70,g_se,x_16)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Lfei5120

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值