欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

程序员文章站 2024-03-19 16:55:04
...

1 IntelliJ IDEA启动CacheCloud

1.1 在IntelliJ IDEA 中git 源码

IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
git 下载 https://github.com/sohutv/cachecloud
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

1.2 初始化数据库

cachecloud/script/cachecloud.sql

导入项目中cachecloud.sql初始化库表结构
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

1.3 修改数据库配置

修改 cachecloud/cachecloud-open-web/src/main/swap/local.properties 数据库配置信息

cachecloud.db.url = jdbc:mysql://10.19.21.168:3306/cachecloud
cachecloud.db.user = admin
cachecloud.db.password = pwd123456
cachecloud.maxPoolSize = 20

isClustered = true
isDebug = true
spring-file = classpath:spring/spring-local.xml
log_base = /opt/cachecloud-web/logs
web.port = 9999
log.level = INFO

修改 cachecloud/cachecloud-open-web/src/main/swap/online.properties 数据库配置信息

cachecloud.db.url = jdbc:mysql://10.13.6.76:3306/cachecloud
cachecloud.db.user = admin
cachecloud.db.password = pwd123456
cachecloud.maxPoolSize = 20

isClustered = true
isDebug = false
spring-file=classpath:spring/spring-online.xml
log_base=/opt/cachecloud-web/logs
web.port=80
log.level=WARN

1.3 配置maven启动

1 新建
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
2 添加maven
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
配置maven
配置cachecloud-open-web目录:/Users/CleverCode/IdeaProjects/github/cachecloud/cachecloud-open-web
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

1.4 启动

点击启动
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

1.5 查看

http://127.0.0.1:9999/ 输入admin admin登录
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

2 local配置打包部署

2.1 新建maven打包配置

使用的是local.properties配置信息
clean compile install -Plocal -f pom.xml
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
注意这里的目录是:/Users/CleverCode/IdeaProjects/github/cachecloud
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

2.2 打包

选择cachecloud_local,然后点击启动
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
会打成一个war包: /Users/CleverCode/IdeaProjects/github/cachecloud/cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war

2.3 初始化服务目录结构

# mkdir -p /opt/cachecloud-web/logs
# scp https://github.com/sohutv/cachecloud/blob/master/script/start.sh /opt/cachecloud-web/
# scp https://github.com/sohutv/cachecloud/blob/master/script/stop.sh /opt/cachecloud-web/
# scp https://github.com/sohutv/cachecloud/blob/master/cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.conf
# 没有nmon目录监控统计图会受到影响
# scp https://github.com/sohutv/cachecloud/tree/master/cachecloud-open-web/nmon  /opt/cachecloud-web/nmon  

2.4 上传cachecloud-open-web-1.0-SNAPSHOT.war到服务器

scp  /Users/CleverCode/IdeaProjects/github/cachecloud/cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war /opt/cachecloud-web

/opt/cachecloud-web目录信息
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

2.5 启动

vi /opt/cachecloud-web/start.sh
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
注意启动不能使用绝对路径启动,(sh /opt/cachecloud-web/start.sh 会启动失败)。可以变成(cd /opt/cachecloud-web &&sh start.sh)

cd /opt/cachecloud-web
sh start.sh

2.6 查看

http://10.9.21.159:9999/
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

3 online配置打包部署(线上)

clean compile install -Ponline -f pom.xml
使用:online.properties 数据库配置信息
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
打包
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
其他步骤和local配置打包部署相同
查看,这里会使用80端口
http://10.9.21.159/manage/login?redirectUrl=/admin/app/list
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud

技术交流

CleverCode是一名架构师,技术交流,咨询问题,请加CleverCode创建的qq群(架构师俱乐部):517133582。加群和腾讯,阿里,百度,新浪等公司的架构师交流。【架构师俱乐部】宗旨:帮助你成长为架构师!
IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud