K8s+SpringBoot+gRpc

news2024/9/29 1:27:43

本文使用K8s当做服务注册与发现、配置管理,使用gRpc用做服务间的远程通讯

一、先准备K8s

我在本地有个K8s单机

二、准备service-provider

  1. pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.14</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>service-provider</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>service-provider</name>
    <description>service-provider</description>
    <properties>
        <java.version>11</java.version>
        <!--        <os.detected.classifier>osx-aarch_64</os.detected.classifier>-->
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>2.5.14</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2020.0.6</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-kubernetes-dependencies</artifactId>
                <version>1.1.10.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-kubernetes-client-all</artifactId>
        </dependency>

        <!-- gRpc -->
        <dependency>
            <groupId>net.devh</groupId>
            <artifactId>grpc-spring-boot-starter</artifactId>
            <version>2.13.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.52.1</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
            <version>1.18.24</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.1</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <classifier>exec</classifier>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.6.1</version>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}</protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.52.1:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
  1. 配置文件 application.yml

grpc:
  server:
    port: 9090
server:
  port: 30000
spring:
  application:
    name: service-provider
  cloud:
    kubernetes:
      reload:
        enabled: true
        mode: polling
        period: 5000

logging:
  level:
    org.springframework.cloud.loadbalancer: debug
  1. 主类 ServiceProviderApplication

package com.example.service.provider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication
@EnableDiscoveryClient
public class ServiceProviderApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceProviderApplication.class, args);
    }
}
  1. 在 src/main/proto文件夹下新增PB文件 HelloFacade.proto

syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.example.service.provider.api";
option java_outer_classname = "HelloServiceProto";

service HelloService {
  rpc SayHello (SayHelloRequest) returns (SayHelloResponse) {
  }
}

message SayHelloRequest {
  string name = 1;
}

message SayHelloResponse {
  int32 code = 1;
  string message = 2;
  bool success = 3;
  SayHelloData data = 4;
}

message SayHelloData {
  string name = 1;
  string content = 2;
}
  1. 接口实现类

package com.example.service.provider.facade;

import com.example.service.provider.api.HelloServiceGrpc;
import com.example.service.provider.api.SayHelloData;
import com.example.service.provider.api.SayHelloRequest;
import com.example.service.provider.api.SayHelloResponse;
import lombok.extern.slf4j.Slf4j;
import net.devh.boot.grpc.server.service.GrpcService;

@Slf4j
@GrpcService
public class HelloServiceImpl extends HelloServiceGrpc.HelloServiceImplBase {

    @Override
    public void sayHello(SayHelloRequest request, io.grpc.stub.StreamObserver<SayHelloResponse> responseObserver) {
        log.info("接收consumer的say hello grpc 请求");
        SayHelloData helloData = SayHelloData.newBuilder()
                .setName("maple")
                .setContent("say hello")
                .build();
        SayHelloResponse.Builder builder = SayHelloResponse.newBuilder()
                .setCode(0)
                .setMessage("success")
                .setSuccess(true)
                .setData(helloData);
        responseObserver.onNext(builder.build());
        responseObserver.onCompleted();
    }
}
  1. Dockerfile

FROM openjdk:11-jdk-slim
ENV jarName="service-provider.jar"
ADD service-provider-0.0.1-SNAPSHOT-exec.jar $jarName
ENTRYPOINT java -Duser.timezone=GMT+8 -jar  $jarName
  1. K8s声明yaml文件 service-provider-deploy.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: service-k8s-demo
  labels:
    name: service-k8s-demo

---

apiVersion: v1
kind: ServiceAccount
metadata:
  name: service-k8s-demo
  namespace: service-k8s-demo

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: service-k8s-demo
  name: service-k8s-demo
rules:
  - apiGroups:
    - ""
    resources:
    - services
    - configmaps
    - endpoints
    - nodes
    - pods
    - secrets
    - namespaces
    verbs:
    - get
    - list
    - watch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: service-k8s-demo
  namespace: service-k8s-demo
subjects:
- kind: ServiceAccount
  name: service-k8s-demo
  namespace: service-k8s-demo
roleRef:
  kind: ClusterRole
  name: service-k8s-demo
  apiGroup: rbac.authorization.k8s.io

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: service-provider
  namespace: service-k8s-demo
  labels:
    app: service-provider
spec:
  replicas: 3
  template:
    metadata:
      name: service-provider
      labels:
        app: service-provider
    spec:
      containers:
        - name: service-provider
          image: service-provider:1.0
          ports:
            - name: http
              protocol: TCP
              containerPort: 30000
            - name: grpc
              protocol: TCP
              containerPort: 9090
          imagePullPolicy: IfNotPresent
      serviceAccountName: service-k8s-demo
      restartPolicy: Always
  selector:
    matchLabels:
      app: service-provider

---

apiVersion: v1
kind: Service
metadata:
  name: service-provider
  namespace: service-k8s-demo
spec:
  selector:
    app: service-provider
  ports:
    - port: 80
      targetPort: 30000
      name: http
    - port: 9090
      targetPort: 9090
      name: grpc
  clusterIP: None
  1. 本地启动测试

三、准备service-consumer

  1. pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.14</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>service-consumer</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>service-consumer</name>
    <description>service-consumer</description>
    <properties>
        <java.version>11</java.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>2.5.14</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2020.0.6</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-kubernetes-dependencies</artifactId>
                <version>1.1.10.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>

        <dependency>
            <groupId>com.example</groupId>
            <artifactId>service-provider</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-kubernetes-client-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
            <version>1.18.24</version>
        </dependency>

        <!-- gRpc -->
        <dependency>
            <groupId>net.devh</groupId>
            <artifactId>grpc-spring-boot-starter</artifactId>
            <version>2.13.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.52.1</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.1</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <classifier>exec</classifier>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.6.1</version>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}</protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.52.1:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>
  1. 配置文件 application.yml

grpc:
  server:
    port: 9091
  client:
    service-provider:
      negotiation-type: plaintext
      enable-keep-alive: true
      keep-alive-without-calls: true
      address: 'static://service-provider:9090'

server:
  port: 30001
spring:
  application:
    name: service-consumer
  cloud:
    kubernetes:
      reload:
        enabled: true
        mode: polling
        period: 5000

logging:
  level:
    org.springframework.cloud.loadbalancer: debug
  1. 主类 ServiceConsumerApplication

package com.example.service.consumer;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@EnableDiscoveryClient
@SpringBootApplication
@RequiredArgsConstructor
public class ServiceConsumerApplication {

    private final DiscoveryClient discoveryClient;
    private final ProviderServiceGrpcClient providerServiceGrpcClient;

    public static void main(String[] args) {
        SpringApplication.run(ServiceConsumerApplication.class, args);
    }
    
    @GetMapping("/grpc/hello")
    public String sayHello() {
        log.info("消费服务:service-consumer grpc 调用 service-provider");
        return providerServiceGrpcClient.sayHello();
    }

    @GetMapping("/consumers/services")
    public List<String> findServices() {
        log.info("当前注册中心下所有服务");
        List<String> services = discoveryClient.getServices();
        services.stream().map(discoveryClient::getInstances).forEach(v ->
                v.forEach(s -> System.out.printf("%s:%s  uri:%s%n", s.getHost(), s.getPort(), s.getUri())));

        return services;
    }
}

  1. gRpc调用Provider ProviderServiceGrpcClient

package com.example.service.consumer;

import com.example.service.provider.api.HelloServiceGrpc;
import com.example.service.provider.api.SayHelloRequest;
import com.example.service.provider.api.SayHelloResponse;
import net.devh.boot.grpc.client.inject.GrpcClient;
import org.springframework.stereotype.Service;

@Service
public class ProviderServiceGrpcClient {

    @GrpcClient("service-provider")
    private HelloServiceGrpc.HelloServiceBlockingStub helloServiceBlockingStub;

    public String sayHello() {

        SayHelloRequest request = SayHelloRequest.newBuilder().setName("maple123").build();

        SayHelloResponse sayHelloResponse = helloServiceBlockingStub.sayHello(request);

        return sayHelloResponse.toString();
    }
}
  1. Dockerfile

FROM openjdk:11-jdk-slim
ENV jarName="service-consumer.jar"
ADD service-consumer-0.0.1-SNAPSHOT-exec.jar $jarName
ENTRYPOINT java -Duser.timezone=GMT+8 -jar  $jarName
  1. K8s声明yaml文件 service-consumer-deploy.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: service-k8s-demo
  labels:
    name: service-k8s-demo

---

apiVersion: v1
kind: ServiceAccount
metadata:
  name: service-k8s-demo
  namespace: service-k8s-demo

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: service-k8s-demo
  name: service-k8s-demo
rules:
  - apiGroups:
      - ""
    resources:
      - services
      - configmaps
      - endpoints
      - nodes
      - pods
      - secrets
      - namespaces
    verbs:
      - get
      - list
      - watch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: service-k8s-demo
  namespace: service-k8s-demo
subjects:
  - kind: ServiceAccount
    name: service-k8s-demo
    namespace: service-k8s-demo
roleRef:
  kind: ClusterRole
  name: service-k8s-demo
  apiGroup: rbac.authorization.k8s.io

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: service-consumer
  namespace: service-k8s-demo
  labels:
    app: service-consumer
spec:
  replicas: 1
  template:
    metadata:
      name: service-consumer
      labels:
        app: service-consumer
    spec:
      containers:
        - name: service-consumer
          image: service-consumer:1.0
          ports:
            - name: http
              protocol: TCP
              containerPort: 30001
            - name: grpc
              protocol: TCP
              containerPort: 9091
          imagePullPolicy: IfNotPresent
      serviceAccountName: service-k8s-demo
      restartPolicy: Always
  selector:
    matchLabels:
      app: service-consumer

---

apiVersion: v1
kind: Service
metadata:
  name: service-consumer
  namespace: service-k8s-demo
spec:
  selector:
    app: service-consumer
  ports:
    - port: 80
      targetPort: 30001
      name: http
    - port: 9091
      targetPort: 9091
      name: grpc
  type: NodePort

  1. 本地启动测试

四、打镜像

docker build -t service-provider:1.0 .
docker build -t service-consumer:1.0 .

五、执行K8s yaml文件 创建命名空间、账号、角色、部署应用、暴露端口等

kubetl apply -f service-provider-deploy.yaml
kubetl apply -f service-consumer-deploy.yaml

六、查看与测试

gRpc正常访问,但是发现一个问题,下面的图片,上面三个是Provider,发现负载均衡失效了,请求全都打在了一个Provider里,搜了下发现和 gRpc基于HTTP2.0 多路复用 有关,之后再处理吧。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

浅谈性能测试监控系统,做好关键指标的监控

随着业务的增长&#xff0c;服务器部署由单一架构向分布式集群架构转变&#xff0c;性能测试过程中指标监控也由单一服务器向集群服务器转变。 对于性能测试团队来说&#xff0c;需要建立起适用于测试的多机监控系统&#xff0c;以便后期顺利且高效地进行监控分析调优&#xf…

Java程序员拿下高薪offer需要具备哪些能力?这份Java面试专题汇总助你拿下心仪offer!!

背景今天这篇文章的灵感来自一个粉丝的亲身经历&#xff0c;想必也是求职浪潮中很多朋友的经历&#xff0c;内卷大环境找不到满意工作的人太多了&#xff0c;之前也有很多人问过我怎么才能找到不错的工作&#xff0c;甚至是进大厂&#xff0c;所以今天就借这位粉丝的经历来聊聊…

对JAVA 中“指针“理解

对于Java中的指针&#xff0c;以下典型案例会让你对指针的理解更加深刻。 首先对于&#xff1a; 系统自动分配对应空间储存数字 1&#xff0c;这个空间被变量名称b所指向即: b ——> 1 变量名称 空间 明…

linux下yum安装consul实现动态配置管理

一、yum安装consul #安装yum-utils yum install -y yum-utils#配置consul的下载仓库 yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo#必须上面步骤&#xff0c;不然会找不到仓库 yum -y install consul#查看版本 consul -v 二、启动…

基于深度学习的三维重建(二):pytorch的简单操作及DataLoader、Dataset类简介

目录 1.numpy举几个demo 2.pytorch基础 2.1 tensor介绍 3.简单版DataSet & DataLoader 4.模型构建 5.深度学习模型demo&#xff1a;手写文字识别 5.1 构建网络 5.2 前向传播过程 5.3 训练部分 5.4 测试部分 5.5 模型导出 5.6 模型测试 6.pytorch可视化工具ten…

MySQL数据库调优————索引数据结构

B-TREE B-TREE数据结构 B-TREE特性 根节点的子结点个数2 < X < m&#xff0c;m是树的阶 假设m 3&#xff0c;则根节点可有2-3个孩子 中间节点的子节点个数m/2 < y < m 假设m 3&#xff0c;中间节点至少有2个孩子&#xff0c;最多3个孩子 每个中间节点包含n个关…

《MySql学习》 行锁对业务的影响

一. 行锁介绍 行锁由各个存储引擎分别实现&#xff0c;MyISAM存储引擎是不支持行锁的&#xff0c;这也是MySQL使用InnoDB作为默认存储引擎的一个重要原因&#xff0c;锁更细的InnoDB能支持更多的并发业务。但需要注意的是&#xff0c;行锁在InnoDB的实现是给索引加的锁&#x…

智慧养殖无线通讯解决方案

一、方案概述农植畜禽/水产养殖智能监控系统可以在远端设备实现对如温度、湿度、气体浓度、光照度等传感设备的自动调节与控制功能。管理者可随时通过电脑了解养殖场各环节的运行状况&#xff0c;并根据养殖现场内外环境因子的变化情况将命令下发到现场执行设备。为动植物营造舒…

docker-compose安装SonarQube

前言SonarQube 是一个开源的代码分析平台, 用来持续分析和评测项目源代码的质量。 通过SonarQube我们可以检测出项目中重复代码&#xff0c; 潜在bug&#xff0c; 代码规范&#xff0c;安全性漏洞等问题&#xff0c; 并通过SonarQube web UI展示出来。一、docker-compose配置#v…

【Python】编写代码实现指定下标值顺序进行正序和倒序排序算法编程

&#x1f389;&#x1f389; 在本次python文章中&#xff0c;主要通过定义一个排序方法&#xff0c;实现一组数列能够按照另一组数列指定的位置进行重新排序输出&#xff0c;默认正序排序&#xff0c;可通过True表示逆序输出 目录1、知识点2、数列和元组1&#xff09;错误遍历方…

全网多种方式解决Knife4j文档请求异常

文章目录1. 复现问题2. 分析问题3. 解决问题4. 其他方法解决此异常5. 其他说明1. 复现问题 今天在本地启动项目后&#xff0c;刷新Knife4j接口文档&#xff0c;却报出如下错误&#xff1a; 即Knife4j文档请求异常。 2. 分析问题 报出Knife4j文档请求异常错误时&#xff0c;赶…

生活不一定很酷,但是一定要全力以赴

题记&#xff1a;努力是为了让自己不平庸 当看到这个话题“竞赛那些事”&#xff0c;我还是有所触动的&#xff0c;我本身就是一个不喜欢安逸&#xff0c;喜欢折腾的人&#xff0c;纵使不能把日子过成诗&#xff0c;也要折腾成向往的样子。 我的记忆在脑海中不停翻着页&#x…

黑马redis学习记录:分布式锁

一、基本原理和实现方式对比 分布式锁&#xff1a;满足分布式系统或集群模式下多进程可见并且互斥的锁。 分布式锁的核心思想就是让大家都使用同一把锁&#xff0c;只要大家使用的是同一把锁&#xff0c;那么我们就能锁住线程&#xff0c;不让线程进行&#xff0c;让程序串行…

Linux_基本权限

Linux入门第二篇已送达&#xff01; Linux_基本权限shell外壳权限Linux的用户分类角色划分Linux的文件文件类型查看权限目录的权限默认权限粘滞位shell外壳 为了保护操作系统&#xff0c;用户的指令不能由操作系统直接进行执行&#xff0c;需要一个中间者&#xff0c;比如Linu…

MySQL优化篇-MySQL压力测试

备注:测试数据库版本为MySQL 8.0 MySQL压力测试概述 为什么压力测试很重要&#xff1f;因为压力测试是唯一方便有效的、可以学习系统在给定的工作负载下会发生什么的方法。压力测试可以观察系统在不同压力下的行为&#xff0c;评估系统的容量&#xff0c;掌握哪些是重要的变化…

基于ThinkPHP6.0+Vue+uni-app的多商户商城系统好用吗?

likeshop多商户商城系统适用于B2B2C、多商户、商家入驻、平台商城场景。完美契合平台自营联营加盟等多种经营方式使用&#xff0c;系统拥有丰富的营销玩法&#xff0c;强大的分销能力&#xff0c;支持官方旗舰店&#xff0c;商家入驻&#xff0c;平台抽佣商家独立结算&#xff…

重生之我是赏金猎人-SRC漏洞挖掘(八)-记一次移花接木的GetShell

0x00&#xff1a;前言 https://github.com/J0o1ey/BountyHunterInChina 欢迎亲们点个star 作者&#xff1a;RGM78sec 某天测厂商业务时&#xff0c;发现其中有一个提供音乐播放业务的资产&#xff0c;正好里面有我想听的歌&#xff0c;于是就有了这篇文章 0x01&#xff1a;…

天翼云服务器如何限制端口仅限部分ip地址访问

大家好&#xff0c;我是雄雄&#xff0c;欢迎关注微信公众号&#xff1a;雄雄的小课堂。 前言 最近买了个服务器&#xff0c;没错&#xff0c;是天翼云的。 客户没有钱&#xff0c;买大厂的太贵舍不得&#xff0c;那就买个普通的吧&#xff0c;经媒人介绍&#xff0c;觉得天翼…

vue小案例

vue小案例 组件化编码流程 1.拆分静态组件&#xff0c;按功能点拆分 2.实现动态组件 3.实现交互 文章目录vue小案例组件化编码流程1.父组件给子组件传值2.通过APP组件给子组件传值。3.案例实现4.项目小细节1.父组件给子组件传值 父组件给子组件传值 1.在父组件中写好要传的值&a…

5min完成linux环境Jenkins的安装

5min搞定linux环境Jenkins的安装安装Jenkinsstep1: 使用wget 命令下载Jenkinsstep2、创建Jenkins日志目录并运行jekinsstep3、访问jenkins并解锁jenkins&#xff0c;安装插件以及创建管理员用户step4、到此&#xff0c;就完成了Finish、以上步骤中遇到的问题1、 jenkins启动不了…