当前位置:网站首页>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_qi
https://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: false4.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: false5.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: 100006.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
边栏推荐
- [hot100] 739. Température quotidienne
- AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
- Simple use of MySQL database: add, delete, modify and query
- Introduction to ros2 installation and basic knowledge
- 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
- 同事上了个厕所,我帮产品妹子轻松完成BI数据产品顺便得到奶茶奖励
- 成功解决TypeError: data type ‘category‘ not understood
- [advanced software testing step 1] basic knowledge of automated testing
- 云上有AI,让地球科学研究更省力
- Fast target recognition based on pytorch and fast RCNN
猜你喜欢

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

AI on the cloud makes earth science research easier

C language_ Double create, pre insert, post insert, traverse, delete

【每日一题】729. 我的日程安排表 I

Development of entity developer database application

What is the biggest problem that fresh e-commerce is difficult to do now

win10 64位装三菱PLC软件出现oleaut32.dll拒绝访问

Simple use of MySQL database: add, delete, modify and query

What is the difference between int (1) and int (10)? Senior developers can't tell!

万丈高楼平地起,每个API皆根基
随机推荐
The registration password of day 239/300 is 8~14 alphanumeric and punctuation, and at least 2 checks are included
26岁从财务转行软件测试,4年沉淀我已经是25k的测开工程师...
A brief introduction of reverseme in misc in the world of attack and defense
Depth residual network
Call, apply, bind rewrite, easy to understand with comments
Erreur de type résolue avec succès: type de données « catégorie» non sous - jacente
[Yu Yue education] flower cultivation reference materials of Weifang Vocational College
Development of entity developer database application
BIO模型实现多人聊天
Short video, more and more boring?
Apache dolphin scheduler source code analysis (super detailed)
Windows Server 2016 standard installing Oracle
Prefix and array series
LeetCode Algorithm 2181. 合并零之间的节点
Pallet management in SAP SD delivery process
UWA pipeline version 2.2.1 update instructions
leetcode704. 二分查找(查找某个元素,简单,不同写法)
Visitor tweets about how you can layout the metauniverse
Leetcode - 152 product maximum subarray
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