
@byxiaoxie3 年前
05/29
14:29
搭建环境:系统 Windows 7 硬盘80G 内存16G (服务较多内存要求高)
外网访问开放端口 [8082,8085,8086,9998,9999]
必须按照顺序启动否则会提示报错
1. redis -> Port:6379
redis-server.exe redis.windows.conf
2. apache-zookeeper -> Port:2181
bin\zkServer.cmd
配置文件:
需要修改成自己的目录路径
[apache-zookeeper-3.8.0-bin\conf\zoo.cfg]
dataDir=F:\\cloud\\apache-zookeeper-3.8.0-bin\\data
dataLogDir=F:\\cloud\\apache-zookeeper-3.8.0-bin\\logs
3. nacos-server -> Port:8848
bin\startup.cmd
配置文件:
[nacos-server-2.1.0\conf\application.properties]:必须先配置好数据库
### Connect URL of DB:
db.url.0=jdbc:mysql://localhost:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=nacos
db.password.0=123456
访问管理配置页面:
配置地址:http://127.0.0.1:8848/nacos
默认账号/密码:nacos
配置后端文件:
[uaaBaseUri,loginUaaRedirectUri,logoutUaaRedirectUri] 访问的地址修改成 [本机IP || 外网IP || 域名]
修改数据库链接 [url] -> [cloud || cloud_log] 对应的是数据库名
upms-dev.yaml
uaa:
# uaa的授权服务的主机名。
uaaBaseUri: http://of.byxiaoxie.com:9999/
# uaa登录成功后的回调地址,需要和UAA授权服务器中注册的完全匹配。
loginUaaRedirectUri: http://of.byxiaoxie.com:8086
# uaa登出成功后的回调地址。
logoutUaaRedirectUri: http://of.byxiaoxie.com:8086/#/login?supportUaa=1
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
cloud:
url: jdbc:mysql://localhost:3306/cloud?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: cloud
password: 123456
operation-log:
url: jdbc:mysql://localhost:3306/cloud_log?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: cloud_log
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
添加一个 [host] 写上域名或IP不然外网访问是 [localhost]
gateway-dev.yaml
server:
port: 8082
host: of.byxiaoxie.com
修改数据库链接 [url] -> [cloud_log] 对应的是数据库名
operation-log-consumer-dev.yaml
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/cloud_log?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: cloud_log
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
修改数据库链接 [url] -> [seata] 对应的是数据库名
seataServer.properties
# 数据存储方式,db 代表数据库
store.db.driverClassName=com.mysql.cj.jdbc.Driver
store.db.url=jdbc:mysql://localhost:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=seata
store.db.password=123456
修改数据库链接 [url] -> [cloud] 对应的是数据库名
uaa-admin-dev.yaml
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/cloud?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: cloud
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
修改数据库链接 [url] -> [cloud] 对应的是数据库名
uaa-auth-dev.yaml
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/cloud?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: cloud
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
4. seata-server -> Port:8091
bin\seata-server.bat
5. minio-server -> Port:19000-19001
.\minio.exe server -address :19000 --console-address :19001 F:\minio
启动参数解析
.\minio.exe server -address :19000 --console-address :19001 F:\minio
[-address :19000] API端口19000
[--console-address :19001] Console端口19001
[F:\minio] 工作目录
6. kafka -> Port:9092
.\bin\windows\kafka-server-start.bat .\config\server.properties
修改配置文件:
[kafka\config\server.properties]
#端口号,可不配置
port=9092
#服务器IP地址,也可修改为自己的服务器IP
host.name=127.0.0.1
# A comma separated list of directories under which to store log files
log.dirs=F:\\cloud_20220526\\cloud_service\\kafka\\logs
提示报错:
org.apache.kafka.clients.NetworkClient
修改配置文件 [server.properties] 注释掉 [advertised.listeners=PLAINTEXT://PC-Gary:9092] 集群才需要用的,没有用到集群不要使用
7. 后端服务
1. java -Dfile.encoding=utf-8 -jar uaa-admin.jar
2. java -Dfile.encoding=utf-8 -jar uaa-auth.jar
3. java -Dfile.encoding=utf-8 -jar upms-service.jar
4. java -Dfile.encoding=utf-8 -jar gateway.jar
8. Vue Web 服务
UUA:
修改配置文件
路径:F:\cloud\cloud-ui\cloud-uaa-ui\src\core\config
修改:[baseUrl: 'http://localhost:9998/'] 把 [localhost] 改成 [本机IP || 外网IP || 域名]
编译Vue
npm install //安装
npm run dev //运行Dev加载一次模块
npm run build //编译
UI:
修改配置文件
路径:F:\cloud\cloud-ui\cloud-ui\src\core\config
修改:[baseUrl: 'http://localhost:9998/'] 把 [localhost] 改成 [本机IP || 外网IP || 域名]
编译Vue
npm install //安装
npm run dev //运行Dev加载一次模块
npm run build //编译
9. Nginx 配置
[nginx.conf]:配置来源宝塔,如果单独使用[nginx]请按照Nginx官方例子配置
#BINDING-cloud-uaa-ui-START
server
{
listen 8085;
server_name 127.0.0.1 of.byxiaoxie.com;
index index.php index.html index.htm default.php default.htm default.html;
root d:/wwwroot/127.0.0.1/cloud-uaa-ui;
#START-ERROR-PAGE
#error_page 403 /403.html;
error_page 404 /404.html;
#error_page 502 /502.html;
#END-ERROR-PAGE
#HTTP_TO_HTTPS_START
#HTTP_TO_HTTPS_END
#LIMIT_INFO_START
#LIMIT_INFO_END
#SSL-INFO-START
#SSL-INFO-END
#反代清理缓存配置
location ~ /purge(/.*) {
proxy_cache_purge cache_one $1$is_args$args;
}
#proxy 反向代理
include proxy/127.0.0.1/*.conf;
#PHP-INFO-START
include php/70.conf;
#PHP-INFO-END
#REWRITE-START
include rewrite/127.0.0.1/*.conf;
#REWRITE-END
#redirect 重定向
include redirect/127.0.0.1/*.conf;
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log D:/BtSoft/wwwlogs/127.0.0.1_uaa_ui.log;
error_log D:/BtSoft/wwwlogs/127.0.0.1_uaa_ui.error.log;
}
#BINDING-cloud-uaa-ui-END
#BINDING-cloud-ui-START
server
{
listen 8086;
server_name 127.0.0.1 of.byxiaoxie.com;
index index.php index.html index.htm default.php default.htm default.html;
root d:/wwwroot/127.0.0.1/cloud-ui;
#START-ERROR-PAGE
#error_page 403 /403.html;
error_page 404 /404.html;
#error_page 502 /502.html;
#END-ERROR-PAGE
#HTTP_TO_HTTPS_START
#HTTP_TO_HTTPS_END
#LIMIT_INFO_START
#LIMIT_INFO_END
#SSL-INFO-START
#SSL-INFO-END
#反代清理缓存配置
location ~ /purge(/.*) {
proxy_cache_purge cache_one $1$is_args$args;
}
#proxy 反向代理
include proxy/127.0.0.1/*.conf;
#PHP-INFO-START
include php/70.conf;
#PHP-INFO-END
#REWRITE-START
include rewrite/127.0.0.1/*.conf;
#REWRITE-END
#redirect 重定向
include redirect/127.0.0.1/*.conf;
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log D:/BtSoft/wwwlogs/127.0.0.1_ui.log;
error_log D:/BtSoft/wwwlogs/127.0.0.1_ui.error.log;
}
#BINDING-cloud-ui-END
10. 启动Nginx
start nginx.exe
11. 网站访问:
http://域名:8085 //UAA管理
http://域名:8086 //设计工作流
28skuz