提交 41380ae1 编写于 作者: M ManongJu

整理项目结构

上级 b79851a6
......@@ -12,13 +12,13 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>register</name>
<name>mss-eureka</name>
<description>Demo project for Spring Boot</description>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......
server:
port: 9010
spring:
application:
##name必须一样,不然高可用会导致unavailable-replicas
name: mss-eureka
eureka:
instance:
hostname: mss-eureka1
client:
##这里要覆盖application的设置,不然会读取application文件导致unavailable-replicas
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://mss-eureka2:9011/eureka/
\ No newline at end of file
server:
port: 9011
spring:
application:
name: mss-eureka
eureka:
instance:
hostname: mss-eureka2
client:
##这里要覆盖application的设置,不然会读取application文件导致unavailable-replicas
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://mss-eureka1:9010/eureka/
\ No newline at end of file
......@@ -2,17 +2,19 @@ server:
port: 9010
spring:
application:
name: register
name: mss-eureka
eureka:
instance:
hostname: register
hostname: mss-eureka
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
# server:
# eviction-interval-timer-in-ms: 5000 #### 清理间隔(单位毫秒,默认是60*1000),开发环境设置如下可快速移除不可用的服务
server:
#### 清理间隔(单位毫秒,默认是60*1000),开发环境设置如下可快速移除不可用的服务
eviction-interval-timer-in-ms: 5000
enable-self-preservation: false
###actuator监控点 start####
endpoints:
health:
......@@ -22,10 +24,4 @@ endpoints:
management:
security:
enabled: false
###actuator监控点 end####
logging:
config: classpath:logback.xml
level:
org:
springframework:
web: info
\ No newline at end of file
###actuator监控点 end####
\ No newline at end of file
......@@ -54,7 +54,7 @@
<appender-ref ref="SQL"/>
</logger>
<logger name="org.springframework.web.servlet.mvc" level="info"/>
<root level="WARN">
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
<appender-ref ref="ERROR_FILE"/>
......
......@@ -12,7 +12,7 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>gateway</name>
<name>mss-gateway</name>
<description>Demo project for Spring Boot</description>
<dependencies>
......
spring:
application:
name: Gateway
name: mss-gateway
zipkin:
base-url: http://10.10.8.2:9050
base-url: http://localhost:9050
server:
port: 9030
eureka:
instance:
prefer-ip-address: true #使用IP注册
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
##续约更新时间间隔设置5秒,m默认30s
lease-renewal-interval-in-seconds: 5
##续约到期时间10秒,默认是90秒
lease-expiration-duration-in-seconds: 10
client:
service-url:
defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/
defaultZone: http://mss-eureka1:9010/eureka/,http://mss-eureka2:9011/eureka/
###actuator监控点 start####
endpoints:
health:
......@@ -43,10 +47,10 @@ security:
enabled: false
oauth2:
client:
access-token-uri: http://10.10.8.2:9030/uaa/oauth/token ##网关的地址
user-authorization-uri: http://10.10.8.2:9030/uaa/oauth/authorize
access-token-uri: http://localhost:9030/uaa/oauth/token ##网关的地址
user-authorization-uri: http://localhost:9030/uaa/oauth/authorize
resource:
user-info-uri: http://10.10.8.2:9030/uaa/user
user-info-uri: http://localhost:9030/uaa/user
prefer-token-info: false
##############end#####################
####超时配置####
......
......@@ -12,7 +12,7 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>monitor</name>
<name>mss-monitor</name>
<description>Demo project for Spring Boot</description>
<dependencies>
......
......@@ -5,24 +5,20 @@ spring:
name: micro-service-monitor
eureka:
instance:
prefer-ip-address: true #使用IP注册
prefer-ip-address: true
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
lease-renewal-interval-in-seconds: 5 ##为了能够快速删除
lease-expiration-duration-in-seconds: 10 ##为了能够快速删除
lease-renewal-interval-in-seconds: 5
lease-expiration-duration-in-seconds: 10
client:
service-url:
defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/
###actuator监控点 start####
defaultZone: http://mss-eureka1:9010/eureka/,http://mss-eureka2:9011/eureka/
endpoints:
health:
sensitive: false
enabled: true
##默认情况下很多端点是不允许访问的,会返回401:Unauthorized
management:
security:
enabled: false
###actuator监控点 end####
turbine:
app-config-list: micro-a-service
cluster-name-expression: "'default'"
\ No newline at end of file
......@@ -12,7 +12,7 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>auth-center</name>
<name>mss-oauth</name>
<description>Demo project for Spring Boot</description>
......
......@@ -5,7 +5,7 @@ spring:
application:
name: auth2.0-center
zipkin:
base-url: http://10.10.8.2:9050
base-url: http://localhost:9050
jpa:
show-sql: true
datasource:
......@@ -22,19 +22,20 @@ eureka:
instance:
prefer-ip-address: true #ʹ��IPע��
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
##续约更新时间间隔设置5秒,m默认30s
lease-renewal-interval-in-seconds: 5
##续约到期时间10秒,默认是90秒
lease-expiration-duration-in-seconds: 10
client:
service-url:
defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/
###actuator��ص� start####
defaultZone: http://mss-eureka1:9010/eureka/,http://mss-eureka2:9011/eureka/
endpoints:
health:
sensitive: false
enabled: true
##Ĭ������ºܶ�˵��Dz�������ʵģ��᷵��401:Unauthorized
management:
security:
enabled: false
###actuator��ص� end####
security:
oauth2:
resource:
......
......@@ -54,7 +54,7 @@
<appender-ref ref="SQL"/>
</logger>
<logger name="org.springframework.web.servlet.mvc" level="info"/>
<root level="WARN">
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
<appender-ref ref="ERROR_FILE"/>
......
......@@ -4,27 +4,28 @@ spring:
application:
name: resource
zipkin:
base-url: http://10.10.8.2:9050
base-url: http://localhost:9050
eureka:
instance:
prefer-ip-address: true #
prefer-ip-address: true
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
##续约更新时间间隔设置5秒,m默认30s
lease-renewal-interval-in-seconds: 5
##续约到期时间10秒,默认是90秒
lease-expiration-duration-in-seconds: 10
client:
service-url:
defaultZone: http://register1:9010/eureka/,http://register2:9011/eureka/
###actuator��ص� start####
defaultZone: http://mss-eureka1:9010/eureka/,http://mss-eureka2:9011/eureka/
endpoints:
health:
sensitive: false
enabled: true
##Ĭ������ºܶ�˵��Dz�������ʵģ��᷵��401:Unauthorized
management:
security:
enabled: false
###actuator��ص� end####
security:
oauth2:
resource:
id: resource
user-info-uri: http://10.10.8.2:9030/uaa/user
user-info-uri: http://localhost:9030/uaa/user
prefer-token-info: false
\ No newline at end of file
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Migwn, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
echo $MAVEN_PROJECTBASEDIR
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"