Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sctj
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
sctj
Commits
a80890f3
提交
a80890f3
authored
9月 16, 2019
作者:
yangdongming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
b17b2889
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
337 行增加
和
0 行删除
+337
-0
.classpath
com.zrqx.eureka/.classpath
+36
-0
.project
com.zrqx.eureka/.project
+35
-0
pom.xml
com.zrqx.eureka/pom.xml
+30
-0
ServerApplication.java
...reka/src/main/java/com/zrqx/eureka/ServerApplication.java
+17
-0
WebSecurityConfig.java
...c/main/java/com/zrqx/eureka/config/WebSecurityConfig.java
+16
-0
application.yml
com.zrqx.eureka/src/main/resources/application.yml
+21
-0
assembly.xml
com.zrqx.eureka/src/main/resources/assembly.xml
+45
-0
bootstrap.yml
com.zrqx.eureka/src/main/resources/bootstrap.yml
+3
-0
logback.xml
com.zrqx.eureka/src/main/resources/logback.xml
+134
-0
没有找到文件。
com.zrqx.eureka/.classpath
0 → 100644
浏览文件 @
a80890f3
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
output=
"target/classes"
path=
"src/main/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/classes"
path=
"src/main/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"target/test-classes"
path=
"src/test/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/test-classes"
path=
"src/test/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"output"
path=
"target/classes"
/>
</classpath>
com.zrqx.eureka/.project
0 → 100644
浏览文件 @
a80890f3
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
com.zrqx.eureka
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.wst.common.project.facet.core.builder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
com.genuitec.eclipse.springframework.springbuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.m2e.core.maven2Builder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
com.genuitec.eclipse.springframework.springnature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
<nature>
org.eclipse.wst.common.project.facet.core.nature
</nature>
</natures>
</projectDescription>
com.zrqx.eureka/pom.xml
0 → 100644
浏览文件 @
a80890f3
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.zrqx
</groupId>
<artifactId>
com.zrqx.pom
</artifactId>
<version>
4.0.0
</version>
<relativePath>
../com.zrqx.pom/pom.xml
</relativePath>
</parent>
<artifactId>
com.zrqx.eureka
</artifactId>
<name>
com.zrqx.eureka
</name>
<url>
http://maven.apache.org
</url>
<dependencies>
<!--增加eureka-server的依赖 -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
</dependency>
<!-- 用于注册中心访问账号认证 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
com.zrqx.eureka/src/main/java/com/zrqx/eureka/ServerApplication.java
0 → 100644
浏览文件 @
a80890f3
package
com
.
zrqx
.
eureka
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.server.EnableEurekaServer
;
@EnableEurekaServer
// 启动一个服务注册中心提供给其他应用进行对话
@SpringBootApplication
public
class
ServerApplication
{
public
static
void
main
(
String
[]
args
)
{
// 下面两行代码都可以用来启动
SpringApplication
.
run
(
ServerApplication
.
class
,
args
);
// new SpringApplicationBuilder(Application.class).web(true).run(args);
}
}
\ No newline at end of file
com.zrqx.eureka/src/main/java/com/zrqx/eureka/config/WebSecurityConfig.java
0 → 100644
浏览文件 @
a80890f3
package
com
.
zrqx
.
eureka
.
config
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
@EnableWebSecurity
public
class
WebSecurityConfig
extends
WebSecurityConfigurerAdapter
{
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
().
ignoringAntMatchers
(
"/eureka/**"
);
super
.
configure
(
http
);
}
}
\ No newline at end of file
com.zrqx.eureka/src/main/resources/application.yml
0 → 100644
浏览文件 @
a80890f3
spring
:
security
:
basic
:
enabled
:
true
#开启认证
user
:
name
:
user
password
:
123456
eureka
:
server
:
enable-self-preservation
:
false
# 测试时关闭自我保护机制,保证不可用服务及时踢出
instance
:
preferIpAddress
:
true
hostname
:
localhost
lease-renewal-interval-in-seconds
:
1
# 每间隔1s,向服务端发送一次心跳,证明自己依然”存活“
lease-expiration-duration-in-seconds
:
5
# 告诉服务端,如果我5s之内没有给你发心跳,就代表我“死”了,将我踢出掉。
client
:
registerWithEureka
:
false
fetchRegistry
:
false
serviceUrl
:
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
com.zrqx.eureka/src/main/resources/assembly.xml
0 → 100644
浏览文件 @
a80890f3
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"
>
<id>
package
</id>
<formats>
<format>
zip
</format>
</formats>
<includeBaseDirectory>
false
</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>
${basedir}/src/main/resources
</directory>
<includes>
<include>
*.yml
</include>
<include>
*.xml
</include>
<include>
static/**
</include>
<include>
templates/**
</include>
<include>
*.properties
</include>
<include>
*.txt
</include>
</includes>
<filtered>
true
</filtered>
<outputDirectory>
${file.separator}${project.artifactId}
</outputDirectory>
</fileSet>
<fileSet>
<directory>
src/main/resources/runScript
</directory>
<outputDirectory>
${file.separator}bin
</outputDirectory>
</fileSet>
<fileSet>
<directory>
${project.build.directory}/lib
</directory>
<outputDirectory>
${file.separator}${project.artifactId}/lib
</outputDirectory>
<includes>
<include>
*.jar
</include>
</includes>
</fileSet>
<fileSet>
<directory>
${project.build.directory}/
</directory>
<outputDirectory>
${file.separator}${project.artifactId}
</outputDirectory>
<includes>
<include>
*.jar
</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
com.zrqx.eureka/src/main/resources/bootstrap.yml
0 → 100644
浏览文件 @
a80890f3
server
:
port
:
8961
\ No newline at end of file
com.zrqx.eureka/src/main/resources/logback.xml
0 → 100644
浏览文件 @
a80890f3
<?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://www.padual.com/java/logback.xsd"
debug=
"false"
scan=
"true"
scanPeriod=
"30 second"
>
<property
name=
"ROOT"
value=
"/opt/logs/rstk/eureka/"
/>
<property
name=
"FILESIZE"
value=
"10MB"
/>
<property
name=
"MAXHISTORY"
value=
"10"
/>
<timestamp
key=
"DATETIME"
datePattern=
"yyyy-MM-dd HH:mm:ss"
/>
<!-- 控制台打印 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
</appender>
<!-- ERROR 输入到文件,按日期和文件大小 -->
<appender
name=
"ERROR"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${ROOT}%d/error.%i.log
</fileNamePattern>
<maxHistory>
${MAXHISTORY}
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${FILESIZE}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!-- WARN 输入到文件,按日期和文件大小 -->
<appender
name=
"WARN"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
WARN
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${ROOT}%d/warn.%i.log
</fileNamePattern>
<maxHistory>
${MAXHISTORY}
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${FILESIZE}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!-- INFO 输入到文件,按日期和文件大小 -->
<appender
name=
"INFO"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
INFO
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${ROOT}%d/info.%i.log
</fileNamePattern>
<maxHistory>
${MAXHISTORY}
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${FILESIZE}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!-- DEBUG 输入到文件,按日期和文件大小 -->
<appender
name=
"DEBUG"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
DEBUG
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${ROOT}%d/debug.%i.log
</fileNamePattern>
<maxHistory>
${MAXHISTORY}
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${FILESIZE}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!-- TRACE 输入到文件,按日期和文件大小 -->
<appender
name=
"TRACE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder
charset=
"utf-8"
>
<pattern>
[%-5level] %d{${DATETIME}} [%thread] %logger{36} - %m%n
</pattern>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
TRACE
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${ROOT}%d/trace.%i.log
</fileNamePattern>
<maxHistory>
${MAXHISTORY}
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${FILESIZE}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<!-- Logger 根目录 -->
<root
level=
"INFO"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"DEBUG"
/>
<appender-ref
ref=
"ERROR"
/>
<appender-ref
ref=
"WARN"
/>
<appender-ref
ref=
"INFO"
/>
<appender-ref
ref=
"TRACE"
/>
</root>
</configuration>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论