当前位置:网站首页>Establishment and operation of cloud platform open source project environment
Establishment and operation of cloud platform open source project environment
2022-07-06 06:57:00 【chengqiuming】
One Project location
edition :v2.7
Two Project information
3、 ... and Correspondence between front and back ends
Source location
https://gitee.com/geek_qihttps://gitee.com/geek_qi/cloud-platform
Because it involves the first and second generation projects , It's easy to get the version relationship wrong , Here, let's sort out the version correspondence .
Version Description | front end | Back end | stability |
first generation | project :Cloud-Platform-UI Branch :master | project :Cloud-Platform Branch :v2.7 | The final version of the first generation |
Second generation | project :Cloud-Platform-UI-v2 Branch :dev | project :Cloud-Platform Branch :master | The latest version under development |
This article introduces the first generation .
Four Project introduction
1 Project brief introduction
Cloud-Platform It is the first one in China based on Spring Cloud Microservice service development platform , With unified authorization 、 Authentication background management system , Including user management 、 Resource rights management 、 gateway API Management and other modules , Support parallel development of multi service system , Development scaffolding that can be used as back-end services .
The code is concise , Clear architecture , Suitable for use in learning and direct projects .
Core technology adoption Spring Boot 2.1.2 as well as Spring Cloud (Greenwich.RELEASE) Related core components , use Nacos Registration and configuration center , Integrated traffic guard Sentinel, The front end uses vue-element-admin Components ,Elastic Search Self Integration .
2 Technology selection
- front end :vue-element-admin
- Back end :springcloud(gateway、admin、sidecar、Hystrix、feign、ribbon、zipkin)、tk+mybatis、lucene、jwt、rest、Nacos
3 Project structure
ace-security
ace-modules-------------- Public service module ( Based system 、 Search for 、OSS、 Business module )
ace-auth----------------- Service Authentication Center
ace-gate----------------- Gateway load center
ace-common--------------- General purpose scaffolding ( All kinds of tools )
ace-control-------------- Operation and maintenance center ( monitor 、 link 、 Registry Center )
ace-sidebar-------------- Call a third-party language service
4 front end
4.1 Download location
4.2 Start and run
# 1 Installation of Taobao image depends on
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 2 Installation project dependency
cnpm install
# 3 Start the service
npm run dev
After successful startup, the link will be opened automatically :http://localhost:9527/
5、 ... and Construction and operation of development environment
1 use Idea Open the project
The relationship between the primary module and the secondary module is as follows
2 Import data into database
Import 3 A database
3 Start in turn nacos and redis
4 AuthBootstrap Start of
4.1 To configure AuthBootstrap Configuration file for
Start with simplicity , Configure more complex functions later
spring:
application:
name: ace-auth
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
default-property-inclusion: non_null
redis:
database: 2
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
pool:
max-active: 20
datasource:
name: test
url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/ag_auth_v1?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=UTC
username: root
password: Mima123456
# Use druid data source
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
mybatis:
basepackage: com.github.wxiaoqi.security.auth.mapper
xmlLocation: classpath:mapper/**/*.xml
mapper-locations: "classpath*:mapper/*.xml"
server:
port: 9777 # Start port
feign:
httpclient:
enabled: false
okhttp:
enabled: true
ribbon:
eureka:
enabled: true
ReadTimeout: 60000
ConnectTimeout: 60000
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 1
OkToRetryOnAllOperations: false
hystrix:
threadpool:
default:
coreSize: 1000 ## The maximum number of concurrent threads , Default 10
maxQueueSize: 1000 ##BlockingQueue The maximum number of queues
queueSizeRejectionThreshold: 500 ## Even if maxQueueSize Don't reach , achieve queueSizeRejectionThreshold After this value , Requests will also be rejected
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
jwt:
token-header: Authorization
expire: 14400
rsa-secret: xx1WET12^%3^(WE45
client:
id: ace-auth
secret: 123456
token-header: x-client-token
expire: 14400
rsa-secret: x2318^^(*WRYQWR(QW&T
logging:
level:
# tk.mybatis: DEBUG
com.github.wxiaoqi.security.auth: DEBUG
management:
endpoints:
web:
exposure:
include: '*'
security:
enabled: false
4.2 start-up AuthBootstrap
4.3 nacos Observe service status
5 AdminBootstrap Start of
5.1 Modify the configuration file
Start with simplicity , Configure more complex functions later
logging:
level:
# tk.mybatis: DEBUG
com.github.wxiaoqi.security.admin: DEBUG
spring:
application:
name: ace-admin
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
default-property-inclusion: non_null
datasource:
name: test
url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/ag_admin_v1?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=UTC
username: root
password: Mima123456
# Use druid data source
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
sentinel:
transport:
dashboard: localhost:8080
mybatis:
basepackage: com.github.wxiaoqi.security.admin.mapper
xmlLocation: classpath:mapper/**/*.xml
mapper-locations: "classpath*:mapper/*.xml"
server:
port: 8762
# You have to configure
feign:
httpclient:
enabled: false
okhttp:
enabled: true
ribbon:
eureka:
enabled: true
ReadTimeout: 100000
ConnectTimeout: 100000
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 1
OkToRetryOnAllOperations: false
hystrix:
threadpool:
default:
coreSize: 1000 ## The maximum number of concurrent threads , Default 10
maxQueueSize: 1000 ##BlockingQueue The maximum number of queues
queueSizeRejectionThreshold: 500 ## Even if maxQueueSize Don't reach , achieve queueSizeRejectionThreshold After this value , Requests will also be rejected
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 110000
# To configure swagger
swagger:
enabled: true
base-package: com.github.wxiaoqi.security.admin
title: ace-admin
version: 1.0.0.SNAPSHOT
description: Manage back-end services
contact:
name: admin
auth:
serviceId: ace-auth
user:
token-header: Authorization
client:
id: ace-admin
secret: 123456
token-header: x-client-token
# redis-cache relevant
redis:
pool:
maxActive: 300
maxIdle: 100
maxWait: 1000
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password:
timeout: 2000
# Service or application name
sysName: ace-admin
enable: true
database: 0
management:
endpoints:
web:
exposure:
include: '*'
security:
enabled: false
5.2 nacos Observe service status
6 GatewayServerBootstrap Start of
6.1 Modify the configuration file
Start with simplicity , Configure more complex functions later
server:
port: 8765
# Requests and responses GZIP Compression support
feign:
httpclient:
enabled: false
okhttp:
enabled: true
compression:
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response:
enabled: true
spring:
application:
name: ace-gateway
redis:
database: 2
host: 127.0.0.1
jedis:
pool:
max-active: 20
rabbitmq:
host: ${RABBIT_MQ_HOST:localhost}
port: ${RABBIT_MQ_PORT:5672}
username: guest
password: guest
sleuth:
enabled: true
http:
legacy:
enabled: true
cloud:
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# =====================================
- id: ace-auth
uri: lb://ace-auth
order: 8000
predicates:
- Path=/api/auth/**
filters:
- StripPrefix=2
- id: ace-admin
uri: lb://ace-admin
order: 8001
predicates:
- Path=/api/admin/**
filters:
- StripPrefix=2
nacos:
discovery:
server-addr: 127.0.0.1:8848
sentinel:
transport:
dashboard: localhost:8080
logging:
level:
com.github.wxiaoqi.security.gate.v2: info
management:
endpoints:
web:
exposure:
include: '*'
security:
enabled: false
gate:
ignore:
startWith: /auth/jwt
auth:
serviceId: ace-auth
user:
token-header: Authorization
client:
token-header: x-client-token
id: ace-gate # If it is not filled in, it will read by default spring.application.name
secret: 123456
ribbon:
eureka:
enabled: true
ReadTimeout: 60000
ConnectTimeout: 60000
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 1
OkToRetryOnAllOperations: false
hystrix:
threadpool:
default:
coreSize: 1000 ## The maximum number of concurrent threads , Default 10
maxQueueSize: 1000 ##BlockingQueue The maximum number of queues
queueSizeRejectionThreshold: 500 ## Even if maxQueueSize Don't reach , achieve queueSizeRejectionThreshold After this value , Requests will also be rejected
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
6.2 nacos Observe service status
6、 ... and Front end login
After the backend service is started , You can start debugging the front end .
1 Browser input http://localhost:9527/
2 The username and password are both admin
3 How it looks after login
7、 ... and Problem records and solutions
1 start-up AuthBootstrap newspaper Failure to find org.eclipse.m2e:lifecycle-mapping:pom:1.0.0
2 start-up AuthBootstrap newspaper java.sql.SQLException: is unrecognized or represents more than one time zone. You must configure
边栏推荐
- 18.多级页表与快表
- Attributeerror: can 't get attribute' sppf 'on < module' models. Common 'from' / home / yolov5 / Models / comm
- 这个高颜值的开源第三方网易云音乐播放器你值得拥有
- WPF之MVVM
- 【Hot100】739. 每日溫度
- [server data recovery] case of offline data recovery of two hard disks of IBM server RAID5
- Misc of BUU (update from time to time)
- 【服务器数据恢复】IBM服务器raid5两块硬盘离线数据恢复案例
- 接口自动化测试框架:Pytest+Allure+Excel
- Pymongo gets a list of data
猜你喜欢
BUU的MISC(不定时更新)
[daily question] 729 My schedule I
顶测分享:想转行,这些问题一定要考虑清楚!
win10 64位装三菱PLC软件出现oleaut32.dll拒绝访问
Top test sharing: if you want to change careers, you must consider these issues clearly!
At the age of 26, I changed my career from finance to software testing. After four years of precipitation, I have been a 25K Test Development Engineer
Introduction and underlying analysis of regular expressions
leetcode35. 搜索插入位置(简单,找插入位置,不同写法)
接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
Short video, more and more boring?
随机推荐
MySQL high frequency interview 20 questions, necessary (important)
Entity Developer数据库应用程序的开发
Applied stochastic process 01: basic concepts of stochastic process
Database basics exercise part 2
Librosa audio processing tutorial
Refer to how customer push e-commerce does content operation
Cif10 actual combat (resnet18)
Attributeerror: can 't get attribute' sppf 'on < module' models. Common 'from' / home / yolov5 / Models / comm
Fedora/rehl installation semanage
机器学习植物叶片识别
Is it difficult for girls to learn software testing? The threshold for entry is low, and learning is relatively simple
Blue Bridge Cup zero Foundation National Championship - day 20
【服务器数据恢复】IBM服务器raid5两块硬盘离线数据恢复案例
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
leetcode1020. 飞地的数量(中等)
pymongo获取一列数据
接口自动化测试实践指导(上):接口自动化需要做哪些准备工作
PCL实现选框裁剪点云
Facebook AI & Oxford proposed a video transformer with "track attention" to perform SOTA in video action recognition tasks