最全CacheCloud最完整安装使用文档【实操系列】

准备阶段

  1. 下载 cachecloud-master版本

解压后目录

cachecloud-master# ll -h
total 56K
drwxr-xr-x 6 root root 4.0K Nov 14 16:41 cachecloud-open-client
drwxr-xr-x 3 root root 4.0K Nov 14 16:41 cachecloud-open-common
drwxr-xr-x 4 root root 4.0K Nov 14 16:41 cachecloud-open-web
-rw-r--r-- 1 root root  12K Nov 14 16:41 LICENSE
-rw-r--r-- 1 root root  13K Nov 14 16:41 pom.xml
-rw-r--r-- 1 root root 8.7K Nov 14 16:41 README.md
drwxr-xr-x 2 root root 4.0K Nov 14 16:41 script
  1. 安装mysql

  2. 导入项目中cachecloud.sql初始化库表结构,默认插入admin超级管理员。

安装cachecloud

直接按照生产环境标准安装

  • 在cachecloud根目录下运行
root@xxxx # mvn clean compile install -Ponline
...
[INFO]
[INFO] cachecloud-open-parent ............................. SUCCESS [  0.205 s]
[INFO] cachecloud-open-client ............................. SUCCESS [  0.006 s]
[INFO] cachecloud-open-client-basic ....................... SUCCESS [  1.549 s]
[INFO] cachecloud-jedis ................................... SUCCESS [  2.514 s]
[INFO] cachecloud-open-common ............................. SUCCESS [  0.079 s]
[INFO] cachecloud-open-web ................................ FAILURE [  2.029 s]
[INFO] cachecloud-open-client-redis ....................... SKIPPED
[INFO] cachecloud-open-jedis-stat ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.552 s
[INFO] Finished at: 2020-04-08T14:12:43+08:00
[INFO] Final Memory: 30M/577M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cachecloud-open-web: Could not resolve dependencies for project com.sohu.tv:cachecloud-open-web:war:1.0-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:1.3.1.RELEASE -> com.fasterxml.jackson.core:jackson-databind:jar:2.9.10.1: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:2.9.10.1: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:2.9.10.1 from/to central (http://repo1.maven.org/maven2): Failed to transfer file: http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.9.10.1/jackson-databind-2.9.10.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cachecloud-open-web

运气真好,果然报错了(网上其他文章基本上都是直接跳过此步骤。也是醉了)

解决方法,在软件根目录下/pom.xmlhttp://repo1.maven.org/maven2

原配置:   	<url>http://repo1.maven.org/maven2</url>
修改配置:   <url>https://repo1.maven.org/maven2</url>

再次执行

root@xxxx # mvn clean compile install -Ponline
...
就不贴输出了
...
  • 拷贝war包(cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war)到/opt/cachecloud-web
  • 拷贝配置文件(cachecloud-open-web/src/main/resources/cachecloud-web.conf)到/opt/cachecloud-web下,并改名为cachecloud-open-web-1.0-SNAPSHOT.conf(spring-boot要求,否则配置不生效)

注意了,此处网上文章又说的比较粗糙,以下是diff出来的差异,当然要根据实际生产情况适当修改

root@xxxx cachecloud# diff cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.conf
1,2c1,2
< PID_FOLDER=/data/cachecloud-web
< LOG_FOLDER=/data/cachecloud-web/logs
---
> PID_FOLDER=/opt/cachecloud-web
> LOG_FOLDER=/opt/cachecloud-web/logs
6,7c6
< JAVA_HOME=/usr/local/jdk
< JAVA_OPTS="-server -Xmx4g -Xms4g -Xss256k -XX:MaxDirectMemorySize=1G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=40 -XX:+PrintGCDateStamps -Xloggc:/opt/cachecloud-web/logs/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/cachecloud-web/logs/java.hprof -XX:+DisableExplicitGC -XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.util.Arrays.useLegacyMergeSort=true -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=22099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
\ No newline at end of file
---
> JAVA_OPTS="-server -Xmx1g -Xms1g -Xss256k -XX:MaxDirectMemorySize=1G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=40 -XX:+PrintGCDateStamps -Xloggc:/opt/cachecloud-web/logs/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/cachecloud-web/logs/java.hprof -XX:+DisableExplicitGC -XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags  -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.util.Arrays.useLegacyMergeSort=true -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=22099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
  • 启动,我是选择使用启动脚本,当然也是要根据环境适当修改,主要是配置部分
...
SERVER_NAME=root
DEPLOY_DIR=/opt/cachecloud-web
STDOUT_FILE=${DEPLOY_DIR}/logs/cachecloud-web.log
WAR_FILE=${DEPLOY_DIR}/cachecloud-open-web-1.0-SNAPSHOT.war
...

登陆

  • 访问http://127.0.0.1:9999/manage/login

右上角:(记得修改)

admin --> 管理后台 --> 系统配置关系 --> 机器ssh密码(一定要修改)
  • 初始化物理机(记得密码要与上部一致哦~)
root@xxxx # cat cachecloud-init.sh
...
readonly redisDir="/opt/cachecloud/redis" # 部署位置,根据需要调整即可
readonly redisTarGz="redis-3.0.7.tar.gz"  # 版本信息,根据需要调整即可
...
  • 物理集群管理
admin --> 管理后台 --> 机器管理

成功后将会有真实的系统资源展示

特别提醒,最好使用master版本,因为可以迁移slot

  • 数据迁移工具

使用的是redis-migrate-tool,需要先下载。

注意,不能3.x版本迁移到4.x

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值