运行低代码后端
1. 前置准备
1.1. 解压(部署.zip),找到后端工程pamirs-project
1.2.下载idea以及安装平台的idea插件
1.2.1 jdk安装(已安装请忽略)
如本机环境没有安装jdk8,需先安装
mac:
https://doc.oinone.top/oio4/9225.html
window:
https://doc.oinone.top/oio4/9226.html
1.2.2 idea的插件安装教程:
mac:
https://doc.oinone.top/oio4/9225.html
windows:
https://doc.oinone.top/oio4/9226.html
1.2.3 maven下载安装(已安装请忽略)
mvn下载地址,推荐安装3.6.3
https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/
mac:
https://doc.oinone.top/oio4/9225.html
windows:
https://doc.oinone.top/oio4/9226.html
2. 修改bootstrap.yml中运行环境配置
修改其中zk的IP:192.168.0.121->改成docker安装的宿主机IP
默认profiles设置是dev,注意对应生效的yml文件为applicaiton-dev.yml
spring:
profiles:
active: dev
application:
name: pamirs-project
cloud:
service-registry:
auto-registration:
enabled: false
pamirs:
default:
environment-check: true
tenant-check: true
---
spring:
profiles: dev
cloud:
service-registry:
auto-registration:
enabled: false
config:
enabled: false
uri: http://127.0.0.1:7001
label: master
profile: dev
nacos:
server-addr: http://127.0.0.1:8848
discovery:
enabled: false
namespace:
prefix: application
file-extension: yml
config:
enabled: false
namespace:
prefix: application
file-extension: yml
dubbo:
application:
name: pamirs-project
version: 1.0.0
registry:
address: zookeeper://192.168.0.121:2182
protocol:
name: dubbo
port: 20880
serialization: pamirs
consumer:
timeout: 5000
provider:
timeout: 5000
scan:
base-packages: pro.shushi
cloud:
subscribed-services:
3. 修改application-dev.yml中对应中间件的IP和端口
3.1 redis
修改对应redis的IP端口以及密码
spring:
redis:
database: 0
host: 192.168.0.121 #改成docker安装的宿主机IP
port: 6378
timeout: 5000
password: Abc@1234
3.2 mysql
如自行安装mysql,直接改成mysql的IP和账号信息
如直接使用docker提供的mysql,则修改对应的IP为docker安装的宿主机IP
biz:
driverClassName: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://192.168.0.121:3307/demo_biz?useSSL=false&allowPublicKeyRetrieval=true&useServerPrepStmts=true&cachePrepStmts=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true
username: root
password: Abc@1234
initialSize: 5
maxActive: 200
minIdle: 5
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
asyncInit: true
pamirs:
driverClassName: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://192.168.0.121:3307/demo_pamirs?useSSL=false&allowPublicKeyRetrieval=true&useServerPrepStmts=true&cachePrepStmts=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true
username: root
password: Abc@1234
initialSize: 5
maxActive: 200
minIdle: 5
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
asyncInit: true
base:
driverClassName: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://192.168.0.121:3307/demo_base?useSSL=false&allowPublicKeyRetrieval=true&useServerPrepStmts=true&cachePrepStmts=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true
username: root
password: Abc@1234
initialSize: 5
maxActive: 200
minIdle: 5
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
asyncInit: true
3.3 zk
zookeeper:
zkConnectString: 192.168.0.121:2182 #改成docker安装的宿主机IP
zkSessionTimeout: 60000
rootPath: /demo
3.4 mq
适应于5.0及5.0之后的版本
spring:
application:
name: pamirs-designer
rocketmq:
name-server: 192.168.0.121:9876 #改成docker安装的宿主机IP
3.5 sql-records监听文件夹路径修改
record:
sql:
# 改成自己本地路径,比如d:/sql-records
store: /opt/pamirs/logs/sql-records
4. IDEA 配置
4.1 设置maven的setting.xml
如maven的版本为3.8.x,在 settings.xml 中通过配置 mirror 禁用了不安全的 http 链接,默认情况下必须使用 https 的仓库地址。
想要使用 http 方式,需要禁用 settings.xml 中的如下配置:
<mirrors>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
</mirrors>
4.2 设置编译参数
配置Complier为-Djps.track.ap.dependencies=false
配置Java Complier为 -parameters
配置Annotation Proccessors勾选Enable nanotation processing
4.3 设置启动参数
数式Oinone低代码-后端初始化工程启动
编译maven 拉取包
执行maven install 然后再reload,完成以后点启动成功
启动参数配置
如找不到启动类,可以图中所示找到ProjectApplication在图中位置右键编辑启动类配置
配置Program arguments (程序实参)为-Plifecycle=INSTALL,如页面上找不到,可点击Modify options 勾选Program arguments后就可以配置 不配置工程启动会报错
5. 启动成功
如出现一下报错,直接点击 JAR manifest 即可
出现如下字样,Oinone后端就启动好了!
Oinone社区 作者:数式-海波原创文章,如若转载,请注明出处:https://doc.oinone.top/install/backendinstall/4519.html
访问Oinone官网:https://www.oinone.top获取数式Oinone低代码应用平台体验