mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
nacos server本地化采用jar方式启动,简化开发
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package com.alibaba.nacos;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* Nacos 启动类
|
||||
* 引用的nacos console 源码运行,简化开发
|
||||
* 生产建议从官网下载最新版配置运行
|
||||
* @author zyf
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = "com.alibaba.nacos")
|
||||
@ServletComponentScan
|
||||
@EnableScheduling
|
||||
public class JeecgNacosApplication {
|
||||
|
||||
/**
|
||||
* 是否单机模式启动
|
||||
*/
|
||||
private static String standalone = "true";
|
||||
|
||||
/**
|
||||
* 是否开启鉴权
|
||||
*/
|
||||
private static String enabled = "false";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("nacos.standalone", standalone);
|
||||
System.setProperty("nacos.core.auth.enabled", enabled);
|
||||
SpringApplication.run(JeecgNacosApplication.class, args);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
server:
|
||||
port: 8848
|
||||
tomcat:
|
||||
basedir: logs
|
||||
|
||||
db:
|
||||
num: 1
|
||||
user: ${MYSQL-USER:root}
|
||||
password: ${MYSQL-PWD:root}
|
||||
url:
|
||||
0: jdbc:mysql://${MYSQL-HOST:jeecg-boot-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:nacos}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
nacos:
|
||||
core:
|
||||
auth:
|
||||
system.type: nacos
|
||||
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
security:
|
||||
ignore:
|
||||
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
platform: mysql
|
||||
security:
|
||||
enabled: true
|
||||
|
||||
useAddressServer: true
|
||||
|
||||
Reference in New Issue
Block a user