【Linux】安装使用Nginx负载均衡,并且部署前端项目

目录

一、Nginx概述

1. 什么

2. 背景

3. 作用

二、Nginx负载均衡

1. 讲述

2. 使用

1. 下载 

2. 安装 

3. 负载均衡

三、前端部署

1. 准备

2. 部署


一、Nginx概述

1. 什么

Nginx是一个高性能的开源Web服务器和反向代理服务器。它具有轻量级、高并发、低内存消耗的特点,被广泛用于构建高性能的Web应用和服务。

Nginx最初是由俄罗斯的工程师Igor Sysoev开发的,于2004年首次发布。它的设计目标是解决C10k问题,即同时处理上万个并发连接的问题。相比传统的Web服务器(如Apache),Nginx采用了事件驱动和异步非阻塞的处理方式,能够更高效地处理大量的并发请求。

2. 背景

Nginx的背景可以追溯到2002年,当时俄罗斯的工程师Igor Sysoev开始开发这个项目。他当时是一家俄罗斯的在线广告公司的系统管理员,面临着处理大量并发连接的问题。他发现传统的Web服务器(如Apache)在处理大量并发连接时性能下降严重,无法满足需求。

为了解决这个问题,Sysoev开始着手开发一款高性能的Web服务器。他采用了事件驱动和异步非阻塞的处理方式,以及采用单线程模型来处理并发请求。这种设计使得Nginx能够高效地处理大量的并发连接,而无需为每个连接创建一个新的线程或进程。

在2004年,Nginx首次发布,并迅速获得了广泛的关注和使用。它的高性能、低内存消耗以及简单的配置语法使得它成为了很多网站和应用的首选。随着互联网的快速发展,Nginx逐渐成为了最受欢迎的Web服务器之一。

Nginx的成功也得益于其开源的特性,使得开发者可以自由地使用、修改和分发它。这促进了Nginx的快速发展和持续改进。如今,Nginx已经成为了全球最流行的Web服务器之一,被广泛应用于各种规模的网站、应用和服务中。

3. 作用

Nginx的主要功能包括:

  1. 静态文件服务:Nginx可以快速地处理静态文件的请求,通过将文件缓存到内存中,减少了对磁盘的访问,提高了响应速度。

  2. 反向代理:Nginx可以作为反向代理服务器,将客户端的请求转发给后端的多个服务器,实现负载均衡和高可用性。

  3. 动态内容处理:Nginx支持通过FastCGI、uWSGI和SCGI等协议与后端应用服务器(如PHP、Python、Java)进行通信,实现动态内容的处理和渲染。

  4. SSL/TLS加密:Nginx支持SSL/TLS协议,可以提供安全的HTTPS连接,保护数据的传输过程。

  5. 缓存:Nginx可以使用内置的缓存模块,将经常访问的内容缓存到内存中,减少对后端服务器的请求,提高性能。

  6. URL重写和重定向:Nginx提供了强大的URL重写和重定向功能,可以根据规则修改URL,实现URL的美化和重定向。

  7. 日志记录:Nginx可以记录访问日志和错误日志,方便进行故障排查和性能分析。

总之,Nginx是一个高性能、可扩展、灵活的Web服务器和反向代理服务器,适用于构建高性能的Web应用和服务。它的简单配置和高效处理能力使得它成为了很多大型网站和应用的首选。

二、Nginx负载均衡

1. 讲述

Nginx作为一个反向代理服务器,可以实现负载均衡,将客户端的请求分发给后端的多个服务器。下面是Nginx负载均衡的一般过程:

1. 客户端发送请求:客户端发送请求到Nginx服务器。

2. Nginx接收请求:Nginx服务器接收到客户端的请求。

3. 选择后端服务器:Nginx根据一定的负载均衡算法选择一个后端服务器来处理请求。常见的负载均衡算法有轮询(round robin)、IP哈希(ip_hash)、最少连接(least_conn)等。

4. 转发请求:Nginx将客户端的请求转发给选中的后端服务器。

5. 后端服务器处理请求:选中的后端服务器接收到请求后,处理请求并生成响应。

6. 响应返回给Nginx:后端服务器将处理完的响应返回给Nginx。

7. Nginx返回响应给客户端:Nginx将后端服务器返回的响应转发给客户端。

通过这个过程,Nginx可以将客户端的请求分发给多个后端服务器,实现负载均衡。这样可以提高系统的性能和可靠性,避免单个服务器的过载和故障对整个系统的影响。

需要注意的是,Nginx还可以进行健康检查,定期检查后端服务器的状态,如果发现某个服务器不可用或负载过高,会自动将请求转发给其他可用的服务器。这样可以进一步提高系统的可用性和稳定性。

2. 使用

打开虚拟机【Linux】-Centos,进行登入,并且使用MobaXterm进行连接。

如有不清楚可以看我博客 : 

【Linux】安装配置解决Centos&MobaXterm的使用及Linux常用命令&命令模式icon-default.png?t=N7T8https://blog.csdn.net/SAME_LOVE/article/details/134091961?spm=1001.2014.3001.5501

1. 下载 

输入命令 :  cd javaCloudJun/software  进入到资源文件目录

安装 Nginx 的4个依赖

输入命令 : yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

安装时需要稍等片刻。。。

 

安装完成后,下载Nginx 然后复制到虚拟机【Linux】-Centos中 

Nginx 官网icon-default.png?t=N7T8https://nginx.org/en/download.html之后进行解压使用 。

输入命令 :  tar -xvf nginx-1.13.7.tar.gz   ( 解压 Nginx)

解压后进入其文件

命令 :  cd nginx-1.13.7  

编译,执行配置: 考虑到后续安装ssl证书 添加两个模块

命令 : ./configure --with-http_stub_status_module --with-http_ssl_module

2. 安装 

之后进行安装

命令 :   make && make install

安装完后,进入该目录

输入命令 :  cd /usr/local/nginx

进入 /usr/local/nginx/sbin 目录下启动:

输入命令 :  cd sbin/

启动前安装 lsof 命令

输入命令 :  yum install -y  lsof

设置防火墙 开放 80 端口

输入命令 : firewall-cmd --zone=public --add-port=80/tcp --permanent

更新防火墙的端口并且查看已开放的端口

输入命令 :  firewall-cmd --reload && firewall-cmd --list-port

# 启动

命令 :  ./nginx

#查看 

命令 :  lsof -i:80

在浏览器中,输入虚拟机【Linux】-Centos的IP地址进行搜索

 

以上就是Nginx 的使用配置并且开启完成了。3. 

3. 负载均衡

在资源文件夹中,创建一个tomcat文件夹,来存放Tomcat

输入命令 :  mkdir tomcat

并且将tomcat服务解压到指定目录,刚刚创建的tomcat文件夹中。

输入命令 : tar -xvf apache-tomcat-8.5.tar.gz -C tomcat

进入tomcat文件夹中

命令 :  cd tomcat/

复制一个tomcat,准备2个tomcat

命令 : cp -r apache-tomcat-8.5.20/ apache-tomcat-8.5.20_8081/

查看命令 : ll

将其中的一个tomcat修改端口,避免两个服务同时开启时端口被占用的情况。

命令 :  cd apache-tomcat-8.5.20/conf   ( 进入到tomcat的conf文件中 )

找到server.xml 文件进行修改端口

命令 : vim server.xml   ( 编辑文件修改端口 )

修改后的所以代码 : 

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8006" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->
    <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
         This connector uses the APR/native implementation which always uses
         OpenSSL for TLS.
         Either JSSE or OpenSSL style configuration may be used. OpenSSL style
         configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                         certificateFile="conf/localhost-rsa-cert.pem"
                         certificateChainFile="conf/localhost-rsa-chain.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

注 : 将该服务器tomcat的所以端口都进行了修改,以免其他所有端口也有冲突。

并且将这个服务器的页面显示内容进行修改,访问时容易分辨是哪个tomcat端口进入的

 在tomcat根目录的webapps中的ROOT目录中,找到index.jsp文件,在MobaXterm工具的左边选中这个文件,右键点击第二个进行打开文件,并且修改编辑文件。

编辑后的所有内容如下  : 

 

<%--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<%@ page session="false" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy");
request.setAttribute("year", sdf.format(new java.util.Date()));
request.setAttribute("tomcatUrl", "http://tomcat.apache.org/");
request.setAttribute("tomcatDocUrl", "/docs/");
request.setAttribute("tomcatExamplesUrl", "/examples/");
%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title><%=request.getServletContext().getServerInfo() %></title>
        <link href="favicon.ico" rel="icon" type="image/x-icon" />
        <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <link href="tomcat.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
    <h1>8081</h1>
       
    </body>

</html>

返回到tomcat目录,并且开其两个服务(tomcat)

命令:  cd apache-tomcat-8.5.20/bin  ( 进入到tomcat的bin目录中 )

 命令:  ./startup.sh   ( 开启服务 )

再到 nginx的目录中

命令:  cd /usr/local/nginx

 

并且进入 : sbin目录

输入 :  cd sbin

命令 :  ./nginx -s reload   

注 : 重新开启nginx

 

之后在浏览器中访问,就有两个服务在运行用一个了

如图 : 

三、前端部署

1. 准备

前端项目打包之前需要增加以下的设置

在前端项目中 config文件下的index.js中要增加以下代码 : 

 assetsPublicPath: './',//修改后

如图: 

在前端项目中 build文件下的 utils.js 中增加以下代码 : 


 // 解决icon路径加载错误
        publicPath:'../../'

如图: 

在前端项目的跟目录中,cmd打开命令窗口

输入命令 : npm run build   ( 进行前端项目打包 )

如图 : 

命令执行后,会出现如图中以下文件  dist

在 /usr/local/ 目录下创建一个文件夹,为mypor ,并且进入文件夹,之后将dist文件拖入mypor文件夹中

并且选中zip解压的命令 :  yum install -y unzip

将该文件进行解压 

输入命令 : unzip dist.zip

2. 部署

输入命令 :  cd /usr/local/nginx/conf/    找到nginx.conf进行编辑

以下是所有代码 :  


#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;
    
    
        #服务器的集群
    upstream  tomcat_list {  #服务器集群名字
        server    127.0.0.1:8080  weight=1;   #服务器1   weight是权重的意思,权重越大,分配的概率越大。
        server    127.0.0.1:8081  weight=2;   #服务器2   weight是权重的意思,权重越大,分配的概率越大
    } 
    

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/local/mypro/dist;
            #proxy_pass   http://tomcat_list;
            index  index.html index.htm;
        }
        
       	location  ^~/api/ {
	       #^~/api/表示匹配前缀是api的请求,proxy_pass的结尾有/, 则会把/api/*后面的路径直接拼接到后面,即移除api
        proxy_pass http://tomcat_list/;
        }
        

        #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;
    #    }
    #}

}

输入命令 : cd /usr/local/nginx/sbin/   

 输入命令 :./nginx -s reload   重启nginx

在将后端的war包 传入tomcat服务器中。

并且输入命令 :   ./startup.sh    (开启访问)

在浏览器中进行访问 使用虚拟机的IP加tomcat的端口

在到文件资源管理器中进入到 以下本地目录

C:\Windows\System32\drivers\etc

找到 hosts 文件进行修改IP的请求

如图 : 

在进浏览器中进行访问 使用虚拟机的IP加tomcat的端口,即可。。

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Classifier-Free Guidance

1.为什么需要分类引导 顾名思义&#xff0c;在原来扩散模型的基础上加上一个引导&#xff0c;让扩散模型朝着我们想要的方向去生成图像 从上图可以了解到生成下一张图像是有分类器参与的 无分类器就是这种形式要参与下一张图像的生成

SQL面试

#(1)请写出要查询员工J开头的名字其工号(EMPNO)及部门名称(DEPTNA)的 SQL语句SELECT e.emp,e.name,d.deptna FROM emp e left join dept d on d.deptno e.deptno where e.name like J%#(2)请写出要查询 Kevin 所在部门的部门代号(DEPTNO)及部门名称(DEPTNA)的 SQL 语句SELECT e…

【PCIe 5.0 - 10】Memory, I/O, and Configuration Request 规则

下列规则适用于所有 Memory, I/O, Configuration Requests&#xff0c;以下是针对各类请求的附加规则。 除通用 header 字段外&#xff0c;所有 Memory, I/O, 和 Configuration Requests 还包括以下字段&#xff1a; Requester ID[15:0] 和 Tag[9:0]&#xff0c;组成 Transact…

不是我吹牛逼,这绝对是去掉 if...else 最佳的文章

我相信小伙伴一定看过多篇怎么去掉 if…else 的文章&#xff0c;也知道大家都很有心得&#xff0c;知道多种方法来去掉 if…else &#xff0c;比如 Option&#xff0c;策略模式等等&#xff0c;但我相信大明哥这篇文章绝对是最全&#xff0c;最完备怎么去掉 if…else 的文章&am…

微信小程序导入js使用时候报错

我是引入weapp库时候&#xff0c;导入js会报错。 需要在小程序开发工具里面配置 就可以了。

YOLOv5:修改backbone为MobileOne

YOLOv5&#xff1a;修改backbone为MobileOne 前言前提条件相关介绍MobileOneYOLOv5修改backbone为MobileOne修改common.py修改yolo.py修改yolov5.yaml配置 参考 前言 记录在YOLOv5修改backbone操作&#xff0c;方便自己查阅。由于本人水平有限&#xff0c;难免出现错漏&#xf…

Redis之持久化(RDB和AOF)

文章目录 前言一、RDB1.介绍2.redis.config有关配置3.触发4.恢复5.优缺点 二、AOF1.介绍2.redis.config配置3.启动4.恢复5.重写6.优缺点 总结 前言 Redis 是内存数据库&#xff0c;即数据存储在内存。 如果不将内存中的数据保存到磁盘&#xff0c;一旦服务器进程退出&#xff…

Spring Cloud之Docker的学习【详细】

目录 Docker 项目部署问题 总结 镜像与容器 Docker的安装 Docker基本操作 镜像相关命令 拉取镜像 镜像保存 删除镜像 镜像加载 容器相关命令 删除容器 数据卷 数据卷命令 数据挂载 自定义镜像 Dockerfile 案例 Docker-Compose Compose文件 Docker-Compos…

数据结构与算法C语言版学习笔记(1)-绪论

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 一、数据结构的研究内容二、基本概念与术语1.数据与数据元素2.数据结构逻辑结构的种类存储结构的种类 三、算法1.什么是算法&#xff1f;算法的描述2.一个算法要具备…

【VR开发】【Unity】【VRTK】1-无代码VRVR开发介绍

本篇开始精简讲解VRTK相关的知识。 VRTK是基于Unity的一套提供无代码VR开发的插件,这套插件开源,可商用,集合了目前可能的VR体验组件,可以让不会C#编程但想要开发VR体验的人在不写一行代码的前提下开发出心仪的VR作品。 这套组件问世后也很受欢迎,目前已经进化到了第四代…

Java 算法篇-深入了解二分查找法

&#x1f525;博客主页&#xff1a; 小扳_-CSDN博客 ❤感谢大家点赞&#x1f44d;收藏⭐评论✍ 目录 1.0 二分查找法的说明 2.0 二分查找实现的多种版本 2.1 二分查找的基础版本 2.2 二分查找的改动版本 2.3 二分查找的平衡版本 2.4 二分查找的官方版本 3.0 二分查找的应用 1…

【Linux系统学习】系统编程开发工具编译器gcc/g++使用

个人主页点击直达&#xff1a;小白不是程序媛 Linux专栏&#xff1a;Linux系统学习 目录 前言 Linux系统下安装gcc和g gcc和g的不同 gcc/g的使用 gcc/g选项 预处理 头文件的展开 宏替换 注释的删除 条件的编译 编译 汇编 链接 系统库 库的分类 库的安装 库的…

[计算机提升] Windows系统软件:娱乐类

3.3 系统软件&#xff1a;娱乐类 3.3.1 Windows Media Player&#xff1a;dvdplay Windows Media Player是Windows操作系统自带的多媒体播放软件&#xff0c;用于播放和管理电脑中的音频和视频文件。它提供了以下功能&#xff1a; 播放音频和视频文件&#xff1a;Windows Med…

基于ThinkPHP+MySQL实现的通用的PHP网站后台管理系统

caozha-admin 后台管理框架 1.8.3 caozha-admin是一个通用的PHP网站后台管理框架&#xff0c;基于开源的ThinkPHP开发&#xff0c;特点&#xff1a;易上手&#xff0c;零门槛&#xff0c;界面清爽极简&#xff0c;极便于二次开发。 基础功能 1、系统设置 2、管理员管理 3、…

搭建ELK+Filebead+zookeeper+kafka实验

一、ELKFilebeatkafkazookeeper架构 架构图分别演示 第一层&#xff1a;数据采集层 数据采集层位于最左边的业务服务集群上&#xff0c;在每个业务服务器上面安装了filebead做日志收集&#xff0c;然后把采集到的原始日志发送到kafkazookeeper集群上。 第二层&#xff1a;消…

vue3中,使用html2canvas截图包含视频、图片、文字的区域

需求&#xff1a;将页面中指定区域进行截图&#xff0c;区域中包含了图片、文字、视频。 第一步&#xff0c;先安装 npm install html2canvas第二步&#xff0c;在页面引入&#xff1a; import html2canvas from html2canvas;第三步&#xff0c;页面使用&#xff1a; 1&…

SpringCloudGateway--过滤器(自定义filter)

目录 一、概览 二、通过GatewayFilter实现 三、继承AbstractGatewayFilterFactory 一、概览 当使用Spring Cloud Gateway构建API网关时&#xff0c;可以利用Spring Cloud Gateway提供的内置过滤器&#xff08;filter&#xff09;来实现对请求的处理和响应的处理。过滤器可以…

TiDB 企业版全新升级,平凯数据库核心特性全解读

作为 TiDB 企业版的全新升级&#xff0c;平凯数据库一经推出便广受媒体及用户关注。 近日&#xff0c;平凯星辰首席科学家丁岩在“平凯数据库全解读”活动中&#xff0c;首次详细介绍了平凯数据库的核心能力。 本文为丁岩演讲实录全文&#xff0c;为方便阅读&#xff0c;已做部…

物联网AI MicroPython传感器学习 之 QMC5883指南针罗盘传感器

学物联网&#xff0c;来万物简单IoT物联网&#xff01;&#xff01; 一、产品简介 QMC5883是一款表面贴装的集成了信号处理电路的三轴磁性传感器&#xff0c;应用场景主要包括罗盘、导航、无人机、机器人和手持设备等一些高精度的场合。 引脚定义 VCC&#xff1a;3V3&#…

自定义的卷积神经网络模型CNN,对图片进行分类并使用图片进行测试模型-适合入门,从模型到训练再到测试,开源项目

自定义的卷积神经网络模型CNN&#xff0c;对图片进行分类并使用图片进行测试模型-适合入门&#xff0c;从模型到训练再到测试&#xff1a;开源项目 开源项目完整代码及基础教程&#xff1a; https://mbd.pub/o/bread/ZZWclp5x CNN模型&#xff1a; 1.导入必要的库和模块&…
最新文章