怎么在Spring Cloud Alibaba 2.2.0.RELEASE上使用Nacos自定义账号密码

本文将指导如何在Nacos Server 1.2.0及更高版本上,为Spring Cloud Alibaba应用配置使用自定义账号密码的步骤。首先确保升级nacos-client API,然后在pom.xml中添加依赖。接着,在application.properties或application.yaml中设置Nacos发现服务的用户名和密码。同时,在bootstrap.properties或bootstrap.yaml中配置Nacos配置服务的用户名、密码和contextPath。
摘要由CSDN通过智能技术生成

Introduction

This issue will help you how to configure Spring Cloud Alibaba application(s) working on Nacos Server 1.2.0+ with authentication.
Prerequisites

Nacos Server 1.2.0+ enabing authentication feature [Guide]
Spring Cloud Alibaba 2.2.0.RELEASE using artifcats
    com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery
    com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config

How to configure
Upgrading the nacos-client API

Upgrading the com.alibaba.nacos:nacos-client API into the dependencies of pom.xml

    <dependency>
        <groupId>com.alibaba.nacos</groupId>
        <artifactId>nacos-client</artifactId>
        <version>1.2.1</version>
    </dependency>

Adding the externalized properties

For Spring Cloud Alibaba Nacos Discovery

Adding folloing properties into application.prop

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值