最近在使用阿里的nacos的注册中心,下载了最新版本,按照网上的一套流程走下来然后报错
failed to req API:/nacos/v1/ns/instance after all servers([127.0.0.1:8848]) tried: ErrCode:403, ErrMsg:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Sep 21 08:38:24 CST 2020
There was an unexpected error (type=Forbidden, status=403).
unknown user!

出现错误发现报错403,403一般都是拒绝访问了,刚开始找了下依赖发现不是依赖的问题,那就是配置的问题了,果然在网上翻了翻最新版本的nacos是需要连接的时候提供账号密码的。
在这里插入图片描述
加上这个以后,服务立马注册进去。
顺便记录下父依赖

 <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2.2.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- spring-cloud-dependencies -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR8</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- spring-boot-dependencies -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.3.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

        </dependencies>

    </dependencyManagement>
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐