plus-ui&RuoYi-Vue-Plus 基于pgSql本地运行实践

gitee代码仓:

前端:https://gitee.com/JavaLionLi/plus-ui

后端:https://gitee.com/dromara/RuoYi-Vue-Plus

一、前置动作

  • 项目clone到本地后
    • 前端:博主当前node版本为v18.20.4,初始化项目后,基于默认分支ts新建个人分支,文本创建为ts_tygh,按照README文档操作步骤可正常启动
    • 后端:设置jdk版本为17,初始化项目后,基于默认分支5.X新建个人分支,文本创建为5.X_tygh

二、主服务DromaraApplication启动

2.1、数据源调整

默认数据源启用了MySQL,调整成pgSql,需要关注两个地方:

2.1.1、开放ruoyi-admin/pom.xml的pgSql驱动包依赖:

xml 复制代码
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

2.1.2、修改ruoyi-admin/src/main/resources/application-dev.yml数据源配置

修改driverClassName、url、username、password即可

yml 复制代码
spring:
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
    dynamic:
      # 性能分析插件(有性能损耗 不建议生产环境使用)
      p6spy: true
      # 设置默认的数据源或者数据源组,默认值即为 master
      primary: master
      # 严格模式 匹配不到数据源则报错
      strict: true
      datasource:
        # 主库数据源
        master:
          type: ${spring.datasource.type}
          driverClassName: org.postgresql.Driver
          # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
          # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
          url: jdbc:postgresql://192.168.125.102:5432/dbname
          username: postgres
          password: postgres

2.1.3、修改redis连接配置

根据运行环境的实际情况修改redis连接配置,解决Unable to connect to Redis server: localhost/127.0.0.1:6379

关注host、port、password是否可用

yml 复制代码
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring.data:
  redis:
    # 地址
    host: 192.168.125.102
    # 端口,默认为6379
    port: 6379
    # 数据库索引
    database: 0
    # redis 密码必须配置
    password: redis
    # 连接超时时间
    timeout: 10s
    # 是否开启ssl
    ssl.enabled: false

2.2、初始化pgsql数据

执行script/sql/postgres下sql

执行后确认,新增约60张表

2.3、验证主服务启动情况

前端启动

后端主服务启动

使用默认账号,输入正确验证码登录

三、Admin监控服务启动

直接启动即可

四、任务调度服务启动

数据源调整:修改src/main/resources/application-dev.yml,为当前使用的pgSql配置

yml 复制代码
spring:
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    url: jdbc:postgresql://192.168.125.102:5432/dbname?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
    username: postgres
    password: postgres

启动服务

五、Admin监控服务&任务调度服务登录

5.1、Admin监控服务登录账号&密码确认

以Admin监控服务为例,在yml文件中定义了usernamepassword变量,从最外层pom.xml中读取,另外关注Maven中当前激活的profilesdev,可知账号为ruoyi,密码为123456

5.2、Admin监控服务登录确认

5.3、任务调度的账号和密码均为admin

登录确认

六、后续计划

探索具体使用,二开...

相关推荐
低音钢琴41 分钟前
【SpringBoot从初学者到专家的成长18】SpringBoot中的数据持久化:JPA与Hibernate的结合
spring boot·后端·hibernate
paopaokaka_luck1 小时前
基于SpringBoot+Vue的社区诊所管理系统(AI问答、webSocket实时聊天、Echarts图形化分析)
vue.js·人工智能·spring boot·后端·websocket
余道各努力,千里自同风1 小时前
el-input 输入框宽度自适应宽度
javascript·vue.js·elementui
Mike_jia1 小时前
DumbAssets:开源资产管理神器,家庭与企业的高效管家
前端
李慕婉学姐1 小时前
Springboot黄河文化科普网站5q37v(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端
Southern Wind2 小时前
Vue 3 多实例 + 缓存复用:理念及实践
前端·javascript·vue.js·缓存·html
一大树2 小时前
Vue3优化指南:少写代码,多提性能
vue.js
在下木子生2 小时前
SpringBoot基于工厂模式的多类型缓存设计
java·spring boot·缓存
HuangYongbiao2 小时前
Rspack 原理:webpack,我为什么不要你
前端
yinuo2 小时前
前端项目开发阶段崩溃?试试这招“Node 内存扩容术”,立马复活!
前端