当前位置:网站首页>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
边栏推荐
- Applied stochastic process 01: basic concepts of stochastic process
- A brief introduction of reverseme in misc in the world of attack and defense
- MySQL high frequency interview 20 questions, necessary (important)
- The registration password of day 239/300 is 8~14 alphanumeric and punctuation, and at least 2 checks are included
- 成功解决TypeError: data type ‘category‘ not understood
- 【Hot100】739. 每日温度
- C language_ Double create, pre insert, post insert, traverse, delete
- Huawei equipment configuration ospf-bgp linkage
- 简单描述 MySQL 中,索引,主键,唯一索引,联合索引 的区别,对数据库的性能有什么影响(从读写两方面)
- 【每日一题】729. 我的日程安排表 I
猜你喜欢
How to reconstruct the class explosion caused by m*n strategies?
After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
这个高颜值的开源第三方网易云音乐播放器你值得拥有
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
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
Monotonic stack
Machine learning plant leaf recognition
Apache dolphin scheduler source code analysis (super detailed)
What is the difference between int (1) and int (10)? Senior developers can't tell!
[brush questions] how can we correctly meet the interview?
随机推荐
Three methods of adding color to latex text
Database basics exercise part 2
Short video, more and more boring?
机器学习植物叶片识别
同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
Market segmentation of supermarket customers based on purchase behavior data (RFM model)
Day 248/300 thoughts on how graduates find jobs
Facebook AI & Oxford proposed a video transformer with "track attention" to perform SOTA in video action recognition tasks
医疗软件检测机构怎么找,一航软件测评是专家
因高额网络费用,Arbitrum 奥德赛活动暂停,Nitro 发行迫在眉睫
L'Ia dans les nuages rend la recherche géoscientifique plus facile
Zhongqing reading news
成功解决TypeError: data type ‘category‘ not understood
开源的网易云音乐API项目都是怎么实现的?
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
Blue Bridge Cup zero Foundation National Championship - day 20
18.多级页表与快表
Introduction and underlying analysis of regular expressions
Arduino tutorial - Simon games