Nacos入门使用

文章目录

  • Nacos入门使用
  • 一,Windows下安装nacos
  • 二,自定义配置
    • 2.1 使用自定义端口
    • 2.2 配置MySQL
    • 2.3 自定义密码登录
      • 2.3.1 修改数据库
      • 2.3.2 通过页面修改

一,Windows下安装nacos

到 https://github.com/alibaba/nacos/tags寻找合适的版本(我这里选择的是2.0.4),然后下载 nacos-server-2.0.4.zip,,Linux或Mac环境下载 nacos-server-2.0.4.tar.gz

然后在本地选择目录进行解压

由于nacos默认是使用集群环境,因此我们在**\nacos\bin目录下,打开startup,cmd文件,修改第26行

set MODE="cluster"
改成
set MODE="standalone"

然后双击startup.cmd,运行项目

"nacos is starting with standalone",--.,--.'|,--,:  : |                                           Nacos 2.0.4
,`--.'`|  ' :                       ,---.               Running in stand alone mode, All function modules
|   :  :  | |                      '   ,'\   .--.--.    Port: 8848
:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 47524
|   : '  '; | /       \   /     \.   ; ,. :|  :  /`./   Console: http://***:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: :|  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'2022-04-03 22:22:15,422 INFO Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@5a62b2a4' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2022-04-03 22:22:15,426 INFO Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2022-04-03 22:22:15,916 INFO Tomcat initialized with port(s): 8848 (http)2022-04-03 22:22:16,254 INFO Root WebApplicationContext: initialization completed in 3320 ms2022-04-03 22:22:20,821 INFO Initializing ExecutorService 'applicationTaskExecutor'2022-04-03 22:22:20,986 INFO Adding welcome page: class path resource [static/index.html]2022-04-03 22:22:21,453 INFO Creating filter chain: Ant [pattern='/**'], []2022-04-03 22:22:21,488 INFO Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@3c782d8e, org.springframework.security.web.context.SecurityContextPersistenceFilter@4d0753c9, org.springframework.security.web.header.HeaderWriterFilter@7acfb656, org.springframework.security.web.csrf.CsrfFilter@2acbc859, org.springframework.security.web.authentication.logout.LogoutFilter@20411320, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@719bb3b4, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@4d27d9d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@572e6fd9, org.springframework.security.web.session.SessionManagementFilter@55a609dd, org.springframework.security.web.access.ExceptionTranslationFilter@2c6aed22]2022-04-03 22:22:21,571 INFO Initializing ExecutorService 'taskScheduler'2022-04-03 22:22:21,592 INFO Exposing 16 endpoint(s) beneath base path '/actuator'2022-04-03 22:22:21,732 INFO Tomcat started on port(s): 8848 (http) with context path '/nacos'2022-04-03 22:22:21,737 INFO Nacos started successfully in stand alone mode. use embedded storage2022-04-03 22:22:52,576 INFO Initializing Servlet 'dispatcherServlet'2022-04-03 22:22:52,581 INFO Completed initialization in 5 ms

在浏览器访问 http://localhost:8848/nacos,输入账号/密码:nacos/nacos进行登录。

二,自定义配置

2.1 使用自定义端口

修改**\nacos\conf\application.properties文件

server.port=9000

在浏览器访问 http://localhost:9000/nacos,输入账号/密码:nacos/nacos进行登录。

2.2 配置MySQL

修改**\nacos\conf\application.properties文件

#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql### Count of DB:
db.num=1### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/xxx?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root

找到**\nacos\conf\nacos-mysql.sql文件,在MySQL的xxx数据库中导入该文件执行

配置成功,重启

在浏览器访问 http://localhost:9000/nacos,输入账号/密码:nacos/nacos进行登录。

2.3 自定义密码登录

2.3.1 修改数据库

在MySQL的xxx数据库中,找到表users

用户名username是明文,password是BCrypt加密的密文

修改密码可以通过http://www.ab126.com/goju/10822.html等网站生成Bcrypt密码,或者自己编写代码获取

public static void main(String[] args) {System.out.println(new BCryptPasswordEncoder().encode("123456"));
}

记得引进spring-security-crypto依赖

<dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-crypto</artifactId><version>5.6.2</version>
</dependency>

在浏览器访问 http://localhost:9000/nacos,输入账号/密码:nacos/123456进行登录。

2.3.2 通过页面修改

在nacos页面的【权限控制】- 【用户列表】,直接对用户修改密码

Windows下Nacos的安装与使用相关推荐

  1. windows下nodejs express安装及入门网站,视频资料,开源项目介绍

    windows下nodejs express安装及入门网站,视频资料,开源项目介绍,pm2,supervisor,npm,Pomelo,Grunt安装使用注意事项等总结 第一步:下载安装文件 下载地址 ...

  2. windows 下mysql的安装于使用(启动、关闭)

    1.下载Windows (x86, 64-bit), ZIP Archive解压: 2.双击在bin目录里的mysqld.exe dos窗体一闪就没了,这时netstat -an发现port3306已 ...

  3. 在 Linux 和 Windows 下源码安装 Perl

    Perl 是一种功能丰富的计算机程序语言,运行在超过 100 种计算机平台上,适用广泛,从大型机到便携设备,从快速原型创建到大规模可扩展开发.在生物信息分析领域,Perl 主要是做数据预处理.文本处理 ...

  4. Windows下RStudio环境安装

    Windows下RStudio环境安装 # RStudio关键词搜索: # 下载RStudio-1.4.1717.exe # # 一般情况下下载个免费的就好了: # RStudio-1.4.1717. ...

  5. Windows下Rtools环境安装

    Windows下Rtools环境安装 你是否经常见这个提示: WARNING: Rtools is required to build R packages but is not currently ...

  6. Windows下查看已经安装的GPU的情况

    Windows下查看已经安装的GPU的情况 搞到了一块显卡(T4),安装在了Windows上面,那么如何查看显卡的情况那,,,,, 在linux下直接输入nvidia-smi就可以看到GPU的信息的情 ...

  7. php5.3安装memcache,Windows下的Memcache安装 附php5.3的扩展

    Windows下的Memcache安装: 1. 下载memcache的windows稳定版,解压放某个盘下面,比如在c:\memcached 2. 在终端(也即cmd命令界面)下输入 'c:\memc ...

  8. Windows下的Memcache安装

    很多phper不知道如何在Windows下搭建Memcache的开发调试环境,最近个人也在研究Memcache,记录下自己安装搭建的过程. 其实我开始研究Memcache的时候并不知道居然还有memc ...

  9. Windows下Memcached的安装与配置

    Windows下Memcached的安装与配置 安装: 1.下载memcached, http://www.danga.com/memcached/ ; 2.解压,比如放在 D:\memcached- ...

  10. DEDECMS最新5.7版在Windows下的Memcache安装

    一,织梦后台后台设置进入系统后台,在[系统基本参数]下面的"性能选项"卡当中,关于memcache进行如下配置: cfg_memcache_enable : 是否启用memcach ...

最新文章

  1. 项目的简单总结一 -- 关于对贝塞尔和shapelayer结合使用的动画特效
  2. 福利 | 16场精选活动干货、精华笔记、课件分享:数据派独家讲座干货大合集
  3. C语言读写配置文件--转载
  4. XML数据读取——Digester简单使用
  5. 一次堆外OOM问题的排查过程
  6. 老码农吐血建议:2020年,低于1w的程序员要注意了...
  7. 一步步yum安装LNMP,脱坑笔记!!!
  8. python qt信号在qml 的使用_QML使用Python的函数过程解析
  9. 【java】linux命令获取百度的主页-模拟Socket三次握手
  10. 【白皮书分享】2020用户生命周期运营白皮书2.0.pdf(附下载链接)
  11. Ubiquitous Religions
  12. 2NE1 AON北京演唱会
  13. JAVA中计算五子棋平局的算法_输入五子棋棋盘判断输赢或平局—程序设计(C语言)...
  14. Life Restart 人生模拟器 网址
  15. 基于SSM的住院病人监测预警信息管理系统毕业设计源码021054
  16. TLS1.3抓包分析(3)——EncryptedExtentions等
  17. 玩乐|杭州夏季纳凉好去处
  18. 西邮Linux小组免试题揭秘
  19. K-means聚类实现图片分割
  20. 如何写个优秀的Github项目Readme文档?经典模版拿去不谢~

热门文章

  1. python进阶-数据结构和算法
  2. 搭建OPENLDAP代理服务无缝访问AD服务器
  3. 产品经理要懂得直播软件开发两种模式
  4. python处理excel奖金_Python处理excel
  5. Nacos身份绕过漏洞复现(QVD-2023-6271)
  6. 全自动盘式过滤器工作原理
  7. Matlab求解刚性 ODE
  8. 状态栏始终处于加载状态问题原因及解决方法
  9. autojs怎么post协议_autojs QQ群post签到(六)
  10. 生活中如何靠行走来健身减肥