目录结构

编译后会有:conf html logs sbin 四个文件 (其他两个是之前下载的安装包)

  • conf:配置文件
  • html:页面资源
  • logs:日志
  • sbin:启动文件,nginx主程序

运行后多了文件<font style="color:rgb(51,51,51);">client_body_temp fastcgi_temp proxy_temp scgi_temp</font>

这些都是临时文件,可忽略

运行原理


master主进程:

Worker为子进程

nginx配置基础

  1. 基础配置
# 工作worker子进程(小于cpu数:并行 -- 大于CPU数:并发)
worker_processes  1;# worker的最大连接
events {worker_connections  1024;
}http {# include:引入其他配置文件# mime.types:请求头(发送类型)# default_type:默认发送类型include       mime.types;default_type  application/octet-stream;# 数据零拷贝sendfile        on;# 长连接 时间keepalive_timeout  65;# 虚拟主机vhost(nginx可配置多个主机)server {# nginx端口号listen       80;# 主机名server_name  localhost;# http://localhost:80/【localtion中的uri】location / {root   html;index  index.html index.htm;}# 服务器端发生错误的时候,转到/50x.html地址页面# 转到/50x.html的时候后,会在html文件夹中,寻找50x.html页面error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}
}
  • <font style="color:rgb(38, 38, 38);background-color:rgb(245, 245, 245);">mime.types</font>请求头类型
types {text/html                                        html htm shtml;text/css                                         css;text/xml                                         xml;image/gif                                        gif;image/jpeg                                       jpeg jpg;application/javascript                           js;application/atom+xml                             atom;application/rss+xml                              rss;text/mathml                                      mml;text/plain                                       txt;text/vnd.sun.j2me.app-descriptor                 jad;text/vnd.wap.wml                                 wml;text/x-component                                 htc;image/avif                                       avif;image/png                                        png;image/svg+xml                                    svg svgz;image/tiff                                       tif tiff;image/vnd.wap.wbmp                               wbmp;image/webp                                       webp;image/x-icon                                     ico;image/x-jng                                      jng;image/x-ms-bmp                                   bmp;font/woff                                        woff;font/woff2                                       woff2;application/java-archive                         jar war ear;application/json                                 json;application/mac-binhex40                         hqx;application/msword                               doc;application/pdf                                  pdf;application/postscript                           ps eps ai;application/rtf                                  rtf;application/vnd.apple.mpegurl                    m3u8;application/vnd.google-earth.kml+xml             kml;application/vnd.google-earth.kmz                 kmz;application/vnd.ms-excel                         xls;application/vnd.ms-fontobject                    eot;application/vnd.ms-powerpoint                    ppt;application/vnd.oasis.opendocument.graphics      odg;application/vnd.oasis.opendocument.presentation  odp;application/vnd.oasis.opendocument.spreadsheet   ods;application/vnd.oasis.opendocument.text          odt;application/vnd.openxmlformats-officedocument.presentationml.presentationpptx;application/vnd.openxmlformats-officedocument.spreadsheetml.sheetxlsx;application/vnd.openxmlformats-officedocument.wordprocessingml.documentdocx;application/vnd.wap.wmlc                         wmlc;application/wasm                                 wasm;application/x-7z-compressed                      7z;application/x-cocoa                              cco;application/x-java-archive-diff                  jardiff;application/x-java-jnlp-file                     jnlp;application/x-makeself                           run;application/x-perl                               pl pm;application/x-pilot                              prc pdb;application/x-rar-compressed                     rar;application/x-redhat-package-manager             rpm;application/x-sea                                sea;application/x-shockwave-flash                    swf;application/x-stuffit                            sit;application/x-tcl                                tcl tk;application/x-x509-ca-cert                       der pem crt;application/x-xpinstall                          xpi;application/xhtml+xml                            xhtml;application/xspf+xml                             xspf;application/zip                                  zip;application/octet-stream                         bin exe dll;application/octet-stream                         deb;application/octet-stream                         dmg;application/octet-stream                         iso img;application/octet-stream                         msi msp msm;audio/midi                                       mid midi kar;audio/mpeg                                       mp3;audio/ogg                                        ogg;audio/x-m4a                                      m4a;audio/x-realaudio                                ra;video/3gpp                                       3gpp 3gp;video/mp2t                                       ts;video/mp4                                        mp4;video/mpeg                                       mpeg mpg;video/quicktime                                  mov;video/webm                                       webm;video/x-flv                                      flv;video/x-m4v                                      m4v;video/x-mng                                      mng;video/x-ms-asf                                   asx asf;video/x-ms-wmv                                   wmv;video/x-msvideo                                  avi;
}
  • 开启数据零拷贝工作比较

没开启sendfile:nginx读取到html,然后存入缓存,接着将缓存内容发给网络接口,网络接口发送给互联网

开启sendfile:nginx不缓存html了,直接给网络接口发送信号,让网络接口直接来读取html,然后发送到互联网

  • 全部配置
#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   html;index  index.html index.htm;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  somename  alias  another.alias;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}

虚拟主机配置

域名配置

将域名绑定ip

不同端口访问不同资源

worker_processes  1;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;sendfile        on;keepalive_timeout  65;server {listen       80;server_name  localhost;location / {root   /www/video;index  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}server {listen       81;server_name  localhost;location / {root   /www/www;index  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}}

不同域名访问同一资源

匹配

不同的域名,都会匹配到80端口

    server {listen       80;server_name  www.xingheng.cn a.xingheng.cn;location / {root   /www/video;index  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}
匹配规则
  1. 通配符匹配
server_name *.mmban.com
  1. 通配符结束匹配
server_name vod.*;
  1. 正则匹配
server_name ~^[0-9]+\.mmban\.com$;

反向代理

正向代理与反向代理

画板

主要区别在于这两种方式的作用不同,他们的本质其实是一样的(请求转发),代理代理,就是代替某个东西去做什么

  • 一个是代理客户端,就是代理用户,去访问外网服务器
  • 一个是代理服务器,就是代理服务器,让用户可以访问

代理规则

proxy_pass:代理路径 – 有了proxy_pass就不会访问root /www/video; index index.html index.html;

location / {root   /www/video;index  index.html index.htm;proxy_pass http://xingheng.com/;
}

基于反向代理的负载均衡

使用
# httpd是负载均衡组的名字,可自定义
upstream httpd {server 192.168.44.102:80;server 192.168.43.103:80;
}location / {root   /www/video;index  index.html index.htm;proxy_pass http://httpd  # 有这个上面的静态资源就不访问了}
常用策略
upstream httpd {server 127.0.0.1:8050 weight=10 down;server 127.0.0.1:8060 weight=1;server 127.0.0.1:8060 weight=1 backup;
}
  • weight:默认为1 weight越大,负载的权重就越大。
  • down:表示当前的server暂时不参与负载
  • backup: 其它所有的非backup机器down或者忙的时候,请求backup机器。(备用服务器)
了解策略
  • ip_hash:根据客户端的ip地址转发同一台服务器,可以保持回话。
  • least_conn:最少连接访问
  • url_hash:根据用户访问的url定向转发请求
  • fair:根据后端服务器响应时间转发请求

动静分离

location配置静态资源

server {listen       80;server_name  localhost;# / 的匹配优先级最低location / {proxy_pass http://127.0.0.1:8080;}# 匹配路径是/js的路径location /js {root   htmlindex  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}
}

路径匹配规则

location前缀规则

/ 通用匹配,任何请求都会匹配到。

= 精准匹配,不是以指定模式开头

~ 正则匹配,区分大小写

~* 正则匹配,不区分大小写

^~ 非正则匹配,匹配以指定模式开头的location

location匹配顺序
  1. 多个正则location直接按书写顺序匹配,成功后就不会继续往后面匹配
  2. 普通(非正则)location会一直往下,直到找到匹配度最高的(最大前缀匹配)
  3. 当普通location与正则location同时存在,如果正则匹配成功,则不会再执行普通匹配
  4. 所有类型location存在时,“=”匹配 > “^~”匹配 > 正则匹配 > 普通(最大前缀匹配)
location ~*/(css|img|js) {root /usr/local/nginx/static;index index.html index.htm;
}
alias与root
location /css/ {alias /usr/local/nginx/static/css/;index index.html index.htm;
}
location /css {alias /usr/local/nginx/static;index index.html index.htm;
}

alias和root指令功能类似,都是指定访问的资源,不过配置上有些区别:

  1. **root**** 是“加在 URI 前面的前缀”
    **alias**
    **是“把整个 location 路径替换掉”
  2. **root**** 通常用于匹配路径不变的情况
    **alias**
    **用于重写某段 URL 到另一路径
  3. **root**/不敏感
    **alias**的路径末尾最好加 /,否则容易匹配失败
    例如:代码中的代码路径,现在要访问/css/style.css
    root是直接拼接/usr/local/nginx/static + /css/style.css
    alias是裁剪/css/style.css 匹配,裁剪location后的路径/css/,变为style.css,然后将style.css拼接到/usr/local/nginx/static/css/后面

UrlRewrite

入门案例

location / {rewrite ^/xingheng/(.*)$ /index.jsp?pageName=$1 break;proxy_pass http://127.0.0.1:8080;
}

如果访问呢的路径匹配到了/xingheng,那么就转向访问http://127.0.0.1:8080/index.jsp?pageName=?路径

也就是说,如果匹配到了rewirte终点额正则表达式,那么就会讲后面的路径拼接到proxy_pass中设置的路径后面

规则

rewrite是实现URL重写的关键指令,根据regex (正则表达式)部分内容,重定向到replacement,结尾是flag标记。

格式:

rewrite <regex> <replacement> [flag];

关键字:正则(regex) 替代内容(replacement) flag标记

关键字:其中关键字error_log不能改变

  • 正则:perl兼容正则表达式语句进行规则匹配
  • 替代内容:将正则匹配的内容替换成replacement
  • flag标记:rewrite支持的flag标记

rewrite参数的标签段位置: <font style="color:rgb(51,51,51);">server,location,if </font>

flag标记说明:

  • last :本条规则匹配完成后,继续向下匹配新的location URI规则
  • break :本条规则匹配完成即终止,不再匹配后面的任何规则
  • redirect :返回302临时重定向,浏览器地址会显示跳转后的URL地址(就是真实地址会带出来)
  • permanent :返回301永久重定向,浏览器地址栏会显示跳转后的URL地址

防盗链

防盗链概念

  1. 所谓盗链,就是别人直接在他们的网站上引用你网站的资源,比如这样:
<img src="http://yourdomain.com/images/logo.png">

这样一来,对方的网页访问者会去访问你的服务器资源,消耗你的带宽资源,却不给你任何访问量或广告收益,所以我们需要防盗链

  1. referer

假设你在 https://a.com/index.html 这个页面上,有一张图片:

<img src="https://b.com/images/logo.png">

当用户访问 a.com/index.html 页面时,浏览器会自动去加载图片,这个时候对 b.com/images/logo.png 的请求里,HTTP 请求头中会自动带上:

Referer: https://a.com/index.html

也就是说,服务器 **b.com** 可以知道:访问这张图的是从 **a.com** 页面跳过来的。

那么什么时候没有refer呢?直接在浏览器顶部地址输入对应的地址访问就没有referer啦

配置防盗链

  1. 配置案例
valid_referers 192.168.44.101;
if ($invalid_referer) {return 403;
}
  1. 详细规则
valid_referers none | blocked | server_names | strings ....;
- `**<font style="color:#DF2A3F;">none</font>**`<font style="color:rgb(51,51,51);">, 检测 Referer 头域不存在的情况,如果不存在,那么就可以访问(即使是本网站访问也不行)</font>
- `<font style="color:rgb(51,51,51);">blocked</font>`<font style="color:rgb(51,51,51);">,检测 Referer 头域的值被防火墙或者代理服务器删除或伪装的情况。这种情况该头域的值不以 “http://” 或 “https://” 开头。 </font>
- `<font style="color:rgb(51,51,51);">server_names</font>`<font style="color:rgb(51,51,51);"> ,设置一个或多个 URL ,检测 Referer 头域的值是否是这些 URL 中的某一个。</font>

使用curl测试

安装
yum install -y curl
常用命令
  1. 看某个地址能否访问
curl -I http://192.168.44.101/img/logo.png
  1. 带referer
# http://baidu.com就是refer
curl -e "http://baidu.com" -I http://192.168.44.101/img/logo.png

高可用配置

keepalive高可用原理

画板

keepalive安装

yum install -y keepalived

keepalive配置

  1. 打开文件
# 打开keeplived.conf
cd /etc/keepalived
vi keepalived.conf
  1. 配置文件

第一台机器

! Configuration File for keepalivedglobal_defs {router_id lb111
}vrrp_instance VI_1 {# 当前机器是masterstate MASTER# 网卡名称(改)interface enp0s5virtual_router_id 51# 优先级,竞选成功的优先级priority 100# 间隔检测时间advert_int 1# 多个keepalived通信配置(相同即可)authentication {auth_type PASSauth_pass 1111}# 虚拟地址(改)virtual_ipaddress {192.168.33.200}
}

注:interface需要改成自己的网卡地址,通过ip addr获取

第二台机器

! Configuration File for keepalivedglobal_defs {router_id lb111
}vrrp_instance VI_1 {# 当前机器是backupstate BACKUP# 网卡名称interface enp0s5virtual_router_id 51# 优先级,竞选成功的优先级priority 100# 间隔检测时间advert_int 1# 多个keepalived通信配置(相同即可)authentication {auth_type PASSauth_pass 1111}# 虚拟地址virtual_ipaddress {192.168.33.200}
}
  1. 启动服务
systemctl start keepalived

查看状态:

systemctl status keepalived

查看现有ip:

! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.locfailover@firewall.locsysadmin@firewall.loc}notification_email_from Alexandre.Cassen@firewall.locsmtp_server 192.168.200.1smtp_connect_timeout 30router_id LVS_DEVELvrrp_skip_check_adv_addrvrrp_strictvrrp_garp_interval 0vrrp_gna_interval 0
}vrrp_instance VI_1 {state MASTERinterface eth0virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.200.16192.168.200.17192.168.200.18}
}virtual_server 192.168.200.100 443 {delay_loop 6lb_algo rrlb_kind NATpersistence_timeout 50protocol TCPreal_server 192.168.201.100 443 {weight 1SSL_GET {url {path /digest ff20ad2481f97b1754ef3e12ecd3a9cc}url {path /mrtg/digest 9b3a0c85a887a256d6939da88aabd8cd}connect_timeout 3retry 3delay_before_retry 3}}
}virtual_server 10.10.10.2 1358 {delay_loop 6lb_algo rrlb_kind NATpersistence_timeout 50protocol TCPsorry_server 192.168.200.200 1358real_server 192.168.200.2 1358 {weight 1HTTP_GET {url {path /testurl/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl2/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl3/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}connect_timeout 3retry 3delay_before_retry 3}}real_server 192.168.200.3 1358 {weight 1HTTP_GET {url {path /testurl/test.jspdigest 640205b7b0fc66c1ea91c463fac6334c}url {path /testurl2/test.jspdigest 640205b7b0fc66c1ea91c463fac6334c}connect_timeout 3retry 3delay_before_retry 3}}
}virtual_server 10.10.10.3 1358 {delay_loop 3lb_algo rrlb_kind NATpersistence_timeout 50protocol TCPreal_server 192.168.200.4 1358 {weight 1HTTP_GET {url {path /testurl/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl2/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl3/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}connect_timeout 3retry 3delay_before_retry 3}}real_server 192.168.200.5 1358 {weight 1HTTP_GET {url {path /testurl/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl2/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}url {path /testurl3/test.jspdigest 640205b7b0fc66c1ea91c463fac6334d}connect_timeout 3retry 3delay_before_retry 3}}
}

Https证书配置

server
{listen 443 ssl http2 ;server_name www.xinghengdati.cn;ssl_certificate    /www/server/panel/vhost/cert/www.xinghengdati.cn/fullchain.pem;ssl_certificate_key    /www/server/panel/vhost/cert/www.xinghengdati.cn/privkey.pem;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/diannao/89384.shtml
繁体地址,请注明出处:http://hk.pswp.cn/diannao/89384.shtml
英文地址,请注明出处:http://en.pswp.cn/diannao/89384.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于大众点评的重庆火锅在线评论数据挖掘分析(情感分析、主题分析、EDA探索性数据分析)

文章目录 有需要本项目的代码或文档以及全部资源&#xff0c;或者部署调试可以私信博主项目介绍数据采集数据预处理EDA探索性数据分析关键词提取算法情感分析LDA主题分析总结每文一语 有需要本项目的代码或文档以及全部资源&#xff0c;或者部署调试可以私信博主 项目介绍 本…

鸿蒙系统(HarmonyOS)应用开发之经典蓝色风格登录页布局、图文验证码

一、项目概述 本项目是一款基于鸿蒙 ArkTS&#xff08;ETS&#xff09;开发的用户登录页面&#xff0c;集成了图文验证码功能&#xff0c;旨在为应用提供安全、便捷的用户身份验证入口。项目采用现代化 UI 设计&#xff0c;兼顾用户体验与安全性&#xff0c;适用于多种需要用户…

0.96寸OLED显示屏 江协科技学习笔记(36个知识点)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 32 33 34 35 36

Flutter SnackBar 控件详细介绍

文章目录 Flutter SnackBar 控件详细介绍基本特性基本用法1. 显示简单 SnackBar2. 自定义持续时间 主要属性高级用法1. 带操作的 SnackBar2. 自定义样式3. 浮动式 SnackBar SnackBarAction 属性实际应用场景注意事项完整示例建议 Flutter SnackBar 控件详细介绍 SnackBar 是 F…

【C++】头文件的能力与禁忌

在C中&#xff0c;​头文件&#xff08;.h/.hpp&#xff09;​​ 的主要作用是声明接口和共享代码&#xff0c;但如果不规范使用&#xff0c;会导致编译或链接错误。以下是详细总结&#xff1a; 一、头文件中可以做的事情 1.1 声明 函数声明&#xff08;无需inline&#xff…

腾讯 iOA 零信任产品:安全远程访问的革新者

在当今数字化时代&#xff0c;企业面临着前所未有的挑战与机遇。随着远程办公、多分支运营以及云计算的广泛应用&#xff0c;传统的网络安全架构逐渐暴露出诸多不足。腾讯 iOA 零信任产品凭借其创新的安全理念和强大的功能特性&#xff0c;为企业提供了一种全新的解决方案&…

IP5219全集成Type-C移动电源SOC!2.1A快充+2.4A放电,极简BOM方案

产品概述&#xff1a; IP5219是一款集成升压转换器、锂电池充电管 理、电池电量指示和TYPE_C协议的多功能电源管 理SOC&#xff0c;为移动电源提供完整的电源解决方案。 IP5219的高集成度与丰富功能&#xff0c;使其在应用时 仅需极少的外围器件&#xff0c;并有效减小整体方案…

报道称CoreWeave洽谈收购Core Scientific,后者涨超30%

CoreWeave与数字基础设施公司Core Scientific的收购事宜可能在未来几周内敲定交易&#xff0c;前提是双方不出现重大分歧。消息传出后&#xff0c;Core Scientific股价一度暂停交易&#xff0c;随后恢复交易最终收涨逾32%。 AI云服务巨头CoreWeave正与数字基础设施公司Core Sc…

Qt5.15.2实现WebAssembly:2、设置emsdk目录

步骤1 打开QT&#xff0c;编辑&#xff0c;Preference&#xff08;首选项&#xff09;&#xff1a; 设备&#xff0c;WebAssembly&#xff0c;游览。 找到安装好的emscripten目录&#xff0c;选择。 稍等一会&#xff0c;QT会解析出相应的信息&#xff0c;再点确定。 图中…

SpringMVC--使用RESTFul实现用户管理系统

一、静态页面准备 1. user.css .header {background-color: #f2f2f2;padding: 20px;text-align: center; }ul {list-style-type: none;margin: 0;padding: 0;overflow: hidden;background-color: #333; }li {float: left; }li a {display: block;color: white;text-align: ce…

hello算法_C++_ 最差、最佳、平均时间复杂度

算法的时间效率往往不是固定的&#xff0c;而是与输入数据的分布有关。假设输入一个长度为 的数组 nums &#xff0c;其中 nums 由从 1 至 n 的数字组成&#xff0c;每个数字只出现一次&#xff1b;但元素顺序是随机打乱的&#xff0c;任务目标是返回元素 的索引。我们可以…

2024考研数一真题及答案

历年数一真题及答案下载直通车 已知函数 f ( x ) ∫ 0 x e cos ⁡ t d t f(x) \int_0^x e^{\cos t} dt f(x)∫0x​ecostdt&#xff0c; g ( x ) ∫ 0 sin ⁡ x e t 2 d t g(x) \int_0^{\sin x} e^{t^2} dt g(x)∫0sinx​et2dt&#xff0c;则&#xff08; &#xff09;。 A…

MIT 6.824学习心得(2) 浅谈多线程和RPC

上篇文章中我们简单介绍了分布式系统的设计思想以及简单性质&#xff0c;之后用一定篇幅简要介绍了MapReduce这个经典的分布式计算框架的大致工作原理&#xff0c;相信朋友们已经对此有了最基本的理解。在现实场景中&#xff0c;分布式系统的设计初衷是为了解决并发问题&#x…

opensuse/debian grub启动界面太模糊?

现代操作系统或者新电脑使用那么模糊的界面启动&#xff0c;虽然没有什么不良反应&#xff0c;但是多少有点看不过去&#xff0c;这是因为为了保证正常启动做出的适配。而我们可以对其分辨率进行选定。 1 您好&#xff0c;非常感谢您提供的截图。这张图片非常关键&#xff0c…

zookeeper Curator(5):集群架构和集群搭建

文章目录 一、集群架构&#xff1a;Leader-Follower 模式二、核心机制&#xff1a;ZAB 协议三、Leader 选举机制四、集群部署要点五、优势与挑战 Zookeeper 集群是一个由多个 Zookeeper 服务实例组成的分布式协调服务系统&#xff0c; 通过奇数个节点&#xff08;通常 3、5、7…

道可云人工智能每日资讯|浦东启动人工智能创新应用竞赛

道可云人工智能&元宇宙每日简报&#xff08;2025年7月1日&#xff09;讯&#xff0c;今日人工智能&元宇宙新鲜事有&#xff1a; 江城模境工信部人工智能大模型公共服务平台&#xff08;武汉&#xff09;上线运行 2025年6月27日&#xff0c;光谷人工智能创新大会在湖北…

Python元组的遍历

一、前言 在 Python 中&#xff0c;元组&#xff08;tuple&#xff09; 是一种非常基础且常用的数据结构&#xff0c;它与列表类似&#xff0c;都是有序的序列&#xff0c;但不同的是&#xff0c;元组是不可变的&#xff08;immutable&#xff09;&#xff0c;一旦创建就不能修…

矩阵的条件数(Condition Number of a Matrix)

文章目录 矩阵的条件数&#xff08;Condition Number of a Matrix&#xff09;&#x1f4cc; 定义&#x1f9ee; 常见形式&#xff1a;2-范数下的条件数&#x1f50d; 条件数的意义&#x1f9e0; 实际意义举例&#x1f4bb; Python 示例&#xff08;NumPy&#xff09;&#x1f…

1 Studying《Computer Architecture A Quantitative Approach》1-4

目录 Preface 1 Fundamentals of Quantitative Design and Analysis 1.1 Introduction 1.2 Classes of Computers 1.3 Defining Computer Architecture 1.4 Trends in Technology 1.5 Trends in Power and Energy in Integrated Circuits 1.6 Trends in Cost 1.7 Depe…

Reactor Hot Versus Cold

这段文字详细解释了 Reactor 中 热发布者&#xff08;Hot Publisher&#xff09; 和 冷发布者&#xff08;Cold Publisher&#xff09; 的区别&#xff0c;并通过示例展示了它们的行为差异。以下是对其含义的总结和解释&#xff1a; 1. 冷发布者&#xff08;Cold Publisher&…