Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
1095071913 committed Mar 3, 2023
1 parent 2962266 commit 1be3ecc
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 109 deletions.
11 changes: 1 addition & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Log file
*.log
log.log*

# BlueJ files
*.ctxt
Expand All @@ -19,7 +18,7 @@ log.log*
*.zip
*.tar.gz
*.rar
*.class

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

Expand All @@ -37,11 +36,3 @@ target

# Spring Tool Suits project environment #
.sts4-cache
/zhongshi-etc-service-rest-api-users/target
/zhongshi-etc-service-rpc-api-users/target
/.idea
/zhongshi-etc-service-users/target
/zhongshi-etc-users-do/target
/.idea
/zhongshi-etc-users-dto/target
/zhongshi-etc-users-vo/target
171 changes: 171 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Nacos配置

<br/>

**Nacos地址默认为localhost:8081,若不是则添加环境变量NACOS_CONFIG_SERVER**

或找到 src/main/resources/bootstrap.properties 添加

```
spring.cloud.nacos.config.server-addr=localhost:8081
```

<br/>

## 配置说明

<br/>

**服务端配置:maozi-cloud-bootadmin.yml**

```
application-port: 8000
spring:
security:
user:
name: admin
password: admin
boot:
admin:
discovery:
services: maozi-cloud-*
ui:
external-views:
- label: "注册中心"
url: "http://localhost:8848/nacos/#/configurationManagement?dataId=&group=&appName=&namespace=&pageSize=&pageNo="
iframe: true
order: 2002
- label: "接口文档"
url: "https://localhost:10000/doc.html"
iframe: true
order: 2003
- label: "容器管理"
url: "http://localhost:9000"
iframe: true
order: 2004
- label: "Arthas管理"
url: "http://localhost:9080"
iframe: true
order: 2005
```

<br/>

**客户端配置:boot-admin.yml**

```
spring:
security:
user:
name: admin
password: admin
boot:
admin:
discovery:
services: maozi-cloud-*
client:
# url: http://localhost:8000
username: admin
password: admin
# auto-deregistration: true
# instance:
# prefer-ip: true
# metadata:
# tags:
# environment: 本地
endpoints:
dubbo:
enabled: true
management:
info.env.enabled: true
health:
dubbo:
status:
defaults: memory
extras: load,threadpool
endpoints:
web:
exposure:
include: '*'
endpoint:
dubbo:
enabled: true
dubbo-shutdown:
enabled: true
dubbo-configs:
enabled: true
dubbo-services:
enabled: true
dubbo-references:
enabled: true
dubbo-properties:
enabled: true
health:
show-details: ALWAYS
```

<br/>

**参数说明:https://codecentric.github.io/spring-boot-admin/2.6.9/**

<br/>

<br/>

# 即可启动

**访问localhost:8000即可进入监控面板**

<br/>

<br/>

<br/>

# 扩展Arthas

<br/>

编写docker-compose.yml

```yaml
version: '3'
services:
arthas-tunnel-server:
environment:
# 开放管理页面有风险!管理页面没有安全拦截功能,务必自行增加安全措施
PARAMS: '--arthas.enable-detail-pages=true --spring.cache.type=redis --arthas.embedded-redis.enabled=true --spring.redis.host=localhost --spring.redis.port=6379 --spring.redis.password=812840531zhang'
restart: always
image: registry.cn-shanghai.aliyuncs.com/wanfei/arthas-tunnel-server:v1
container_name: arthas-tunnel-server
ports:
- 9080:8080
- 7777:7777
```
**将PARAMS里的Redis参数改成自己的**
执行docker-compose up -d即可
<br/>
## Arthas Nacos配置
**boot-arthas.yml**
```
arthas:
agent-id: ${spring.application.name}
# Arthas地址
tunnel-server: ws://localhost:7777/ws
telnet-port: -1
http-port: -1
```
94 changes: 15 additions & 79 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

<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.jiumao</groupId>
<artifactId>jiumao-saas-parent</artifactId>
<groupId>com.maozi</groupId>
<artifactId>maozi-cloud-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
</parent>
<artifactId>jiumao-saas-basics-bootadmin</artifactId>
<artifactId>maozi-cloud-basics-bootadmin</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<application-run>com.jiumao.BootAdminApplication</application-run>
<application-run>com.maozi.BootAdminApplication</application-run>
</properties>


Expand Down Expand Up @@ -63,9 +64,9 @@

<!-- Project Begin -->
<dependency>
<groupId>com.jiumao</groupId>
<artifactId>jiumao-saas-config-mvc</artifactId>
<version>${jiumao-saas-config-mvc.version}</version>
<groupId>com.maozi</groupId>
<artifactId>maozi-cloud-config-mvc</artifactId>
<version>${maozi-cloud-config-mvc.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
Expand All @@ -75,9 +76,9 @@
</dependency>

<dependency>
<groupId>com.jiumao</groupId>
<artifactId>jiumao-saas-service-base-run</artifactId>
<version>${jiumao-saas-service-base-run.version}</version>
<groupId>com.maozi</groupId>
<artifactId>maozi-cloud-service-base-run</artifactId>
<version>${maozi-cloud-service-base-run.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
Expand All @@ -86,62 +87,11 @@
</exclusions>
</dependency>
<!-- Project Begin -->






</dependencies>







<distributionManagement>
<repository>
<id>maven-releases</id>
<name>Nexus Release Repository</name>
<url>http://175.178.52.106:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://175.178.52.106:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>maven-public</id>
<name>Nexus Repository</name>
<url>http://175.178.52.106:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-public</id>
<name>Nexus Plugin Repository</name>
<url>http://175.178.52.106:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>








<!-- boot打包 Begin -->
<build>
Expand All @@ -150,7 +100,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.5.RELEASE</version>
<version>3.0.2</version>
<configuration>
<mainClass>${application-run}</mainClass>
</configuration>
Expand All @@ -161,20 +111,6 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.6.RELEASE</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.jiumao;
package com.maozi;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.jiumao.config;
package com.maozi.config;

import org.springframework.context.annotation.Configuration;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//package com.jiumao.config;
package com.maozi.config;
//package com.maozi.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//package com.jiumao.config;
package com.maozi.config;
//package com.maozi.config;
//
//import java.util.UUID;
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jiumao.log.convert;
package com.maozi.log.convert;

import com.jiumao.tool.ApplicationEnvironmentConfig;
import com.maozi.tool.ApplicationEnvironmentConfig;

import ch.qos.logback.classic.pattern.MessageConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jiumao.log.convert;
package com.maozi.log.convert;

import com.jiumao.tool.ApplicationEnvironmentConfig;
import com.maozi.tool.ApplicationEnvironmentConfig;

import ch.qos.logback.classic.pattern.MessageConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
Expand Down
Loading

0 comments on commit 1be3ecc

Please sign in to comment.