diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e796427 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Bunny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ReadMe.md b/ReadMe.md index d063947..6d78d3e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,5 +1,7 @@ # 教程和Demo相关 + 1. Drools 2. vue的v-model绑定 -3. RabbitMQ示例 \ No newline at end of file +3. RabbitMQ示例 +4. SpringCloud \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/400.html b/cloud-demo/services/service-order/src/main/resources/static/error/400.html new file mode 100644 index 0000000..fc1e212 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/400.html @@ -0,0 +1,69 @@ + + + + + 400 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 400 - Bad Request

+
+
错误说明:因为错误的语法导致服务器无法理解请求信息。
+
原因1:客户端发起的请求不符合服务器对请求的某些限制,或者请求本身存在一定的错误。
+
解决办法:
+
链接中有特殊字符或者链接长度过长导致,请对应修改.
+
原因2:request header 或者 cookie 过大所引起
+
解决办法:
+
crtl+shift+delete 快捷键清除cookie.
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/403.html b/cloud-demo/services/service-order/src/main/resources/static/error/403.html new file mode 100644 index 0000000..6c281b0 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/403.html @@ -0,0 +1,69 @@ + + + + + 403 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

403 - Forbidden 禁止访问: 访问被拒绝

+
+
错误说明:禁止访问,服务器拒绝访问
+
原因1:未找到默认的索引文件
+
解决办法:
+
IIS中【启用默认内容文档】选项中将默认打开文档修改为程序首页文件格式,如:index.html或者index.php
+
原因2:文件夹安全权限导致
+
解决办法:
+
程序文件-右击-属性-安全-Users-修改为读取和执行权限
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/404.html b/cloud-demo/services/service-order/src/main/resources/static/error/404.html new file mode 100644 index 0000000..6cc5d1e --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/404.html @@ -0,0 +1,78 @@ + + + + + 404 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

404 - Page Not Found 未找到

+
+
错误说明:请求的页面不存在
+
原因1:访问的文档权限不够
+
解决办法:
+
修改文件权限为755,windos系统修改目录权限为可写可读。
+
原因2:防火墙的原因
+
解决办法:
+
先关闭让防火墙通过WWW服务。
+
原因3:站点根目录无默认访问文件
+
解决办法:
+
在根目录中创建index.html或者创建index.php。
+
原因4:站点配置目录不正确
+
解决办法:
+
将网站应用程序复制到站点目录中,或者修改站点配置目录指定到应用程序目录中。
+
原因5:站点使用了伪静态
+
解决办法:
+
将伪静态规则删除,或者重新编写正确的伪静态规则,或关闭伪静态配置。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/500.html b/cloud-demo/services/service-order/src/main/resources/static/error/500.html new file mode 100644 index 0000000..6071bf4 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/500.html @@ -0,0 +1,64 @@ + + + + + 500 - 服务器错误 + + + + +
+

:'(

+

服务器开小差啦!管理员正在修理中...

+

还请阁下静候站点恢复~

+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/501.html b/cloud-demo/services/service-order/src/main/resources/static/error/501.html new file mode 100644 index 0000000..48ac544 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/501.html @@ -0,0 +1,66 @@ + + + + + 501 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 501 - Not Implemented

+
+
错误说明:服务器没有相应的执行动作来完成当前请求。
+
原因1:Web 服务器不支持实现此请求所需的功能
+
解决办法:
+
可以用来HttpWebRequest指定一个UserAgent来试试的,有时候你可以换电脑来测试一下的。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/502.html b/cloud-demo/services/service-order/src/main/resources/static/error/502.html new file mode 100644 index 0000000..ea44be2 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/502.html @@ -0,0 +1,80 @@ + + + + + 502 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 502 - Bad Gateway 没有响应

+
+
错误说明:坏的网关,http向后端节点请求,没有响应
+
原因1:DNS 缓冲
+
解决办法:
+
在dos窗口运行 ipconfig /flushdns,该命令会刷新DNS缓冲。
+
原因2:浏览器代理
+
解决办法:
+
关掉代理。
+
原因3:dns 被劫持了,即使使用国外的dns,也会被劫持
+
解决办法:
+
+ 去掉VPN服务器的DNS。切换另外的dns。在windows系统中,可以在本地网络连接的属性中,去掉默认的dns,选用国外的dns,比如google的或opendns。 +
+
原因4:php执行超时
+
解决办法:
+
修改/usr/local/php/etc/php.ini 将max_execution_time 改为300。
+
原因5:nginx等待时间超时
+
解决办法:
+
适当增加nginx.conf配置文件中FastCGI的timeout时间。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/503.html b/cloud-demo/services/service-order/src/main/resources/static/error/503.html new file mode 100644 index 0000000..c6fec86 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/503.html @@ -0,0 +1,69 @@ + + + + + 503 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 503 - Service Unavailable 服务不可用

+
+
错误说明:服务当前不可用
+
原因1:服务不可用状态
+
解决办法:
+
服务器或许就是正在维护或者暂停了,你可以联系一下服务器空间商。
+
原因2:程序占用资源太多
+
解决办法:
+
通过设置应用程序池把账户改为NetworkService即可解决。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/504.html b/cloud-demo/services/service-order/src/main/resources/static/error/504.html new file mode 100644 index 0000000..2980dd0 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/504.html @@ -0,0 +1,81 @@ + + + + + 504 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 504 - Gateway Timeout 网关超时

+
+
错误说明:网关超时,服务器响应时间,达到超出设定的范围
+
原因1:后端电脑之间 IP 通讯缓慢而产生
+
解决办法:
+
如果您的 Web 服务器由某一网站托管, 只有负责那个网站设置的人员才能解决这个问题。
+
原因2:由于nginx默认的fastcgi进程响应的缓冲区太小造成的错误
+
解决办法:
+
一般默认的fastcgi进程响应的缓冲区是8K,这时可以设置大一点,在nginx.conf里,加入:fastcgi_buffers 8 + 128k这表示设置fastcgi缓冲区为8块128k大小的空间。当然如果在进行某一项即时的操作, 可能需要nginx的超时参数调大点, + 例如设置成60秒:send_timeout 60;经过这两个参数的调整,一般不会再提示“504 Gateway Time-out”错误,问题基本解决。 +
+
原因3:PHP环境的配置问题
+
解决办法:
+
更改php-fpm的几处配置: 把max_children由之前的10改为现在的30,这样就可以保证有充足的php-cgi进程可以被使用; + 把request_terminate_timeout由之前的0s改为60s,这样php-cgi进程 处理脚本的超时时间就是60秒,可以防止进程都被挂起,提高利用效率。 + 接着再更改nginx的几个配置项,减少FastCGI的请求次数,尽量维持buffers不变: fastcgi_buffers由 4 64k 改为 2 + 256k; fastcgi_buffer_size 由 64k 改为 128K; fastcgi_busy_buffers_size 由 128K 改为 256K; + fastcgi_temp_file_write_size 由 128K 改为 256K。 重新加载php-fpm和nginx的配置,再次测试,如果没有出现“504 + Gateway Time-out”错误,问题解决。 +
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/505.html b/cloud-demo/services/service-order/src/main/resources/static/error/505.html new file mode 100644 index 0000000..1cd5dd5 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/505.html @@ -0,0 +1,72 @@ + + + + + 505 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 505 - HTTP Version Not Supported

+
+
错误说明:HTTP 版本不受支持。
+
原因1:您的 Web 服务器不支持,或拒绝支持客户端(如您的浏览器)在发送给服务器的 HTTP 请求数据流中指定的 HTTP + 协议版本 +
+
解决办法:
+
升级您的 Web 服务器软件。
+
原因2:http请求格式的错误
+
解决办法:
+
对照一下自己的代码,从打印的信息中终于找到问题所在。可能在请求后面多加了一个空格。http协议真是很严格了。 +
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/506.html b/cloud-demo/services/service-order/src/main/resources/static/error/506.html new file mode 100644 index 0000000..8160abd --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/506.html @@ -0,0 +1,66 @@ + + + + + 506 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 506 - Variant Also Negotiates

+
+
错误说明:
+
原因1:服务器存在内部配置错误
+
解决办法:
+
被请求的协商变元资源被配置为在透明内容协商中使用自己,因此在一个协商处理中不是一个合适的重点。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/507.html b/cloud-demo/services/service-order/src/main/resources/static/error/507.html new file mode 100644 index 0000000..fb6c7e7 --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/507.html @@ -0,0 +1,66 @@ + + + + + 507 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 507 - Insufficient Storage

+
+
错误说明:
+
原因1:服务器无法存储完成请求所必须的内容
+
解决办法:
+
这个状况被认为是临时的。WebDAV (RFC 4918)。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/509.html b/cloud-demo/services/service-order/src/main/resources/static/error/509.html new file mode 100644 index 0000000..520abbd --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/509.html @@ -0,0 +1,66 @@ + + + + + 509 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 509 - Bandwidth Limit Exceeded

+
+
错误说明:
+
原因1:网站流量已经超出您所购买的方案限制即服务器达到带宽限制
+
解决办法:
+
1.升级方案 2.等到下个月后流量重新计算,网站即可正常浏览。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/error/510.html b/cloud-demo/services/service-order/src/main/resources/static/error/510.html new file mode 100644 index 0000000..95b2f9f --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/static/error/510.html @@ -0,0 +1,66 @@ + + + + + 510 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 510 - Not Extended

+
+
错误说明:
+
原因1:获取资源所需要的策略并没有被满足
+
解决办法:
+
需要请求有额外的扩展内容,服务器才能处理请求。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-order/src/main/resources/static/favicon.ico b/cloud-demo/services/service-order/src/main/resources/static/favicon.ico new file mode 100644 index 0000000..385f8a6 Binary files /dev/null and b/cloud-demo/services/service-order/src/main/resources/static/favicon.ico differ diff --git a/cloud-demo/services/service-order/src/main/resources/templates/index.html b/cloud-demo/services/service-order/src/main/resources/templates/index.html new file mode 100644 index 0000000..5b8e04a --- /dev/null +++ b/cloud-demo/services/service-order/src/main/resources/templates/index.html @@ -0,0 +1,420 @@ + + + + + + SpringCloud微服务复习教程 + + + + +
+
+

SpringCloud微服务复习教程

+

掌握微服务架构的核心概念与实践,从服务注册发现到分布式配置,全面复习SpringCloud生态系统的关键组件

+
+
+ +
+
+
+
+
📚
+

系统化学习

+

从基础到高级,循序渐进掌握SpringCloud所有核心组件

+
+
+
💡
+

实战案例

+

通过实际项目案例,理解微服务架构的设计与实现

+
+
+
🔧
+

最佳实践

+

学习行业内的微服务最佳实践和常见问题解决方案

+
+
+ +
+
+

核心组件教程

+
+ +
+
+
Eureka - 服务注册与发现
+
+
    +
  • 服务注册中心原理
  • +
  • 服务提供者注册
  • +
  • 服务消费者发现
  • +
  • 高可用Eureka集群
  • +
  • 自我保护机制
  • +
+ 开始学习 +
+
+ +
+
Ribbon - 客户端负载均衡
+
+
    +
  • 负载均衡策略
  • +
  • 自定义负载规则
  • +
  • 与Eureka集成
  • +
  • 重试机制
  • +
  • 性能调优
  • +
+ 开始学习 +
+
+ +
+
Feign - 声明式服务调用
+
+
    +
  • 接口式编程
  • +
  • 请求参数处理
  • +
  • 错误处理
  • +
  • 日志配置
  • +
  • 性能优化
  • +
+ 开始学习 +
+
+ +
+
Hystrix - 服务熔断
+
+
    +
  • 服务降级
  • +
  • 熔断机制
  • +
  • 请求缓存
  • +
  • 请求合并
  • +
  • Dashboard监控
  • +
+ 开始学习 +
+
+ +
+
Zuul/Gateway - API网关
+
+
    +
  • 路由配置
  • +
  • 过滤器机制
  • +
  • 权限控制
  • +
  • 限流策略
  • +
  • 性能对比
  • +
+ 开始学习 +
+
+ +
+
Config - 分布式配置
+
+
    +
  • Git仓库配置
  • +
  • 配置加密
  • +
  • 动态刷新
  • +
  • 高可用配置
  • +
  • 与Bus集成
  • +
+ 开始学习 +
+
+ +
+
Sleuth/Zipkin - 链路追踪
+
+
    +
  • TraceID传播
  • +
  • Span记录
  • +
  • Zipkin集成
  • +
  • 性能分析
  • +
  • 日志关联
  • +
+ 开始学习 +
+
+ +
+
Security - 安全控制
+
+
    +
  • OAuth2集成
  • +
  • JWT支持
  • +
  • 权限控制
  • +
  • 单点登录
  • +
  • 微服务安全
  • +
+ 开始学习 +
+
+
+
+ +
+
+

实践项目

+
+ +
+

通过实际项目整合所有SpringCloud组件,构建完整的微服务架构解决方案

+ 查看项目案例 +
+
+
+
+ + + + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/400.html b/cloud-demo/services/service-product/src/main/resources/static/error/400.html new file mode 100644 index 0000000..fc1e212 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/400.html @@ -0,0 +1,69 @@ + + + + + 400 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 400 - Bad Request

+
+
错误说明:因为错误的语法导致服务器无法理解请求信息。
+
原因1:客户端发起的请求不符合服务器对请求的某些限制,或者请求本身存在一定的错误。
+
解决办法:
+
链接中有特殊字符或者链接长度过长导致,请对应修改.
+
原因2:request header 或者 cookie 过大所引起
+
解决办法:
+
crtl+shift+delete 快捷键清除cookie.
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/403.html b/cloud-demo/services/service-product/src/main/resources/static/error/403.html new file mode 100644 index 0000000..6c281b0 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/403.html @@ -0,0 +1,69 @@ + + + + + 403 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

403 - Forbidden 禁止访问: 访问被拒绝

+
+
错误说明:禁止访问,服务器拒绝访问
+
原因1:未找到默认的索引文件
+
解决办法:
+
IIS中【启用默认内容文档】选项中将默认打开文档修改为程序首页文件格式,如:index.html或者index.php
+
原因2:文件夹安全权限导致
+
解决办法:
+
程序文件-右击-属性-安全-Users-修改为读取和执行权限
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/404.html b/cloud-demo/services/service-product/src/main/resources/static/error/404.html new file mode 100644 index 0000000..6cc5d1e --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/404.html @@ -0,0 +1,78 @@ + + + + + 404 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

404 - Page Not Found 未找到

+
+
错误说明:请求的页面不存在
+
原因1:访问的文档权限不够
+
解决办法:
+
修改文件权限为755,windos系统修改目录权限为可写可读。
+
原因2:防火墙的原因
+
解决办法:
+
先关闭让防火墙通过WWW服务。
+
原因3:站点根目录无默认访问文件
+
解决办法:
+
在根目录中创建index.html或者创建index.php。
+
原因4:站点配置目录不正确
+
解决办法:
+
将网站应用程序复制到站点目录中,或者修改站点配置目录指定到应用程序目录中。
+
原因5:站点使用了伪静态
+
解决办法:
+
将伪静态规则删除,或者重新编写正确的伪静态规则,或关闭伪静态配置。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/500.html b/cloud-demo/services/service-product/src/main/resources/static/error/500.html new file mode 100644 index 0000000..6071bf4 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/500.html @@ -0,0 +1,64 @@ + + + + + 500 - 服务器错误 + + + + +
+

:'(

+

服务器开小差啦!管理员正在修理中...

+

还请阁下静候站点恢复~

+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/501.html b/cloud-demo/services/service-product/src/main/resources/static/error/501.html new file mode 100644 index 0000000..48ac544 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/501.html @@ -0,0 +1,66 @@ + + + + + 501 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 501 - Not Implemented

+
+
错误说明:服务器没有相应的执行动作来完成当前请求。
+
原因1:Web 服务器不支持实现此请求所需的功能
+
解决办法:
+
可以用来HttpWebRequest指定一个UserAgent来试试的,有时候你可以换电脑来测试一下的。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/502.html b/cloud-demo/services/service-product/src/main/resources/static/error/502.html new file mode 100644 index 0000000..ea44be2 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/502.html @@ -0,0 +1,80 @@ + + + + + 502 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 502 - Bad Gateway 没有响应

+
+
错误说明:坏的网关,http向后端节点请求,没有响应
+
原因1:DNS 缓冲
+
解决办法:
+
在dos窗口运行 ipconfig /flushdns,该命令会刷新DNS缓冲。
+
原因2:浏览器代理
+
解决办法:
+
关掉代理。
+
原因3:dns 被劫持了,即使使用国外的dns,也会被劫持
+
解决办法:
+
+ 去掉VPN服务器的DNS。切换另外的dns。在windows系统中,可以在本地网络连接的属性中,去掉默认的dns,选用国外的dns,比如google的或opendns。 +
+
原因4:php执行超时
+
解决办法:
+
修改/usr/local/php/etc/php.ini 将max_execution_time 改为300。
+
原因5:nginx等待时间超时
+
解决办法:
+
适当增加nginx.conf配置文件中FastCGI的timeout时间。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/503.html b/cloud-demo/services/service-product/src/main/resources/static/error/503.html new file mode 100644 index 0000000..c6fec86 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/503.html @@ -0,0 +1,69 @@ + + + + + 503 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 503 - Service Unavailable 服务不可用

+
+
错误说明:服务当前不可用
+
原因1:服务不可用状态
+
解决办法:
+
服务器或许就是正在维护或者暂停了,你可以联系一下服务器空间商。
+
原因2:程序占用资源太多
+
解决办法:
+
通过设置应用程序池把账户改为NetworkService即可解决。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/504.html b/cloud-demo/services/service-product/src/main/resources/static/error/504.html new file mode 100644 index 0000000..2980dd0 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/504.html @@ -0,0 +1,81 @@ + + + + + 504 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 504 - Gateway Timeout 网关超时

+
+
错误说明:网关超时,服务器响应时间,达到超出设定的范围
+
原因1:后端电脑之间 IP 通讯缓慢而产生
+
解决办法:
+
如果您的 Web 服务器由某一网站托管, 只有负责那个网站设置的人员才能解决这个问题。
+
原因2:由于nginx默认的fastcgi进程响应的缓冲区太小造成的错误
+
解决办法:
+
一般默认的fastcgi进程响应的缓冲区是8K,这时可以设置大一点,在nginx.conf里,加入:fastcgi_buffers 8 + 128k这表示设置fastcgi缓冲区为8块128k大小的空间。当然如果在进行某一项即时的操作, 可能需要nginx的超时参数调大点, + 例如设置成60秒:send_timeout 60;经过这两个参数的调整,一般不会再提示“504 Gateway Time-out”错误,问题基本解决。 +
+
原因3:PHP环境的配置问题
+
解决办法:
+
更改php-fpm的几处配置: 把max_children由之前的10改为现在的30,这样就可以保证有充足的php-cgi进程可以被使用; + 把request_terminate_timeout由之前的0s改为60s,这样php-cgi进程 处理脚本的超时时间就是60秒,可以防止进程都被挂起,提高利用效率。 + 接着再更改nginx的几个配置项,减少FastCGI的请求次数,尽量维持buffers不变: fastcgi_buffers由 4 64k 改为 2 + 256k; fastcgi_buffer_size 由 64k 改为 128K; fastcgi_busy_buffers_size 由 128K 改为 256K; + fastcgi_temp_file_write_size 由 128K 改为 256K。 重新加载php-fpm和nginx的配置,再次测试,如果没有出现“504 + Gateway Time-out”错误,问题解决。 +
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/505.html b/cloud-demo/services/service-product/src/main/resources/static/error/505.html new file mode 100644 index 0000000..1cd5dd5 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/505.html @@ -0,0 +1,72 @@ + + + + + 505 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 505 - HTTP Version Not Supported

+
+
错误说明:HTTP 版本不受支持。
+
原因1:您的 Web 服务器不支持,或拒绝支持客户端(如您的浏览器)在发送给服务器的 HTTP 请求数据流中指定的 HTTP + 协议版本 +
+
解决办法:
+
升级您的 Web 服务器软件。
+
原因2:http请求格式的错误
+
解决办法:
+
对照一下自己的代码,从打印的信息中终于找到问题所在。可能在请求后面多加了一个空格。http协议真是很严格了。 +
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/506.html b/cloud-demo/services/service-product/src/main/resources/static/error/506.html new file mode 100644 index 0000000..8160abd --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/506.html @@ -0,0 +1,66 @@ + + + + + 506 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 506 - Variant Also Negotiates

+
+
错误说明:
+
原因1:服务器存在内部配置错误
+
解决办法:
+
被请求的协商变元资源被配置为在透明内容协商中使用自己,因此在一个协商处理中不是一个合适的重点。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/507.html b/cloud-demo/services/service-product/src/main/resources/static/error/507.html new file mode 100644 index 0000000..fb6c7e7 --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/507.html @@ -0,0 +1,66 @@ + + + + + 507 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 507 - Insufficient Storage

+
+
错误说明:
+
原因1:服务器无法存储完成请求所必须的内容
+
解决办法:
+
这个状况被认为是临时的。WebDAV (RFC 4918)。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/509.html b/cloud-demo/services/service-product/src/main/resources/static/error/509.html new file mode 100644 index 0000000..520abbd --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/509.html @@ -0,0 +1,66 @@ + + + + + 509 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 509 - Bandwidth Limit Exceeded

+
+
错误说明:
+
原因1:网站流量已经超出您所购买的方案限制即服务器达到带宽限制
+
解决办法:
+
1.升级方案 2.等到下个月后流量重新计算,网站即可正常浏览。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/error/510.html b/cloud-demo/services/service-product/src/main/resources/static/error/510.html new file mode 100644 index 0000000..95b2f9f --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/static/error/510.html @@ -0,0 +1,66 @@ + + + + + 510 错误 - phpstudy + + + + + + + + + + + + + + + +
+
+

HTTP 510 - Not Extended

+
+
错误说明:
+
原因1:获取资源所需要的策略并没有被满足
+
解决办法:
+
需要请求有额外的扩展内容,服务器才能处理请求。
+
+
+
+ + \ No newline at end of file diff --git a/cloud-demo/services/service-product/src/main/resources/static/favicon.ico b/cloud-demo/services/service-product/src/main/resources/static/favicon.ico new file mode 100644 index 0000000..385f8a6 Binary files /dev/null and b/cloud-demo/services/service-product/src/main/resources/static/favicon.ico differ diff --git a/cloud-demo/services/service-product/src/main/resources/templates/index.html b/cloud-demo/services/service-product/src/main/resources/templates/index.html new file mode 100644 index 0000000..5b8e04a --- /dev/null +++ b/cloud-demo/services/service-product/src/main/resources/templates/index.html @@ -0,0 +1,420 @@ + + + + + + SpringCloud微服务复习教程 + + + + +
+
+

SpringCloud微服务复习教程

+

掌握微服务架构的核心概念与实践,从服务注册发现到分布式配置,全面复习SpringCloud生态系统的关键组件

+
+
+ +
+
+
+
+
📚
+

系统化学习

+

从基础到高级,循序渐进掌握SpringCloud所有核心组件

+
+
+
💡
+

实战案例

+

通过实际项目案例,理解微服务架构的设计与实现

+
+
+
🔧
+

最佳实践

+

学习行业内的微服务最佳实践和常见问题解决方案

+
+
+ +
+
+

核心组件教程

+
+ +
+
+
Eureka - 服务注册与发现
+
+
    +
  • 服务注册中心原理
  • +
  • 服务提供者注册
  • +
  • 服务消费者发现
  • +
  • 高可用Eureka集群
  • +
  • 自我保护机制
  • +
+ 开始学习 +
+
+ +
+
Ribbon - 客户端负载均衡
+
+
    +
  • 负载均衡策略
  • +
  • 自定义负载规则
  • +
  • 与Eureka集成
  • +
  • 重试机制
  • +
  • 性能调优
  • +
+ 开始学习 +
+
+ +
+
Feign - 声明式服务调用
+
+
    +
  • 接口式编程
  • +
  • 请求参数处理
  • +
  • 错误处理
  • +
  • 日志配置
  • +
  • 性能优化
  • +
+ 开始学习 +
+
+ +
+
Hystrix - 服务熔断
+
+
    +
  • 服务降级
  • +
  • 熔断机制
  • +
  • 请求缓存
  • +
  • 请求合并
  • +
  • Dashboard监控
  • +
+ 开始学习 +
+
+ +
+
Zuul/Gateway - API网关
+
+
    +
  • 路由配置
  • +
  • 过滤器机制
  • +
  • 权限控制
  • +
  • 限流策略
  • +
  • 性能对比
  • +
+ 开始学习 +
+
+ +
+
Config - 分布式配置
+
+
    +
  • Git仓库配置
  • +
  • 配置加密
  • +
  • 动态刷新
  • +
  • 高可用配置
  • +
  • 与Bus集成
  • +
+ 开始学习 +
+
+ +
+
Sleuth/Zipkin - 链路追踪
+
+
    +
  • TraceID传播
  • +
  • Span记录
  • +
  • Zipkin集成
  • +
  • 性能分析
  • +
  • 日志关联
  • +
+ 开始学习 +
+
+ +
+
Security - 安全控制
+
+
    +
  • OAuth2集成
  • +
  • JWT支持
  • +
  • 权限控制
  • +
  • 单点登录
  • +
  • 微服务安全
  • +
+ 开始学习 +
+
+
+
+ +
+
+

实践项目

+
+ +
+

通过实际项目整合所有SpringCloud组件,构建完整的微服务架构解决方案

+ 查看项目案例 +
+
+
+
+ + + + \ No newline at end of file