前言:向“我是程序汪”学习~

项目部署核心步骤:

一、准备工作 

        1.准备一台云主机centos_8_0;

        2.linux下jdk maven git 配置;

#tmp存放临时安装包
mkdir -p /data/tmp
#service存放软件环境
mkdir -p /data/service
#gitee存放代码版本控制库
mkdir -p /data/gitee

 jdk配置(jdk>=1.8、jdk最好是1.8)

进入安装包目录,并解压
[root@VM-4-16-centos tmp]# cd /data/tmp/
[root@VM-4-16-centos tmp]# ls
jdk1.8.0_321  jdk-8u321-linux-x64.tar.gz
[root@VM-4-16-centos tmp]# tar -zxvf jdk-8u321-linux-x64.tar.gz 
[root@VM-4-16-centos tmp]# ll
total 143380
drwxr-xr-x 8 10143 10143      4096 Dec 16 03:30 jdk1.8.0_321
-rw-r--r-- 1 root  root  146815279 Apr  1 14:58 jdk-8u321-linux-x64.tar.gz

把解压出来的文件夹,移到统一的目录service下
[root@VM-4-16-centos tmp]# mv /data/tmp/jdk1.8.0_321/ /data/service/
[root@VM-4-16-centos tmp]# cd /data/service/
[root@VM-4-16-centos service]# ll
total 4
drwxr-xr-x 8 10143 10143 4096 Dec 16 03:30 jdk1.8.0_321
修改环境变量/etc/profile,JAVA_HOME修改为自己的jdk路径
[root@VM-4-16-centos service]# vim /etc/profile
#############################################################################
HOSTNAME=`/usr/bin/hostname 2>/dev/null`
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/data/service/jdk1.8.0_321                            (添加的信息)
export PATH=$PATH:$JAVA_HOME/bin                                       (添加的信息)
# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
Type  :qa!  and press <Enter> to abandon all changes and exit Vim  
##############################################################################
使环境变量生效
[root@VM-4-16-centos service]# source /etc/profile
检查是否成功配置成功
[root@VM-4-16-centos service]# java -version
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

 Maven配置(Maven>=3)

下载Maven
[root@VM-4-16-centos tmp]# wget https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz
--2022-04-01 15:59:50--  https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz
Resolving dlcdn.apache.org (dlcdn.apache.org)... 151.101.2.132, 2a04:4e42::644
Connecting to dlcdn.apache.org (dlcdn.apache.org)|151.101.2.132|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8673123 (8.3M) [application/x-gzip]
Saving to: ‘apache-maven-3.8.5-bin.tar.gz’

apache-maven-3.8.5-bin.tar.gz                               100%[===========================================================================================================================================>]   8.27M   579KB/s    in 37s     

2022-04-01 16:00:28 (228 KB/s) - ‘apache-maven-3.8.5-bin.tar.gz’ saved [8673123/8673123]

[root@VM-4-16-centos tmp]# ll
total 151848
-rw-r--r-- 1 root root   8673123 Mar  5 23:51 apache-maven-3.8.5-bin.tar.gz
-rw-r--r-- 1 root root 146815279 Apr  1 14:58 jdk-8u321-linux-x64.tar.gz

把解压出来的文件,移到统一目录service下
[root@VM-4-16-centos tmp]# tar -xzvf apache-maven-3.8.5-bin.tar.gz 
[root@VM-4-16-centos tmp]# mv apache-maven-3.8.5 /data/service/
[root@VM-4-16-centos tmp]# cd /data/service/apache-maven-3.8.5/
[root@VM-4-16-centos apache-maven-3.8.5]# ll
total 48
drwxr-xr-x 2 root root  4096 Apr  1 16:03 bin
drwxr-xr-x 2 root root  4096 Apr  1 16:03 boot
drwxr-xr-x 3 root root  4096 Mar  5 19:30 conf
drwxr-xr-x 4 root root  4096 Apr  1 16:03 lib
-rw-r--r-- 1 root root 17568 Mar  5 19:30 LICENSE
-rw-r--r-- 1 root root  5141 Mar  5 19:30 NOTICE
-rw-r--r-- 1 root root  2612 Mar  5 19:30 README.txt
修改环境变量/etc/profile,MAVEN_HOME修改为自己的Maven路径
[root@VM-4-16-centos apache-maven-3.8.5]# vim /etc/profile
HOSTNAME=`/usr/bin/hostname 2>/dev/null`
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/data/service/jdk1.8.0_321
export PATH=$PATH:$JAVA_HOME/bin
export MAVEN_HOME=/data/service/apache-maven-3.8.5
export PATH=$PATH:$MAVEN_HOME/bin
使环境变量生效
[root@VM-4-16-centos apache-maven-3.8.5]# source /etc/profile
检查是否配置成功
[root@VM-4-16-centos apache-maven-3.8.5]# mvn -v
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /data/service/apache-maven-3.8.5
Java version: 1.8.0_321, vendor: Oracle Corporation, runtime: /data/service/jdk1.8.0_321/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-305.10.2.el8_4.x86_64", arch: "amd64", family: "unix"

Git配置

通过yum安装,本方法最简单。但是无法控制安装的版本
安装git
[root@VM-4-16-centos apache-maven-3.8.5]# yum -y install git
确认是否配置成功
[root@VM-4-16-centos apache-maven-3.8.5]# git --version
git version 2.27.0

3.添加SSH公钥从gitee克隆源代码; 

添加SSH公钥然后从gitee克隆源代码
[root@VM-4-16-centos apache-maven-3.8.5]# cd /data/gitee/
[root@VM-4-16-centos gitee]# ssh-keygen -t rsa -C "xx@xx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ZJy+8GLH30rJsaSoql9FlOhxRujChx+0AeANE5lGEQ8 xx@xx.com
The key's randomart image is:
+---[RSA 3072]----+
|oEB. +o.         |
|.+* *.+. .       |
|.o B *. =        |
|  + *. +         |
|   + .o S o      |
|    .. = = +     |
|    . + * =      |
|   . o o o .     |
|.oo..     o..    |
+----[SHA256]-----+
[root@VM-4-16-centos gitee]# cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDUdccBCD8fLio5UEMoKJMEQBWnFCoFJx6YyLbTz95/oVnz6iAe+P3pa4hQrWbMo0Sx0u9Lx+vhGxYAK5SvfwfyTm9YzEj2lw5WxYlGZVEOY1uuzIwNf94bG8hgMBOjXaNp5SR81RNUFBtDmMPPHDbMtbNyPYsLv8K9UaDM4BXGkOq3I84TiRkqoiNsaCX+nRZtvLJZ9cgHBBdAiEoL4vJM8rtFDlOSJfRQk8NTAkr7LLaAwwYA59z14R/6km0VTN2DHHIvABXiPHC2lmwoCmbT9+raq+H6WtGfm7EnVz9lOUKlhBrbsciPzbKIQTUIjkd1QJRYRJ8NHPU9vH7mZLA8mCrGBDqid6bQpPyT++866VJLrvPyGgb4e6TknoPiLpw5EosqKxTFneeKcJOxPB17JwGzdCmsLK1eqNj2qv0fNuxClWu7uZQJRqmqu37zU2QP/01FjT9hvZ2LZfFA1B/cgSQIV5PJf4Oua95kfAJll0bphUTINKw7zwZsTdojU20= xx@xx.com
下载代码
[root@VM-4-16-centos gitee]# git clone git@gitee.com:y_project/RuoYi.git
Cloning into 'RuoYi'...
The authenticity of host 'gitee.com (212.64.62.183)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee.com,212.64.62.183' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 27429, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 27429 (delta 3), reused 0 (delta 0), pack-reused 27409
Receiving objects: 100% (27429/27429), 10.79 MiB | 3.61 MiB/s, done.
Resolving deltas: 100% (13150/13150), done.
[root@VM-4-16-centos gitee]# ll
total 12
-rw-------  1 root root 2590 Apr  1 16:50 ''$'\033'
-rw-r--r--  1 root root  563 Apr  1 16:50 ''$'\033''.pub'
drwxr-xr-x 13 root root 4096 Apr  1 17:18  RuoYi
=========================================================================================
[root@VM-4-16-centos gitee]# cd RuoYi/
[root@VM-4-16-centos RuoYi]# ll
total 72
drwxr-xr-x 2 root root 4096 Apr  1 17:18 bin
drwxr-xr-x 2 root root 4096 Apr  1 17:18 doc
-rw-r--r-- 1 root root 1090 Apr  1 17:18 LICENSE
-rw-r--r-- 1 root root 9793 Apr  1 17:18 pom.xml
-rw-r--r-- 1 root root 8369 Apr  1 17:18 README.md
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-admin
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-common
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-framework
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-generator
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-quartz
drwxr-xr-x 3 root root 4096 Apr  1 17:18 ruoyi-system
-rw-r--r-- 1 root root 1635 Apr  1 17:18 ry.bat
-rw-r--r-- 1 root root 1681 Apr  1 17:18 ry.sh
drwxr-xr-x 2 root root 4096 Apr  1 17:18 sql

 

 4.liunx下docker安装;

使用docker方式安装Mysql,先安装docker
先卸载旧版本docker
[root@VM-4-16-centos data]# sudo yum remove docker \
>                 docker-client \
>                 docker-client-latest \
>                 docker-common \
>                 docker-latest \
>                 docker-latest-logrotate \
>               docker-logrotate \
>                 docker-engine
No match for argument: docker
No match for argument: docker-client
No match for argument: docker-client-latest
No match for argument: docker-common
No match for argument: docker-latest
No match for argument: docker-latest-logrotate
No match for argument: docker-logrotate
No match for argument: docker-engine
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
#安装 Docker Engine-Community
1.安装需要的依赖包
[root@VM-4-16-centos data]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2.添加yum源
[root@VM-4-16-centos data]# sudo yum-config-manager \
>   --add-repo \
>   http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.安装docker ce
[root@VM-4-16-centos data]# sudo yum install docker-ce docker-ce-cli containerd.io
4.启动docker
[root@VM-4-16-centos data]# sudo systemctl start docker
5.查看容器和镜像
[root@VM-4-16-centos ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@VM-4-16-centos ~]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

 5.docker下mysql安装(安装Mysql>=5.5,推荐5.7版 )

1.查看可用的MYSQL版本
[root@VM-4-16-centos ~]# docker search mysql
NAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql                            MySQL is a widely used, open-source relation…   12342     [OK]       
mariadb                          MariaDB Server is a high performing open sou…   4748      [OK]       
mysql/mysql-server               Optimized MySQL Server Docker images. Create…   916                  [OK]
percona                          Percona Server is a fork of the MySQL relati…   572       [OK]       
phpmyadmin                       phpMyAdmin - A web interface for MySQL and M…   491       [OK]       
mysql/mysql-cluster              Experimental MySQL Cluster Docker images. Cr…   93                   
centos/mysql-57-centos7          MySQL 5.7 SQL database server                   92                   
bitnami/mysql                    Bitnami MySQL Docker Image                      67                   [OK]
ubuntu/mysql                     MySQL open source fast, stable, multi-thread…   28                   
circleci/mysql                   MySQL is a widely used, open-source relation…   25                   
mysql/mysql-router               MySQL Router provides transparent routing be…   23                   
centos/mysql-56-centos7          MySQL 5.6 SQL database server                   22                   
google/mysql                     MySQL server for Google Compute Engine          21                   [OK]
vmware/harbor-db                 Mysql container for Harbor                      10                   
mysqlboy/mydumper                mydumper for mysql logcial backups              3                    
mysqlboy/docker-mydumper         docker-mydumper containerizes MySQL logical …   3                    
bitnami/mysqld-exporter                                                          2                    
ibmcom/mysql-s390x               Docker image for mysql-s390x                    2                    
mysql/mysql-operator             MySQL Operator for Kubernetes                   0                    
ibmcom/tidb-ppc64le              TiDB is a distributed NewSQL database compat…   0                    
mysqlboy/elasticsearch                                                           0                    
mysqleatmydata/mysql-eatmydata                                                   0                    
cimg/mysql                                                                       0                    
mysql/ndb-operator               MySQL NDB Operator for Kubernetes               0                    
mirantis/mysql                                                                   0                    
2.拉取5.7版本
[root@VM-4-16-centos ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
f003217c5aae: Pull complete 
65d94f01a09f: Pull complete 
43d78aaa6078: Pull complete 
a0f91ffbdf69: Pull complete 
59ee9e07e12f: Pull complete 
04d82978082c: Pull complete 
70f46ebb971a: Pull complete 
ba61822c65c2: Pull complete 
dec59acdf78a: Pull complete 
0a05235a6981: Pull complete 
c87d621d6916: Pull complete 
Digest: sha256:1a73b6a8f507639a8f91ed01ace28965f4f74bb62a9d9b9e7378d5f07fab79dc
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7
3.查看拉取的镜像
[root@VM-4-16-centos ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
mysql        5.7       f26e21ddd20d   3 days ago   450MB
4.创建配置文件目录
mkdir -p /data/docker/mysql/conf
5.启动镜像
docker run -p 3306:3306 --name mysql -v /data/docker/mysql/conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
6.进入容器名为mysql的镜像,然后登录进入mysql数据库
[root@VM-4-16-centos ~]# docker exec -it mysql bash
root@44d88b8df1bc:/# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases
    -> show databases;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show databases' at line 2
mysql> show databases show databases;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show databases' at line 1
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> 
退出mysql
mysql> exit;
Bye
root@44d88b8df1bc:/# 
退出容器
root@44d88b8df1bc:/# exit;
exit



二、项目部署 

        1.执行项目中sql的数据库脚本

复制需要执行的sql文件到docker的映射目录中
[root@VM-4-16-centos conf]# cp /data/gitee/RuoYi/sql/quartz.sql /data/docker/mysql/conf/
###########################################################################################
注意:现在下的git的代码,文件名和“我是程序汪”视频中讲解不一样了,注意修改名字
[root@VM-4-16-centos conf]# cp /data/gitee/RuoYi/sql/ry_20200911.sql /data/docker/mysql/conf/
cp: cannot stat '/data/gitee/RuoYi/sql/ry_20200911.sql': No such file or directory
[root@VM-4-16-centos conf]# cp /data/gitee/RuoYi/sql/ry_20210924.sql /data/docker/mysql/conf/
###########################################################################################
永久支持中文:env LANG=C.UTF-8
[root@VM-4-16-centos conf]# docker exec -it mysql env LANG=C.UTF-8 bash
root@44d88b8df1bc:/# 
连接Mysql
root@44d88b8df1bc:/# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.37 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
创建数据库ruoyi
mysql> create database if not exists ruoyi character set='utf8';
Query OK, 1 row affected (0.00 sec)

mysql> 
进入数据库,执行文件
mysql> use ruoyi;
Database changed
source /etc/mysql/conf.d/quartz.sql;
source /etc/mysql/conf.d/ry_20210924.sql;
查看数据库
mysql> use ruoyi;
Database changed
mysql> 

8.修改项目配置并启动

[root@VM-4-16-centos conf]# cd /data/gitee/RuoYi/ruoyi-admin/src/main/resources/
[root@VM-4-16-centos resources]# pwd
/data/gitee/RuoYi/ruoyi-admin/src/main/resources
[root@VM-4-16-centos resources]# ll
total 32
-rw-r--r--  1 root root 2261 Apr  1 17:18 application-druid.yml
-rw-r--r--  1 root root 3829 Apr  1 17:18 application.yml
-rw-r--r--  1 root root 1632 Apr  1 17:18 banner.txt
drwxr-xr-x  2 root root 4096 Apr  1 17:18 ehcache
-rw-r--r--  1 root root 3566 Apr  1 17:18 logback.xml
drwxr-xr-x  2 root root 4096 Apr  1 17:18 mybatis
drwxr-xr-x 11 root root 4096 Apr  1 17:18 static
drwxr-xr-x  7 root root 4096 Apr  1 17:18 templates
修改application.yml的项目启动端口号
[root@VM-4-16-centos resources]# vim application.yml
修改application-druid.yml的数据源
[root@VM-4-16-centos resources]# vim application-druid.yml
修改好项目配置文件后,把入口项目进行打包。通过mvn打成可执行的jar包
cd /data/gitee/RuoYi/
mvn install
启动项目
[root@VM-4-16-centos RuoYi]# cd ruoyi-admin
[root@VM-4-16-centos ruoyi-admin]# ll
total 16
-rw-r--r-- 1 root root 4779 Apr  1 17:18 pom.xml
drwxr-xr-x 3 root root 4096 Apr  1 17:18 src
drwxr-xr-x 6 root root 4096 Apr  2 16:05 target
[root@VM-4-16-centos ruoyi-admin]# cd target
[root@VM-4-16-centos target]# ll
total 76576
drwxr-xr-x 7 root root     4096 Apr  2 16:04 classes
drwxr-xr-x 3 root root     4096 Apr  2 16:04 generated-sources
drwxr-xr-x 2 root root     4096 Apr  2 16:04 maven-archiver
drwxr-xr-x 3 root root     4096 Apr  2 16:04 maven-status
-rw-r--r-- 1 root root 75218312 Apr  2 16:05 ruoyi-admin.jar
-rw-r--r-- 1 root root  3176678 Apr  2 16:04 ruoyi-admin.jar.original
[root@VM-4-16-centos target]# mkdir -p /data/app/ruoyi-admin
[root@VM-4-16-centos target]# cp /data/gitee/RuoYi/ruoyi-admin/target/ruoyi-admin.jar /data/app/ruoyi-admin/ruoyi-admin.jar
[root@VM-4-16-centos target]# cd /data/app/ruoyi-admin/
[root@VM-4-16-centos ruoyi-admin]# ll
total 73456
-rw-r--r-- 1 root root 75218312 Apr  2 16:26 ruoyi-admin.jar
[root@VM-4-16-centos ruoyi-admin]# nohup java -jar ruoyi-admin.jar &
[1] 419090
[root@VM-4-16-centos ruoyi-admin]# nohup: ignoring input and appending output to 'nohup.out'
[root@VM-4-16-centos ruoyi-admin]# tail -300f nohup.out
[root@VM-4-16-centos RuoYi]# ll
total 72
drwxr-xr-x 2 root root 4096 Apr  1 17:18 bin
drwxr-xr-x 2 root root 4096 Apr  1 17:18 doc
-rw-r--r-- 1 root root 1090 Apr  1 17:18 LICENSE
-rw-r--r-- 1 root root 9793 Apr  1 17:18 pom.xml
-rw-r--r-- 1 root root 8369 Apr  1 17:18 README.md
drwxr-xr-x 4 root root 4096 Apr  2 16:04 ruoyi-admin
drwxr-xr-x 4 root root 4096 Apr  2 16:03 ruoyi-common
drwxr-xr-x 4 root root 4096 Apr  2 16:04 ruoyi-framework
drwxr-xr-x 4 root root 4096 Apr  2 16:04 ruoyi-generator
drwxr-xr-x 4 root root 4096 Apr  2 16:04 ruoyi-quartz
drwxr-xr-x 4 root root 4096 Apr  2 16:03 ruoyi-system
-rw-r--r-- 1 root root 1635 Apr  1 17:18 ry.bat
-rw-r--r-- 1 root root 1681 Apr  1 17:18 ry.sh
drwxr-xr-x 2 root root 4096 Apr  1 17:18 sql
[root@VM-4-16-centos RuoYi]# cd ruoyi-admin
[root@VM-4-16-centos ruoyi-admin]# ll
total 16
-rw-r--r-- 1 root root 4779 Apr  1 17:18 pom.xml
drwxr-xr-x 3 root root 4096 Apr  1 17:18 src
drwxr-xr-x 6 root root 4096 Apr  2 16:05 target
[root@VM-4-16-centos ruoyi-admin]# cd target
[root@VM-4-16-centos target]# ll
total 76576
drwxr-xr-x 7 root root     4096 Apr  2 16:04 classes
drwxr-xr-x 3 root root     4096 Apr  2 16:04 generated-sources
drwxr-xr-x 2 root root     4096 Apr  2 16:04 maven-archiver
drwxr-xr-x 3 root root     4096 Apr  2 16:04 maven-status
-rw-r--r-- 1 root root 75218312 Apr  2 16:05 ruoyi-admin.jar
-rw-r--r-- 1 root root  3176678 Apr  2 16:04 ruoyi-admin.jar.original
[root@VM-4-16-centos target]# mkdir -p /data/app/ruoyi-admin
[root@VM-4-16-centos target]# cp /data/gitee/RuoYi/ruoyi-admin/target/ruoyi-admin.jar /data/app/ruoyi-admin/ruoyi-admin.jar
[root@VM-4-16-centos target]# cd /data/app/ruoyi-admin/
[root@VM-4-16-centos ruoyi-admin]# ll
total 73456
-rw-r--r-- 1 root root 75218312 Apr  2 16:26 ruoyi-admin.jar
[root@VM-4-16-centos ruoyi-admin]# nohup java -jar ruoyi-admin.jar &
[1] 419090
[root@VM-4-16-centos ruoyi-admin]# nohup: ignoring input and appending output to 'nohup.out'

[root@VM-4-16-centos ruoyi-admin]# tail -300f nohup.out
Application Version: 4.7.3
Spring Boot Version: 2.5.11

//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             佛祖保佑       永不宕机      永无BUG               //

16:27:44.293 [main] INFO  c.r.RuoYiApplication - [logStarting,55] - Starting RuoYiApplication using Java 1.8.0_321 on VM-4-16-centos with PID 419090 (/data/app/ruoyi-admin/ruoyi-admin.jar started by root in /data/app/ruoyi-admin)
16:27:44.296 [main] DEBUG c.r.RuoYiApplication - [logStarting,56] - Running with Spring Boot v2.5.11, Spring v5.3.17
16:27:44.296 [main] INFO  c.r.RuoYiApplication - [logStartupProfileInfo,681] - The following 1 profile is active: "druid"
16:27:44.313 [background-preinit] INFO  o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.3.Final
16:27:47.512 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-authCache]
16:27:48.585 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [loginRecordCache]
16:27:49.862 [main] INFO  c.a.d.p.DruidDataSource - [init,998] - {dataSource-1} inited
16:27:49.872 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,137] - ==>  Preparing: select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config
16:27:50.122 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,137] - ==> Parameters: 
16:27:50.157 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,137] - <==      Total: 10
16:27:50.165 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.168 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.168 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.169 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.169 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.170 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.170 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.171 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.171 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.172 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-config]
16:27:50.328 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-userCache]
16:27:50.829 [main] INFO  o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-1801"]
16:27:50.830 [main] INFO  o.a.c.c.StandardService - [log,173] - Starting service [Tomcat]
16:27:50.830 [main] INFO  o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.60]
16:27:50.894 [main] INFO  o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext
16:27:51.133 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,137] - ==>  Preparing: select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data WHERE status = ?
16:27:51.142 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,137] - ==> Parameters: 0(String)
16:27:51.166 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,137] - <==      Total: 29
16:27:51.168 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.173 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.174 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.174 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.174 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.175 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.175 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.175 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.176 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.176 [main] INFO  o.a.s.c.e.EhCacheManager - [getCache,169] - Using existing EHCache named [sys-dict]
16:27:51.488 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1220] - Using default implementation for ThreadExecutor
16:27:51.520 [main] INFO  o.q.c.SchedulerSignalerImpl - [<init>,61] - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
16:27:51.521 [main] INFO  o.q.c.QuartzScheduler - [<init>,229] - Quartz Scheduler v.2.3.2 created.
16:27:51.522 [main] INFO  o.q.s.RAMJobStore - [initialize,155] - RAMJobStore initialized.
16:27:51.523 [main] INFO  o.q.c.QuartzScheduler - [initialize,294] - Scheduler meta-data: Quartz Scheduler (v2.3.2) 'quartzScheduler' with instanceId 'NON_CLUSTERED'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

16:27:51.523 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1374] - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
16:27:51.523 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1378] - Quartz scheduler version: 2.3.2
16:27:51.523 [main] INFO  o.q.c.QuartzScheduler - [setJobFactory,2293] - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@8dbfffb
16:27:51.589 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,137] - ==>  Preparing: select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark from sys_job
16:27:51.597 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,137] - ==> Parameters: 
16:27:51.602 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,137] - <==      Total: 3
16:27:53.165 [main] INFO  o.a.c.h.Http11NioProtocol - [log,173] - Starting ProtocolHandler ["http-nio-1801"]
16:27:53.670 [main] INFO  o.q.c.QuartzScheduler - [start,547] - Scheduler quartzScheduler_$_NON_CLUSTERED started.
16:27:53.685 [main] INFO  c.r.RuoYiApplication - [logStarted,61] - Started RuoYiApplication in 10.09 seconds (JVM running for 11.176)
(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  
 .-------.       ____     __        
 |  _ _   \      \   \   /  /    
 | ( ' )  |       \  _. /  '       
 |(_ o _) /        _( )_ .'         
 | (_,_).' __  ___(_ o _)'          
 |  |\ \  |  ||   |(_,_)'         
 |  | \ `'   /|   `-'  /           
 |  |  \    /  \      /           
 ''-'   `'-'    `-..-'              

备注:部署好了但是无法访问,可以查看云主机中的安全组中是否将端口开放公网。具体如下图所示。

Logo

更多推荐