当前位置: 首页 > news >正文

上线Spring boot-若依项目

基础环境

所有环境皆关闭防火墙与selinux

服务器功能主机IP主机名服务名称配置
前端服务器192.168.231.177nginxnginx1C2G
后端服务器+代码打包192.168.231.178javajava、maven、nodejs4C8G
数据库/缓存192.168.231.179dbmysql、redis2C4G

Nginx

#配置Nginxyum源
[root@nginx ~]# cat /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true#安装Nginx
[root@nginx ~]# yum install -y nginx

java

# 上传java包到服务器
# 安装java环境
[root@java ~]# tar -xf jdk-8u211-linux-x64.tar.gz -C /usr/local/
[root@java ~]# mv /usr/local/jdk1.8.0_211/ /usr/local/java
[root@java ~]# vim /etc/profile.d/java.sh
JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin重载配置文件
[root@java ~]# source /etc/profile.d/java.sh查看java是否安装成功
[root@java ~]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

mysql、redis

# 配置mysql yum源
# 安装mysql
[root@db ~]# yum install -y mysql-server
[root@db ~]# systemctl start mysqld
[root@db ~]# systemctl enable mysqld过滤MySQL初始密码,必须启动MySQL,才能过滤出来
[root@db ~]# grep "password" /var/log/mysqld.log
2023-11-03T19:44:26.450149Z 1 [Note] A temporary password is generated for root@localhost: rb894yRh(NUG修改mysql密码
[root@db ~]# mysqladmin -uroot -p'rb894yRh(NUG' password 'QianFeng@123!'
[root@db ~]# mysql -uroot -p'QianFeng@123!'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.42 MySQL Community Server (GPL)Copyright (c) 2000, 2023, 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> create database ruoyi character set utf8 collate  utf8_general_ci;
Query OK, 1 row affected (0.00 sec)#授权root用户远程登录
mysql> grant all on *.*  to 'root'@'%' identified by 'QianFeng@123!';
Query OK, 0 rows affected, 1 warning (0.00 sec)#刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> \q
Bye

[root@db ~]# wget http://download.redis.io/releases/redis-4.0.9.tar.gz
[root@db ~]# tar -xf redis-4.0.9.tar.gz -C /usr/local/
[root@db ~]# mv /usr/local/redis-4.0.9/ /usr/local/redis安装编译工具gcc  make
[root@db ~]# yum install -y gcc make
[root@db ~]# cd /usr/local/redis/
[root@db redis]# make修改redis的配置文件,
[root@db redis]# cat redis.conf
bind 192.168.231.179
port 6379
daemonize yes
[root@db redis]# ./src/redis-server redis.conf &
[root@db redis]# ss -tlanp |grep redis
LISTEN     0      128   192.168.231.179:6379                     *:*                   users:(("redis-server",pid=4938,fd=6))

配置打包环境

配置前端打包环境

[root@java ~]# wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.xz
[root@java ~]# tar -xf node-v12.18.4-linux-x64.tar.xz -C /usr/local/改名
[root@java ~]# mv /usr/local/node-v12.18.4-linux-x64/ /usr/local/node配置环境变量
[root@java ~]# vim /etc/profile.d/node.sh
NODE_HOME=/usr/local/node
PATH=$PATH:$NODE_HOME/bin重载环境变量
[root@java ~]# source /etc/profile.d/node.sh查看是否安装成功
[root@java ~]# node -v
v12.18.4

配置后端打包环境

下包,解压包,改名
[root@java ~]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz --no-check-certificate
[root@java ~]# tar -xf apache-maven-3.9.5-bin.tar.gz -C /usr/local/
[root@java ~]# mv /usr/local/apache-maven-3.9.5/ /usr/local/maven配置环境变量
[root@java ~]# vim /etc/profile.d/mvn.sh
MAVEN_HOME=/usr/local/maven
PATH=$PATH:$MAVEN_HOME/bin重载环境变量
[root@java ~]# source /etc/profile.d/mvn.sh查看是否安装成功
[root@java ~]# mvn -version
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /usr/local/maven
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/local/java/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.el7.x86_64", arch: "amd64", family: "unix"

获取代码

获取源代码
[root@java ~]# yum install -y git
[root@java ~]# git clone https://gitee.com/y_project/RuoYi-Vue.git获得RuoYi-Vue
[root@java ~]# ls
anaconda-ks.cfg                node-v12.18.4-linux-x64.tar.xz
apache-maven-3.9.5-bin.tar.gz  RuoYi-Vue
jdk-8u211-linux-x64.tar.gz

前端代码打包

[root@java ~]# cd RuoYi-Vue/ruoyi-ui
#替换为国内的taobaoyuan
[root@java ruoyi-ui]# npm install --unsafe-perm --registry=https://registry.npm.taobao.org
[root@java ruoyi-ui]# npm run build:prod构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件,通常是 xxx.js 、xxx.css、index.html 等静态文件。通常情况下 dist 文件夹的静态文件发布到你的 nginx 或者静态服务器即可,其中的 index.html 是后台服务的入口页面。
[root@java ruoyi-ui]# ls
babel.config.js  dist          package-lock.json  src
bin              node_modules  public             vue.config.js
build            package.json  README.md
[root@java ruoyi-ui]# cd dist/
[root@java dist]# ls
favicon.ico  html  index.html  index.html.gz  robots.txt  static# 将静态资源移动到其他位置,然后进行后端代码打包
[root@java dist]# cd /root/RuoYi-Vue
[root@java RuoYi-Vue]# mv ruoyi-ui/ /opt/

后端代码打包

首先修改后端所需的配置文件

[root@java ~]# cd RuoYi-Vue/
[root@java RuoYi-Vue]# vim ruoyi-admin/src/main/resources/application.yml
# 修改redis配置信息redis:# 地址host: 192.168.231.179# 端口,默认为6379port: 6379# 数据库索引database: 0# 密码password:# 连接超时时间timeout: 10slettuce:[root@java RuoYi-Vue]# vim ruoyi-admin/src/main/resources/application-druid.yml
### 修改数据库url,修改数据库密码
# 数据源配置
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriverClassName: com.mysql.cj.jdbc.Driverdruid:# 主库数据源master:url: jdbc:mysql://192.168.231.179:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8username: rootpassword: QianFeng@123!

后端打包

root@java RuoYi-Vue]# mvn package
…………
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:35 min
[INFO] Finished at: 2023-11-03T20:18:20+08:00
[INFO] ------------------------------------------------------------------------
[root@java RuoYi-Vue]# ls ruoyi-admin/target/
classes            maven-archiver  ruoyi-admin.jar 
generated-sources  maven-status    ruoyi-admin.jar.original#ruoyi-admin.jar 放在后端服务器运行

项目上线

前端项目上线

# 拷贝前端资源到前端服务器
[root@java ~]# cd /opt
[root@java opt]# scp -r ruoyi-ui/ 192.168.231.177:/opt/#前端项目上线
[root@nginx ~]# rm -rf /usr/share/nginx/html/*
[root@nginx ~]# cp -r /opt/ruoyi-ui/dist/* /usr/share/nginx/html/
[root@nginx ~]# ls /usr/share/nginx/html/
favicon.ico  html  index.html  index.html.gz  robots.txt  static[root@nginx ~]# vim /etc/nginx/conf.d/default.conf
upstream rs {server 192.168.231.178:8080;
}
server {listen       80;server_name  localhost;access_log  /var/log/nginx/host.access.log  main;location / {root   /usr/share/nginx/html;try_files $uri $uri/ /index.html;index  index.html index.htm;}location /prod-api/ {proxy_pass http://rs/;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}
[root@nginx ~]# systemctl restart nginx#前端上线完成,但是由于后端还未上线,所以有报错,并且验证码无法显示

#前端上线完成,但是由于后端还未上线,所以有报错,并且验证码无法显示

后端项目上线

# 将jar包传送到后端服务器
[root@java opt]# cp ~/RuoYi-Vue/ruoyi-admin/target/ruoyi-admin.jar /java/#导入初始化数据,首先将初始化数据传到数据库服务器
[root@java ~]# cd /root/RuoYi-Vue/sql
[root@java sql]# ls
quartz.sql  ry_20230706.sql
[root@java sql]# scp * 192.168.231.179:/opt/
# 导入初始化数据
[root@db redis]# mysql -uroot -p'QianFeng@123!' ruoyi < /opt/quartz.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@db redis]# mysql -uroot -p'QianFeng@123!' ruoyi < /opt/ry_20230706.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
#开始测试上线后端服务
[root@java target]# java -jar -server -Xmx1024m -Xms1024m ruoyi-admin.jar
Application Version: 3.8.6
Spring Boot Version: 2.5.15//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             佛祖保佑       永不宕机      永无BUG               //05:15:09.581 [background-preinit] INFO  o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
05:15:09.633 [main] INFO  c.r.RuoYiApplication - [logStarting,55] - Starting RuoYiApplication using Java 1.8.0_211 on db with PID 15389 (/opt/RuoYi-Vue/ruoyi-admin/target/ruoyi-admin.jar started by root in /opt/RuoYi-Vue/ruoyi-admin/target)
05:15:09.634 [main] DEBUG c.r.RuoYiApplication - [logStarting,56] - Running with Spring Boot v2.5.15, Spring v5.3.27
05:15:09.634 [main] INFO  c.r.RuoYiApplication - [logStartupProfileInfo,686] - The following 1 profile is active: "druid"
05:15:11.945 [main] INFO  o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-8080"]
05:15:11.945 [main] INFO  o.a.c.c.StandardService - [log,173] - Starting service [Tomcat]
05:15:11.946 [main] INFO  o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.75]
05:15:12.035 [main] INFO  o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext
05:15:12.514 [main] DEBUG c.r.f.s.f.JwtAuthenticationTokenFilter - [init,242] - Filter 'jwtAuthenticationTokenFilter' configured for use
05:15:13.856 [main] INFO  c.a.d.p.DruidDataSource - [init,996] - {dataSource-1} inited
05:15:13.862 [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 = ? order by dict_sort asc
05:15:13.880 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,137] - ==> Parameters: 0(String)
05:15:13.903 [main] DEBUG c.r.s.m.S.selectDictDataList - [debug,137] - <==      Total: 29
05:15:14.462 [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
05:15:14.463 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,137] - ==> Parameters:
05:15:14.465 [main] DEBUG c.r.s.m.S.selectConfigList - [debug,137] - <==      Total: 6
05:15:14.873 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1220] - Using default implementation for ThreadExecutor
05:15:14.885 [main] INFO  o.q.c.SchedulerSignalerImpl - [<init>,61] - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
05:15:14.885 [main] INFO  o.q.c.QuartzScheduler - [<init>,229] - Quartz Scheduler v.2.3.2 created.
05:15:14.886 [main] INFO  o.q.s.RAMJobStore - [initialize,155] - RAMJobStore initialized.
05:15:14.887 [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: 0Using 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.05:15:14.887 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1374] - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
05:15:14.887 [main] INFO  o.q.i.StdSchedulerFactory - [instantiate,1378] - Quartz scheduler version: 2.3.2
05:15:14.887 [main] INFO  o.q.c.QuartzScheduler - [setJobFactory,2293] - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@649725e3
05:15:14.906 [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
05:15:14.906 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,137] - ==> Parameters:
05:15:14.908 [main] DEBUG c.r.q.m.S.selectJobAll - [debug,137] - <==      Total: 3
05:15:16.124 [main] INFO  o.a.c.h.Http11NioProtocol - [log,173] - Starting ProtocolHandler ["http-nio-8080"]
05:15:16.511 [main] INFO  o.q.c.QuartzScheduler - [start,547] - Scheduler quartzScheduler_$_NON_CLUSTERED started.
05:15:16.521 [main] INFO  c.r.RuoYiApplication - [logStarted,61] - Started RuoYiApplication in 7.487 seconds (JVM running for 7.935)
(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙.-------.       ____     __|  _ _   \      \   \   /  /| ( ' )  |       \  _. /  '|(_ o _) /        _( )_ .'| (_,_).' __  ___(_ o _)'|  |\ \  |  ||   |(_,_)'|  | \ `'   /|   `-'  /|  |  \    /  \      /''-'   `'-'    `-..-'

结尾出现若依启动成功,则证明后端服务成功上线

正式上线

[root@java target]# nohup java -jar -server -Xmx1024m -Xms1024m ruoyi-admin.jar &

错误及解决办法

## 如果报错链接不上数据库,且数据库配置无问题,将RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml文件中,
master:
                url: jdbc:mysql://192.168.231.179:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
                
将url中useSSL=yes改成useSSL=false,然后重新打包上线

在JDBC连接MySQL数据库时,useSSL参数用于指定是否使用SSL(安全套接层)加密连接。SSL是一种用于在计算机网络上提供安全通信的协议,它可以确保在客户端和服务器之间传输的数据在传输过程中是加密的,从而提供了一定程度的安全性。

当useSSL参数设置为false时,表示不使用SSL加密连接。这通常在开发和测试环境中比较常见,因为在这些环境下,对数据传输的安全性要求可能较低,而且SSL加密会增加一些额外的性能开销。在这种情况下,如果数据库服务器不要求强制的SSL连接,你可以将useSSL参数设置为false来简化连接配置。

但是,在生产环境中,特别是涉及到敏感数据的应用,强烈建议使用SSL加密来保护数据的传输安全性。在生产环境中,通常会将useSSL参数设置为true,以确保数据库连接是安全的。

在你的连接字符串中,useSSL=false表示不使用SSL加密连接。如果你的数据库服务器要求SSL连接,那么你需要将useSSL参数设置为true,以便建立加密连接。

nohup命令解释

nohup命令:nohup 是 no hang up 的缩写,就是不挂断的意思,但没有后台运行,终端不能标准输入。
nohup :不挂断的运行,注意并没有后台运行的功能,就是指,用nohup运行命令可以使命令永久的执行下去,和用户终端没有关系,例如我们断开SSH连接都不会影响他的运行,注意了nohup没有后台运行的意思;&才是后台运行

在缺省情况下该作业的所有输出都被重定向到一个名为nohup.out的文件中。

nohup和&的区别
&:指在后台运行
&是指在后台运行,但当用户推出(挂起)的时候,命令自动也跟着退出

&的意思是在后台运行, 什么意思呢? 意思是说, 当你在执行 ./start.sh & 的时候, 即使你用ctrl+C, 那么start.sh照样运行(因为对SIGINT(程序终止信号,一般有ctrl+C发出)信号免疫)。 但是要注意, 如果你直接关掉shell后, 那么,start.sh进程同样消失。 可见, &的后台并不硬(因为对SIGHUP(用户终端连接(正常或非正常)结束时发出)信号不免疫)。

nohup的意思是忽略SIGHUP信号, 所以当运行nohup ./start.sh的时候, 关闭shell, 那么start.sh进程还是存在的(对SIGHUP信号免疫)。 但是, 要注意, 如果你直接在shell中用Ctrl+C, 那么start.sh进程也是会消失的(因为对SIGINT信号不免疫)


所以, &和nohup没有半毛钱的关系, 要让进程真正不受shell中Ctrl+C和shell关闭的影响, 那该怎么办呢? 那么,我们可以巧妙的将他们结合起来用就是
nohup COMMAND > /dev/null &
这样就能使命令永久的在后台执行两全其美。

相关文章:

上线Spring boot-若依项目

基础环境 所有环境皆关闭防火墙与selinux 服务器功能主机IP主机名服务名称配置前端服务器192.168.231.177nginxnginx1C2G后端服务器代码打包192.168.231.178javajava、maven、nodejs4C8G数据库/缓存192.168.231.179dbmysql、redis2C4G Nginx #配置Nginxyum源 [rootnginx ~]…...

pinia简单使用

新命令-创建vue3项目 vue create 方式使用脚手架创建项目&#xff0c;vue cli处理&#xff0c; vue3后新的脚手架工具create-vue 使用npm init vuelatest 命令创建即可。 在pinia中&#xff0c;将使用的组合式函数识别为状态管理内容 自动将ref 识别为stste,computed 相当于 ge…...

数据库进阶教学——数据库故障恢复(日志文件)

目录 一、日志简介 二、日志文件操作 1、查看日志状态 2、开启日志功能 3、查看日志文件 4、查看当前日志 5、查看日志中的事件 6、删除日志文件 7、查看和修改日志文件有效期 8、查看日志文件详细信息 三、删除的数据库恢复 一、日志简介 日志是记录所有数据库表结…...

Leetcode 73 矩阵置0

class Solution {//1.用矩阵的第一行和第一列来标记该行或该列是否应该为0,但是这样的话忽视了第一行或第一列为0的情况//2.用标记row0和column0来标记第一行或第一列是否该为0public void setZeroes(int[][] matrix) {int n matrix.length;int m matrix[0].length;boolean r…...

Rust学习日记(二)变量的使用--结合--温度换算/斐波那契数列--实例

前言&#xff1a; 这是一个系列的学习笔记&#xff0c;会将笔者学习Rust语言的心得记录。 当然&#xff0c;这并非是流水账似的记录&#xff0c;而是结合实际程序项目的记录&#xff0c;如果你也对Rust感兴趣&#xff0c;那么我们可以一起交流探讨&#xff0c;使用Rust来构建程…...

html各个标签的使用

一、标签的分类 1、单标签和双标签 1. 单标签&#xff1a;<img> img br hr 2. 双标签&#xff1a;<div></div> div span <a></a> h p a 2、按照标签属性分类 1. 块标签&#xff1a;自己独占一行 h1~h6 p div 2. 行内(内联)标签 …...

android 混淆

# 指定代码的压缩级别 0 - 7(指定代码进行迭代优化的次数&#xff0c;在Android里面默认是5&#xff0c;这条指令也只有在可以优化时起作用。) -optimizationpasses 5 # 混淆时不会产生形形色色的类名(混淆时不使用大小写混合类名) -dontusemixedcaseclassnames # 指定不去忽略…...

旋转链表(C++解法)

题目 给你一个链表的头节点 head &#xff0c;旋转链表&#xff0c;将链表每个节点向右移动 k 个位置。 示例 1&#xff1a; 输入&#xff1a;head [1,2,3,4,5], k 2 输出&#xff1a;[4,5,1,2,3]示例 2&#xff1a; 输入&#xff1a;head [0,1,2], k 4 输出&#xff1a;[…...

AcWing 134:双端队列

【题目来源】https://www.acwing.com/problem/content/description/136/【题目描述】 达达现在碰到了一个棘手的问题&#xff0c;有 N 个整数需要排序。 达达手头能用的工具就是若干个双端队列。 她从 1 到 N 需要依次处理这 N 个数&#xff0c;对于每个数&#xff0c;达达能做…...

Spring Cloud Gateway 重写 URL

目录 1、简介 2、Spring Cloud Gateway 快速回顾 3、基于配置的 URL 重写 4、基于 DSL 的 URL 重写 5、测试 6、总结 1、简介 Spring Cloud Gateway 的常见用例是作为一个网关&#xff0c;代理一个或多个服务&#xff0c;从而为客户端提供更简单的消费方式。 本文将带你…...

【C语法学习】10 - scanf()函数

文章目录 0 前言1 函数原型2 参数2.1 格式字符串2.1.1 转换说明 2.2 参数列表 3 返回值4 读取机制4.1 基本概念4.2 转换说明4.3 读取过程4.4 读取示例4.5 多参数 6 示例6.1 示例16.2 示例26.3 示例36.4 示例4 0 前言 scanf()函数虽然使用起来较为灵活&#xff0c;但是其读取机…...

ffmpeg mp3截取命令,视频与mp3合成带音频视频命令

从00:00:03.500开始截取往后长度到结尾的mp3音频&#xff08;这个更有用&#xff0c;测试好用&#xff09; ffmpeg -i d:/c.mp3 -ss 00:00:03.500 d:/output.mp3 将两个音频合并成一个音频&#xff08;测试好用&#xff09; ffmpeg -i "concat:d:/c.mp3|d:/output.mp3&…...

文件夹还在,里面文件没了?问题这样解决

文件夹还在但文件无故消失怎么办&#xff1f;文件的消失对于我们来说可能是个令人沮丧且困惑的问题。有时候&#xff0c;我们可能会发现文件夹依然存在&#xff0c;但其中的文件却消失了。在这篇文章中&#xff0c;我们将探讨为什么电脑文件会无故消失的原因&#xff0c;并提供…...

使用 OpenCV 和 Tesseract OCR 进行车牌识别

您将了解自动车牌识别。我们将使用 Tesseract OCR 光学字符识别引擎(OCR 引擎)来自动识别车辆牌照中的文本。 Python-tesseract: Py-tesseract 是 Python 的光学字符识别 (OCR) 工具。也就是说,它将识别并“读取”图像中嵌入的文本。Python-tesseract 是 Google 的 Tessera…...

What exactly are the practices involved in DevOps?

目录 1. Continuous Integration (CI) 2. Continuous Deployment (CD) 3. Infrastructure as Code (IAC) 4. Configuration Management 5. Monitoring and Logging 6. Automated Testing 7. Collaboration and Communication 8. Microservices Architecture 9. Conta…...

Spring底层原理(五)

Spring底层原理(五) 本章内容 介绍Aware接口与InitializingBean接口、Bean的初始化与销毁、Scope Aware接口 作用:用于注入一些与容器相关的信息 类名作用BeanNameAware注入Bean的名称BeanFactoryAware注入BeanFactory容器ApplicationContextAware注入ApplicationContext容…...

算法的基本概念(数据结构与算法)

数据结构是指数据元素之间的关系和组织方式&#xff0c;在计算机科学中被广泛应用于存储和操作数据的方法和技术。 数据元素&#xff1a; 数据元素是构成数据的基本单位&#xff0c;可以是数字、字符、记录等。 数据项&#xff1a; 数据元素中的一个部分&#xff0c;表示一个属…...

高阶数据结构学习——LRU Cache

文章目录 1、了解LRU Cache&#xff08;Least Recently Used缩写&#xff09;2、代码实现 1、了解LRU Cache&#xff08;Least Recently Used缩写&#xff09; Cache是缓存&#xff0c;在磁盘和内存之间&#xff0c;内存和寄存器之间都存在&#xff0c;CPU和内存之间存在三级缓…...

代码冲突解决

远程仓库修改 本地代码修改 接下来我们push一下 如果使用IDE 冲突内容如下&#xff1a; 我们可以使用自带的工具进行修改 我们选择接受自己改动的即可 如果使用git工具怎么去处理呢 远程分支是这样 本地是这样的 add和commit之后&#xff0c;再pull&#xff0c;最后pus…...

c/c++程序的内存开辟时 的内存情况

我们写的代码都是要存放在内存空间中的&#xff0c;我们经常说堆区&#xff0c;静态区&#xff0c;还有栈区&#xff0c;相信很多人不是很明白&#xff0c;在今天这篇博客中让大家对它们有一个粗略的认识 1.栈区&#xff08;static&#xff09; 在执行函数时&#xff0c;函数内…...

浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)

✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义&#xff08;Task Definition&…...

docker详细操作--未完待续

docker介绍 docker官网: Docker&#xff1a;加速容器应用程序开发 harbor官网&#xff1a;Harbor - Harbor 中文 使用docker加速器: Docker镜像极速下载服务 - 毫秒镜像 是什么 Docker 是一种开源的容器化平台&#xff0c;用于将应用程序及其依赖项&#xff08;如库、运行时环…...

多场景 OkHttpClient 管理器 - Android 网络通信解决方案

下面是一个完整的 Android 实现&#xff0c;展示如何创建和管理多个 OkHttpClient 实例&#xff0c;分别用于长连接、普通 HTTP 请求和文件下载场景。 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas…...

蓝牙 BLE 扫描面试题大全(2):进阶面试题与实战演练

前文覆盖了 BLE 扫描的基础概念与经典问题蓝牙 BLE 扫描面试题大全(1)&#xff1a;从基础到实战的深度解析-CSDN博客&#xff0c;但实际面试中&#xff0c;企业更关注候选人对复杂场景的应对能力&#xff08;如多设备并发扫描、低功耗与高发现率的平衡&#xff09;和前沿技术的…...

【CSS position 属性】static、relative、fixed、absolute 、sticky详细介绍,多层嵌套定位示例

文章目录 ★ position 的五种类型及基本用法 ★ 一、position 属性概述 二、position 的五种类型详解(初学者版) 1. static(默认值) 2. relative(相对定位) 3. absolute(绝对定位) 4. fixed(固定定位) 5. sticky(粘性定位) 三、定位元素的层级关系(z-i…...

第25节 Node.js 断言测试

Node.js的assert模块主要用于编写程序的单元测试时使用&#xff0c;通过断言可以提早发现和排查出错误。 稳定性: 5 - 锁定 这个模块可用于应用的单元测试&#xff0c;通过 require(assert) 可以使用这个模块。 assert.fail(actual, expected, message, operator) 使用参数…...

Swagger和OpenApi的前世今生

Swagger与OpenAPI的关系演进是API标准化进程中的重要篇章&#xff0c;二者共同塑造了现代RESTful API的开发范式。 本期就扒一扒其技术演进的关键节点与核心逻辑&#xff1a; &#x1f504; 一、起源与初创期&#xff1a;Swagger的诞生&#xff08;2010-2014&#xff09; 核心…...

是否存在路径(FIFOBB算法)

题目描述 一个具有 n 个顶点e条边的无向图&#xff0c;该图顶点的编号依次为0到n-1且不存在顶点与自身相连的边。请使用FIFOBB算法编写程序&#xff0c;确定是否存在从顶点 source到顶点 destination的路径。 输入 第一行两个整数&#xff0c;分别表示n 和 e 的值&#xff08;1…...

HDFS分布式存储 zookeeper

hadoop介绍 狭义上hadoop是指apache的一款开源软件 用java语言实现开源框架&#xff0c;允许使用简单的变成模型跨计算机对大型集群进行分布式处理&#xff08;1.海量的数据存储 2.海量数据的计算&#xff09;Hadoop核心组件 hdfs&#xff08;分布式文件存储系统&#xff09;&a…...

七、数据库的完整性

七、数据库的完整性 主要内容 7.1 数据库的完整性概述 7.2 实体完整性 7.3 参照完整性 7.4 用户定义的完整性 7.5 触发器 7.6 SQL Server中数据库完整性的实现 7.7 小结 7.1 数据库的完整性概述 数据库完整性的含义 正确性 指数据的合法性 有效性 指数据是否属于所定…...