环境:
maven
mysql
jdk1.8
1.下载源码包
官网 https://github.com/sohutv/cachecloud
下载 cachecloud-master.zip
2.解压
unzip cachecloud-master.zip -d /opt/
3.初始化数据库
登录数据库执行
mysql>create database cache_cloud;
mysql> use cache_cloud;
mysql>grant all on cache_cloud.* to 'cachecloud'@'localhost' identified by 'Cachecloud2022';
mysql>flush privileges;
加载数据库脚本
mysql> source /opt/cachecloud-master/script/cachecloud.sql
4.修改配置文件
vim /opt/cachecloud-master/cachecloud-open-web/src/main/swap/local.properties
###################################################
cachecloud.db.url = jdbc:mysql://数据库地址:端口/cache_cloud
cachecloud.db.user = cachecloud
cachecloud.db.password = Cachecloud2022
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
###################################################
vim /opt/cachecloud-master/cachecloud-open-web/src/main/swap/online.properties
###################################################
cachecloud.db.url = jdbc:mysql://数据库地址:端口/cache_cloud
cachecloud.db.user = cachecloud
cachecloud.db.password = Cachecloud2022
cachecloud.maxPoolSize = 20
isClustered = true
isDebug = false
spring-file=classpath:spring/spring-online.xml
log_base=/opt/cachecloud-web/logs
web.port=8585
log.level=WARN
###################################################
5.执行初始化脚本
bash /opt/cachecloud-master/script/cachecloud-init.sh admin
6.编译打包
cd /opt/cachecloud-master
mvn clean compile install -Ponline
7.创建服务启动环境
mkdir -p /opt/cachecloud-web/logs
cp /opt/cachecloud-master/cachecloud-open-web/targetcachecloud-open-web-1.0-SNAPSHOT.war /opt/cachecloud-web
cp /opt/cachecloud-master/cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web
cp /opt/cachecloud-master/script/start.sh /opt/cachecloud-web
8.启动
bash /opt/cachecloud-web/start.sh
9.验证
地址:8585
默认用户名密码:admin/admin
10.页面配置
在系统配置中修改ssh 用户,端口和密码。填写初始化脚本创建的用户和密码。
注:如需要添加其他主机上的redis,需在其主机上创建页面配置的ssh用户和密码