IntelliJ IDEA启动CacheCloud和maven打包部署CacheCloud
文章目录
1 IntelliJ IDEA启动CacheCloud
1.1 在IntelliJ IDEA 中git 源码
git 下载 https://github.com/sohutv/cachecloud
1.2 初始化数据库
cachecloud/script/cachecloud.sql
导入项目中cachecloud.sql初始化库表结构
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 新建
2 添加maven
配置maven
配置cachecloud-open-web目录:/Users/CleverCode/IdeaProjects/github/cachecloud/cachecloud-open-web
1.4 启动
点击启动
1.5 查看
http://127.0.0.1:9999/ 输入admin admin登录
2 local配置打包部署
2.1 新建maven打包配置
使用的是local.properties配置信息
clean compile install -Plocal -f pom.xml
注意这里的目录是:/Users/CleverCode/IdeaProjects/github/cachecloud
2.2 打包
选择cachecloud_local,然后点击启动
会打成一个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目录信息
2.5 启动
vi /opt/cachecloud-web/start.sh
注意启动不能使用绝对路径启动,(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/
3 online配置打包部署(线上)
clean compile install -Ponline -f pom.xml
使用:online.properties 数据库配置信息
打包
其他步骤和local配置打包部署相同
查看,这里会使用80端口
http://10.9.21.159/manage/login?redirectUrl=/admin/app/list
技术交流
CleverCode是一名架构师,技术交流,咨询问题,请加CleverCode创建的qq群(架构师俱乐部):517133582。加群和腾讯,阿里,百度,新浪等公司的架构师交流。【架构师俱乐部】宗旨:帮助你成长为架构师!
上一篇: 程序员必备的21款工具与编程灵感
下一篇: 医学图像之肝脏语义分割