MES西电项目的环境部署项目配置
作者:互联网
西电项目部署配置
从Git上导入项目- crrcdt-is:基于dubbo架构的分布式系统核心项目
- crrcdt-qm:质量模块
- web-ui:使用 npm + react 构建的前端项目
zookeeper
- 解压,点击run运行
node.js
- 安装系统node.js
-
配置环境变量
- 首先配置npm安装的全局模块所在的路径,以及缓存cache的路径
1.在我安装的 E:\JetBrains\nodejs 文件夹下创建两个文件夹 node_global 及 node_cache 2.再打开cmd命令窗口,输入: npm config set prefix E:\JetBrains\nodejs\node_global npm config set cache E:\JetBrains\nodejs\node_cache
- 配置node.js的环境变量
1.在 系统变量 下新建 NODE_PATH ,输入E:\JetBrains\nodej\node_global\node_modules 2.将 用户变量 下的 Path 修改为 E:\JetBrains\nodej\node_global
redis
- 安装redis,点击redis-server运行
数据库配置
- 导入项目的数据库文件:西电数据结构.sql和数据.sql
maven配置
- 在maven的配置文件settings.xml中,
maven\apache-maven-3.6.1\conf
添加
<mirror>
<id>nexus-public</id>
<name>nexus-public</name>
<url>http://47.97.168.188:8888/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>3rd</id>
<name>3rd</name>
<url>http://47.97.168.188:8888/nexus/content/repositories/thirdparty/</url>
<mirrorOf>*</mirrorOf>
</mirror>
- 目的是为了使用本地服务器的镜像
- 从pom.xml文件打开项目,Reimport All Maven Projects
- 项目配置:Eureka,zookeeper,redis的路径配置,以及配置主从数据库.
dubbo\sys\sys-service\src\main\resources\application-oracle.properties
# Eureka
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
eureka.client.enabled=true
# 心跳时间,即服务续约间隔时间(缺省为30s)
eureka.instance.lease-renewal-interval-in-seconds=10
# 发呆时间,即服务续约到期时间(缺省为90s)
eureka.instance.lease-expiration-duration-in-seconds=30
# Dubbo配置
dubbo.registry.address=zookeeper://localhost:2181
# 服务提供者 开发环境不注册,测试环境注册
dubbo.provider.register=true
spring.datasource.druid.master.id=masterDataSource
spring.datasource.druid.master.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.master.url=jdbc:oracle:thin:@localhost:1521:ORCL
spring.datasource.druid.master.username=mes
spring.datasource.druid.master.password=mes
spring.datasource.druid.master.initialSize=1
spring.datasource.druid.master.minIdle=1
spring.datasource.druid.master.maxActive=20
spring.datasource.druid.master.maxWait=6000
spring.datasource.druid.master.minEvictableIdleTimeMillis=300000
spring.datasource.druid.slave.id=slaveDataSource
spring.datasource.druid.slave.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.slave.url=jdbc:oracle:thin:@localhost:1521:ORCL
spring.datasource.druid.slave.username=mes
spring.datasource.druid.slave.password=mes
spring.datasource.druid.slave.initialSize=1
spring.datasource.druid.slave.minIdle=1
spring.datasource.druid.slave.maxActive=20
spring.datasource.druid.slave.maxWait=6000
spring.datasource.druid.slave.minEvictableIdleTimeMillis=300000
spring.redis.database=0
spring.redis.port=6379
spring.redis.host=127.0.0.1
#spring.redis.password=
spring.redis.pool.max-active=500
spring.redis.pool.max-idle=5
spring.redis.pool.max-wait=10000
spring.redis.timeout=1800
dubbo\oss\oss-service\src\main\resources\application-oracle.properties
# Eureka
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
eureka.client.enabled=true
# 心跳时间,即服务续约间隔时间(缺省为30s)
eureka.instance.lease-renewal-interval-in-seconds=10
# 发呆时间,即服务续约到期时间(缺省为90s)
eureka.instance.lease-expiration-duration-in-seconds=30
# Dubbo配置
dubbo.registry.address=zookeeper://localhost:2181
# 服务提供者 开发环境不注册,测试环境注册
dubbo.provider.register=true
spring.datasource.druid.master.id=masterDataSource
spring.datasource.druid.master.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.master.url=jdbc:oracle:thin:@localhost:1521:ORCL
spring.datasource.druid.master.username=mes
spring.datasource.druid.master.password=mes
spring.datasource.druid.master.initialSize=1
spring.datasource.druid.master.minIdle=1
spring.datasource.druid.master.maxActive=20
spring.datasource.druid.master.maxWait=6000
spring.datasource.druid.master.minEvictableIdleTimeMillis=300000
spring.datasource.druid.slave.id=slaveDataSource
spring.datasource.druid.slave.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.slave.url=jdbc:oracle:thin:@localhost:1521:ORCL
spring.datasource.druid.slave.username=mes
spring.datasource.druid.slave.password=mes
spring.datasource.druid.slave.initialSize=1
spring.datasource.druid.slave.minIdle=1
spring.datasource.druid.slave.maxActive=20
spring.datasource.druid.slave.maxWait=6000
spring.datasource.druid.slave.minEvictableIdleTimeMillis=300000
spring.redis.database=0
spring.redis.port=6379
spring.redis.host=127.0.0.1
#spring.redis.password=123456
spring.redis.pool.max-active=500
spring.redis.pool.max-idle=5
spring.redis.pool.max-wait=10000
spring.redis.timeout=1800
- 在IDEA的右下角提示中,选择在Run Dashboard运行项目
- 在Run Dashboard中运行项目的各个模块
- ApiGatewayApplication:
- EurekaApplication:
- OssServiceBootApplication:
- SpringBootAdminApplication:
- SysServiceBootApplication:
- 从pom.xml文件打开项目,Reimport All Maven Projects
- 项目配置:Eureka,zookeeper,redis的路径配置,以及配置主从数据库.
qmis\xd-qm\xd-qm-service\src\main\resources\application-oracle.properties
# Eureka
eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/
eureka.client.enabled=true
# 心跳时间,即服务续约间隔时间(缺省为30s)
eureka.instance.lease-renewal-interval-in-seconds=10
# 发呆时间,即服务续约到期时间(缺省为90s)
eureka.instance.lease-expiration-duration-in-seconds=30
# Dubbo配置
dubbo.registry.address=zookeeper://127.0.0.1:2181
# 服务提供者 开发环境不注册,测试环境注册
dubbo.provider.register=true
spring.datasource.druid.master.id=masterDataSource
spring.datasource.druid.master.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.master.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
spring.datasource.druid.master.username=mes
spring.datasource.druid.master.password=mes
spring.datasource.druid.master.initialSize=1
spring.datasource.druid.master.minIdle=1
spring.datasource.druid.master.maxActive=20
spring.datasource.druid.master.maxWait=6000
spring.datasource.druid.master.minEvictableIdleTimeMillis=300000
spring.datasource.druid.slave.id=slaveDataSource
spring.datasource.druid.slave.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.slave.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
spring.datasource.druid.slave.username=mes
spring.datasource.druid.slave.password=mes
spring.datasource.druid.slave.initialSize=1
spring.datasource.druid.slave.minIdle=1
spring.datasource.druid.slave.maxActive=20
spring.datasource.druid.slave.maxWait=6000
spring.datasource.druid.slave.minEvictableIdleTimeMillis=300000
spring.datasource.druid.other.id=otherDataSource
spring.datasource.druid.other.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.druid.other.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
spring.datasource.druid.other.username=mes
spring.datasource.druid.other.password=mes
spring.datasource.druid.other.initialSize=1
spring.datasource.druid.other.minIdle=1
spring.datasource.druid.other.maxActive=20
spring.datasource.druid.other.maxWait=6000
spring.datasource.druid.other.minEvictableIdleTimeMillis=300000
mybatis-plus.global-config.sql-injector=com.baomidou.mybatisplus.mapper.LogicSqlInjector
# mongodb
spring.data.mongodb.uri=mongodb://127.0.0.1:27017/xd-mes
spring.redis.database=0
spring.redis.port=6379
spring.redis.host=127.0.0.1
spring.redis.password=
spring.redis.pool.max-active=500
spring.redis.pool.max-idle=5
spring.redis.pool.max-wait=10000
spring.redis.timeout=1800
- 运行项目,项目的各个功能模块在xd-qm中,主要模块有:
- xd-qm-api:
- xd-qm-commons:
- xd-qm-service:
- 使用npm启动前端模块:在IDEA中的Terminal中输入
E:\JetBrains\IdeaProjects\shine\web-ui>npm start
- 等待项目启动完成.
- 进入西电MES项目登录页面(http://localhost:8000/):
- 输入用户名:adminrole,密码:123456.进入系统主界面:
标签:slave,项目,spring,西电,redis,druid,master,datasource,MES 来源: https://blog.51cto.com/u_15185289/2783904