注册网页_dubbo服务注册

注册网页_dubbo服务注册大概在去年的时候发现生产环境使用eureka经常会发现服务假死eureka没有给踢掉的情况,然后就衍生了要不就换个注册中心试试,然后就了解到了nacos,正好他还融合了配置中心,但是后来碍于切换时怕生产环境不稳定,丢数据等问题就一直没有换,但后续的项目的注册中心都换成了nacos,这篇文章我就来模拟一下如何将eureka平滑切换成nacos………………

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

前言

大概在去年的时候发现生产环境使用eureka经常会发现服务假死eureka没有给踢掉的情况,然后就衍生了要不就换个注册中心试试,然后就了解到了nacos,正好他还融合了配置中心,但是后来碍于切换时怕生产环境不稳定,丢数据等问题就一直没有换,但后续的项目的注册中心都换成了nacos,这篇文章我就来模拟一下如何将eureka平滑切换成nacos

父工程构建

这里我在父工程里边又单独创建了一层父工程,我分别在alibaba-cloud 、netflix-cloud 中模拟新旧微服务
在这里插入图片描述

父工程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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>top.fate</groupId>
    <artifactId>nacoAndEureka</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0</version>
    <modules>
        <module>netflix-cloud</module>
        <module>alibaba-cloud</module>
    </modules>
</project>

模拟旧版微服务

 netflix-cloud 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>nacoAndEureka</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>netflix-cloud</artifactId>
    <packaging>pom</packaging>
    <modules>
        <module>eureka</module>
        <module>eureka-provider</module>
        <module>eureka-consumer</module>
    </modules>

    <properties>
        <spring.boot.version>2.1.2.RELEASE</spring.boot.version>
        <spring.cloud.version>Greenwich.SR5</spring.cloud.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- springBoot -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- springCloud -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring.cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>

搭建eureka

在这里插入图片描述

  • 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>netflix-cloud</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>eureka</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
    </dependencies>
</project>
  • EurekaApplication 启动类
package top.fate.eureka;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@EnableEurekaServer
@SpringBootApplication
public class EurekaApplication { 
   

	public static void main(String[] args) { 
   
		SpringApplication.run(EurekaApplication.class, args);
	}
}
  • application.yml
server:
  port: 8761
spring:
  application:
    name: eureka-service
eureka:
  instance:
    # 设置该服务注册中心的hostname
    hostname: 127.0.0.1
  client:
    # 我们创建的是服务注册中心,而不是普通的应用,这个应用会向注册中心注册它自己
    #,设置为false就是禁止自己向自己注册的这个种行为
    register-with-eureka: false
    # 不去检索其他的服务,因为注册中心本身的职责就是维护服务实例
    fetch-registry: false
    # 制定服务注册中心的位置
    service-url.defaultZone: http://${ 
   eureka.instance.hostname}:${ 
   server.port}/eureka/

eureka-provider

在这里插入图片描述

  • 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>netflix-cloud</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>eureka-provider</artifactId>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
    </dependencies>

</project>
  • EurekaProviderApplication 启动类
package top.fate.eurekaprovider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 14:23 */
@SpringBootApplication
@EnableEurekaClient
@RestController
public class EurekaProviderApplication { 
   
    public static void main(String[] args) { 
   
        SpringApplication.run(EurekaProviderApplication.class, args);
    }

    @GetMapping("/info")
    public String info(){ 
   
        return "this is eureka-service";
    }
}

  • application.yml
server:
  port: 8081
spring:
  application:
    name: provider
eureka:
  client:
    service-url:
      defaultZone: "http://localhost:8761/eureka"

eureka-consumer

在这里插入图片描述

  • 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>netflix-cloud</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>eureka-consumer</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
    </dependencies>
</project>
  • EurekaConsumerApplication 启动类
package top.fate.eurekaconsumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import top.fate.eurekaconsumer.client.EurekaProviderClient;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 14:43 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(clients = EurekaProviderClient.class)
public class EurekaConsumerApplication { 
   
    public static void main(String[] args) { 
   
        SpringApplication.run(EurekaConsumerApplication.class, args);
    }
}
  • EurekaProviderClient
package top.fate.eurekaconsumer.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 14:48 */
@FeignClient(value = "provider")
public interface EurekaProviderClient { 
   

    @GetMapping("info")
    String info();
}
  • ConsumerController
package top.fate.eurekaconsumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.fate.eurekaconsumer.client.EurekaProviderClient;

import javax.annotation.Resource;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 14:48 */
@RestController
public class ConsumerController { 
   

    @Resource
    private EurekaProviderClient eurekaProviderClient;

    @GetMapping("getProvider")
    public String getProvider(){ 
   
        return eurekaProviderClient.info();
    }

}

测试服务是否可以调通

在这里插入图片描述
在这里插入图片描述

这里我三个服务都启动正常,直接访问8091consumer测试 ,如下图所示consumer 可以访问provider
在这里插入图片描述

第一阶段流程图

在这里插入图片描述


模拟新版微服务

alibaba-cloud 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>nacoAndEureka</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>alibaba-cloud</artifactId>
    <packaging>pom</packaging>
    <modules>
        <module>nacos-consumer</module>
        <module>nacos-provider</module>
    </modules>

    <properties>
        <spring.boot.version>2.6.3</spring.boot.version>
        <spring.cloud.version>2021.0.1</spring.cloud.version>
        <spring.cloud.alibaba.version>2021.0.1.0</spring.cloud.alibaba.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- springBoot -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- springCloud -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring.cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- spring-cloud-alibaba -->
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring.cloud.alibaba.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

启动安装nacos

可以参考SpringCloudAlibaba篇(二)整合Nacos注册配置中心 这篇文章我就不重复操作了


nacos-provider

  • 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>alibaba-cloud</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>nacos-provider</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
            <version>2021.0.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
    </dependencies>
</project>
  • NacosProviderApplication 启动类
package top.fate.nacosprovider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 16:55 */
@SpringBootApplication
@RestController
@EnableConfigurationProperties(AutoServiceRegistrationProperties.class)
public class NacosProviderApplication { 
   

    public static void main(String[] args) { 
   
        SpringApplication.run(NacosProviderApplication.class, args);
    }

    @GetMapping("/info")
    public String info() { 
   
        return "this is nacos-service";
    }
}
  • application.properties
spring.autoconfigure.exclude=org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration
  • application.yml
url:
  nacos: localhost:8848
server:
  port: 8082
spring:
  application:
    name: provider
  profiles:
    active: dev
  cloud:
    nacos:
      discovery:
        #集群环境隔离
        cluster-name: shanghai
        #命名空间
        namespace: ${ 
   spring.profiles.active}
        #持久化实例 ture为临时实例 false为持久化实例 临时实例发生异常直接剔除, 而持久化实例等待恢复
        ephemeral: true
        #注册中心地址
        server-addr: ${ 
   url.nacos}
eureka:
  client:
    service-url:
      defaultZone: "http://localhost:8761/eureka"

nacos-consumer

  • 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>alibaba-cloud</artifactId>
        <groupId>top.fate</groupId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>nacos-consumer</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
            <version>2021.0.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
    </dependencies>
</project>
  • NacosConsumerApplication 启动类
package top.fate.nacosconsumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import top.fate.nacosconsumer.client.EurekaProviderClient;
import top.fate.nacosconsumer.client.NacosProviderClient;
import top.fate.nacosconsumer.client.ProviderClient;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 16:39 */
@SpringBootApplication
@EnableFeignClients(clients = { 
   EurekaProviderClient.class, NacosProviderClient.class, ProviderClient.class})
@EnableConfigurationProperties(AutoServiceRegistrationProperties.class)
public class NacosConsumerApplication { 
   

    public static void main(String[] args) { 
   
        SpringApplication.run(NacosConsumerApplication.class, args);
    }
}
  • ProviderClient
package top.fate.nacosconsumer.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 18:24 */
@FeignClient(value = "provider")
public interface ProviderClient { 
   

    @GetMapping("info")
    String info();
}
  • ConsumerController
package top.fate.nacosconsumer.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.fate.nacosconsumer.client.ProviderClient;

import javax.annotation.Resource;

/** * @auther:Wangxl * @Emile:18335844494@163.com * @Time:2022/6/16 14:48 */
@RestController
public class ConsumerController { 
   

    @Resource
    private ProviderClient providerClient;

    @GetMapping("getProvider")
    public String getProvider(){ 
   
        return providerClient.info();
    }
}
  • application.properties
spring.autoconfigure.exclude=org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration
  • application.yml
url:
  nacos: localhost:8848
server:
  port: 8092
spring:
  application:
    name: nacos-consumer
  profiles:
    active: dev
  cloud:
    nacos:
      discovery:
        #集群环境隔离
        cluster-name: shanghai
        #命名空间
        namespace: ${ 
   spring.profiles.active}
        #持久化实例 ture为临时实例 false为持久化实例 临时实例发生异常直接剔除, 而持久化实例等待恢复
        ephemeral: true
        #注册中心地址
        server-addr: ${ 
   url.nacos}
eureka:
  client:
    service-url:
      defaultZone: "http://localhost:8761/eureka"

上线双注册双订阅新provider服务

先启动nacosProviderApplication
在这里插入图片描述

如下图所示,我们已经实现了双注册,nacos和eureka中都注册了服务

nacos
在这里插入图片描述

eureka
在这里插入图片描述


平滑切换注册中心

验证旧consumer

这里我访问8091的旧版Netflix客户端也就是eureka-consumer,看一下调用的是8081 eureka 还是8082 nacos , 这里我反复调用了十几次,返回结果为

  • this is nacos-service
  • this is eureka-service
    因为此时我们的8091客户端只有eurekaClient,然后我们的provider在eureka注册中心有两个实例,所以就触发了负载均衡,这里我们用的默认轮询模式,当前流程如下图

在这里插入图片描述

下线旧provider

现在我们就可以陆续开始平滑切换注册中心了,旧provider可以关掉了,关掉旧provider之后此时的流程就如下图所示了
在这里插入图片描述

此时我们再访问旧consumer只会返回 this is nacos-service,因为旧的provider已经下线了 ,新provider当前已经切换完成!
在这里插入图片描述

上线双注册双订阅新consumer服务,下线旧consumer

启动nacoConsumerApplication
在这里插入图片描述
访问8092验证是否能正常访问,继续访问getProvider接口,如下图所示访问正常,然后我们就可以下线旧consumer服务了
在这里插入图片描述
在这里插入图片描述

疑惑 (该步骤可以直接略过)

现在我们有个疑惑,现在有两个注册中心,服务发现是走的eureka还是nacos呢
为此,我做了个实验,我分别启动了 旧provider新provider新consumer
此时双注册中心的服务

  • eureka
    • provider8081、provider8082
    • consumer8092
  • nacos
    • provider8082
    • consumer8092

现在我通过consumer8092客户端去请求,得到的结果只有 this is nacos-service ,因此判断注册中心默认走的是nacos.
因为走nacos只会返回this is nacos-service, nacos只有一个实例。
如果走eureka的话会轮询返回this is nacos-service、this is eureka-service ,eureka有两个实例。

  • 此时的流程图 虚线代表该线路空闲
    在这里插入图片描述

这里我找了下源码CompositeDiscoveryClient,调用的时候打了断点,发现系统创建了三个discoveryClientnacos排在第一个,如果可用的话直接就返回了 ,所以可以理解为默认走的是nacos在这里插入图片描述
这里我想到了nacos有个服务下线功能,如果我将nacos中的服务下线之后应该就会去走eureka了吧
在这里插入图片描述
等待几秒过后,通过consumer8092客户端去请求,得到了我想要的结果
分别轮询返回了 this is nacos-servicethis is eureka-service,证明已经走eureka了

  • 此时流程图虚线代表该线路空闲在这里插入图片描述

最后

此时我们生产上边是 新consumer、新provider、eureka、nacos,既然我们要切换到nacos,那eureka就也要停掉了,我们可以在下一版的服务中去掉 eureka的依赖和配置,只留下nacos,将这一个新版本部署上去之后就可以停掉eureka了

  • 如下图所示
    在这里插入图片描述

注意

如果直接引入eureka-client和nacos-client 会报错,如下

Field autoServiceRegistration in org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration required a single bean, but 2 were found:
	- nacosAutoServiceRegistration: defined by method 'nacosAutoServiceRegistration' in class path resource [com/alibaba/cloud/nacos/registry/NacosServiceRegistryAutoConfiguration.class]
	- eurekaAutoServiceRegistration: defined by method 'eurekaAutoServiceRegistration' in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.class]
  1. 需要在配置文件添加如下内容
spring.autoconfigure.exclude=org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration
  1. 启动类添加注解
@EnableConfigurationProperties(AutoServiceRegistrationProperties.class)

原创不易,请点个赞再走吧!感谢

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/171872.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • idea激活码2021 Mac【2021免费激活】

    (idea激活码2021 Mac)本文适用于JetBrains家族所有ide,包括IntelliJidea,phpstorm,webstorm,pycharm,datagrip等。IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html…

    2022年3月27日
    44
  • linux命令查看所有进程_获取当前进程句柄

    linux命令查看所有进程_获取当前进程句柄查看系统默认的最大文件句柄数,系统默认是1024#ulimit-n1024查看当前进程打开了多少句柄数#lsof-n|awk‘{print$2}’|sort|uniq-c|sort-nr|more13124204 5724244  5724231  …其中第一列是打开的句柄数,第二列是进程ID。可以根据ID号来查看进程名。#psaef|grep24204…

    2022年10月17日
    0
  • html制作百度音乐标签页面,网页调用百度音乐盒

    html制作百度音乐标签页面,网页调用百度音乐盒在自己的网页中嵌入百度音乐盒选择播放自己的音乐完整代码如下:mymusicbody{margin:0;padding:0;}.p{font-size:20px;font-family:”TimesNewRoman”;}.center{width:500px;height:300px;margin:20px00100px;float:left;}请输入格式为“后来,刘若英”百…

    2022年7月25日
    12
  • mysql批量增加数据_数据库最大连接数设置为多少合适

    mysql批量增加数据_数据库最大连接数设置为多少合适文章目录一、前言二、批量插入前准备1、插入到数据表的字段2、计算一行字段占用的空间3、在数据里做插入操作的时候,整体时间的分配三、批量插入数据测试1、SQL语句的大小限制2、查看服务器上的参数:3、计算一次能插入的最大行记录4、测试插入数据比对(1)插入11W条数据,按照每次10,600,1000,20000,80000来测试:(2)加大数据量到24w(3)加大测试量到42W5、如果插入的值就是sql语句限制的最大值,那么性能真的好吗?四、其他影响插入性能的因…

    2022年9月1日
    3
  • 十、模板方法模式—制作更多好喝的饮品! #和设计模式一起旅行#

    无规矩不成方圆!故事背景在安装了酷炫了碉堡了的灯之后,我饿设计模式MM经营的奶茶店生意更加火爆,有不同国家的顾客,那么为了满足更多消费者的口味,我们推出了中国龙井苹果茶和叶门摩卡牛奶咖啡。其中制作的过程:把水烧开将咖啡/茶叶放到杯子里用沸水冲泡加入牛奶/苹果汁下面用代码来表示茶和咖啡的制作过程!//龙井苹果茶制作public class LongJi…

    2022年2月27日
    37
  • 预写式日志(Write-Ahead Logging (WAL))

    预写式日志(Write-Ahead Logging (WAL))

    2021年11月25日
    38

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号