Nacos源码阅读搭建(idea)
Nacos源码阅读搭建(idea)
克隆源码
在github上搜索nancos,克隆代码,详细不再赘述。
搭建maven环境
百度搜索,也不再赘述。
下载源码
mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
程序入口
在console模块下
└─src├─main│ ├─java│ │ └─com│ │ └─alibaba│ │ └─nacos│ │ └─console| | ├─**Nacos.java**│ │ ├─config│ │ ├─controller│ │ ├─exception│ │ ├─filter│ │ ├─model│ │ ├─security│ │ │ └─nacos│ │ │ ├─roles│ │ │ └─users│ │ └─utils
@SpringBootApplication(scanBasePackages = "com.alibaba.nacos")
@ServletComponentScan
@EnableScheduling
public class Nacos {public static void main(String[] args) {SpringApplication.run(Nacos.class, args);}
}
导入数据库
在distribution\conf下有nacos-mysql.sql,导入
├─distribution
│ ├─bin
│ └─conf
修改配置文件
### 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/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=czy123456
修改命令参数
修改vm option参数,单机模式
-Dnacos.standalone=true -Dnacos.home=D:/DevelopData/JavaProject/nacos/distribution
启动
2021-06-13 19:03:39.586 INFO 10440 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@38a1a26' 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)
2021-06-13 19:03:39.595 INFO 10440 --- [ main] trationDelegate$BeanPostProcessorChecker : 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)
2021-06-13 19:03:40.239 INFO 10440 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8848 (http)
有这些log就表示成功了。
最新文章
- java interface接口和多继承
- 什么是 AQS ?
- Java技术之AQS详解
- CStudioFile文件的输出
- BMP280读不出数据(附驱动),数据一直不变解决方法,硬件I2C
- 建立NFS服务器
- JMS(Java Messaging Service)基础
- 我和ChatGPT pair 整理的测试类型清单
- HashMap扩容时的rehash方法中(e.hasholdCap) == 0算法推导
- 详解CDQ算法
- 【数字图像处理】秒懂傅里叶变换,仅需此文
- 超好玩的mac模拟经营游戏:巨型水族馆中文版
- python反爬虫原理与绕过实战pdf
- 微信小程序真机调试,苹果用户记得打开本地网络
- 开发数据可视化,有哪些数据可视化表现形式?
- TensorFlow学习日记之tflearn
- 大班韵律机器人视频
- MySQL
- H.265视频流媒体EasyPlayer播放器无法禁用自动播放的问题修复
- JScript 方法