当前位置:网站首页>Summary of some precautions and problems in the use of tars framework (mengxinxiang)

Summary of some precautions and problems in the use of tars framework (mengxinxiang)

2022-06-23 03:25:00 nlmeo

1. Server size , If you want to use ECs to learn tars Frame words , It is recommended that the memory should be at least 4G above ...

Subject adopted docker+ Virtual network mode tars Deployed on the same server , For the first deployment 1 nucleus 2G Cloud server , After deployment docker Three even (tars/node、tars/framework、mysql5.6) in the future , Use Xshell The response of the link discovery server has been very slow , Sure enough , The second example service in the development department HelloClient When , Insufficient memory found during check , The title is upgraded to 2 nucleus 4G after , After releasing the third Service , When uploading the release package , The server exploded decisively . Of course, there may be something wrong with my use , If a little friend can hold on , Please ( On his knees ).

Check node health
Click query log

2、 About the link being rejected

Problem description :

HelloHttp Has been successfully released , Access path denied , see docker It is found that the port has been opened , The intranet cannot be connected , The internal access of the container still cannot be connected , Baidu modifies various network cards , Configuring the agent still fails

Solution :

Be sure to test the service link first , If the link fails, the probability is the problem of the code , It's really important !!!

View service links

3、 About HelloHttp Configuration problem of

The official configuration is as follows

In the actual development process, we are generally used to selecting

Generated pom file

<?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>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
    </properties>

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.3.7.RELEASE</version>
                <configuration>
                    <mainClass>com.example.demo.DemoApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

And then , Adding an official configuration file will result in an error , Because the template generated by default already contains boot Dependence , If you don't want to make big changes

Plugins depend on

It's all small problems , But if you don't pay attention, it will cause a lot of trouble ( Configured the wrong card all day ), The partners can discuss problems together , Finally, of course, it started successfully ≧◔◡◔≦


原网站

版权声明
本文为[nlmeo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/01/202201191552245972.html