部署redis管理平台cachecloud

1 环境准备

需要安装jave,maven.mysql

1.1 安装maven,配置阿里源

yum install -y maven
 cat /etc/maven/settings.xml

   <mirror>
    <id>aliyunmaven</id>
    <mirrorOf>*</mirrorOf>
    <name>阿里云公共仓库</name>
    <url>https://maven.aliyun.com/repository/public</url>
  </mirror>

1.2 安装mysql

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
rpm -ivh mysql57-community-release-el7-10.noarch.rpm 
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-20221
yum -y install mysql-community-server
systemctl start mysqld.service
grep 'temporary password' /var/log/mysqld.log
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Suixiaofeng!1';

grant all on cachecloud_open.* to cachecloud_open@'%' identified by '123456!Aa';

1.3 安装java

rpm -qa | grep java

2 部署cachecloud

git clone https://github.com/sohutv/cachecloud.git

cd /root/cachecloud/cachecloud-web/sql
导入数据库 
create database cachecloud_open;
source 3.2.sql

修改配置 
[root@cachecloud cachecloud]# cat cachecloud-web/src/main/resources/application-online.yml 
spring:
  application:
    name: cloud.cachecloud-web.open.online
    import: classpath:spring/spring.xml

server:
  port: 8080
  domain: 0.0.0.0:8080

cachecloud:
  primary:
    url: jdbc:mysql://127.0.0.1:3306/cachecloud_open?useUnicode=true&characterEncoding=UTF8&autoReconnect=true&connectTimeout=3000&socketTimeout=10000&serverTimezone=Asia/Shanghai
    user: cachecloud_open
    password: 123456!Aa
    initialPoolSize: 10
    maxPoolSize: 50
  redis:
    main:
      host: 127.0.0.1
      port: 6379
      password:
  web:
    clients: 127.0.0.1
aof:
  rewrite:
    ignore-appIds:

maven打包
mvn clean compile install -Ponline

[root@cachecloud cachecloud]# mkdir /opt/cachecloud-web

mv cachecloud-web/target/cachecloud-web.war /opt/cachecloud-web/
cd /opt/cachecloud-web/
/root/cachecloud/cachecloud-web/target/classes/application-online.yml application-open.yml
nohup java -jar -Dspring.profiles.active=open cachecloud-web.war &

访问web
http://192.168.10.51:8080
界面如下

部署redis管理平台cachecloud

部署redis管理平台cachecloud

3 部署迁移工具机器

#!/bin/bash

############################################################################
# @desc:
#  - 1. install redis-shake;
#  - 2. @usage: sh redisShake-install.sh [username]
###########################################################################

set -o nounset
set -o errexit

# install redis-shake
installRedisShake() {
   local redisShakeDir="/opt/cachecloud/redis-shake-2.0.3"
   local redisShakeTarGz="redis-shake-v2.0.3.tar.gz"
     mkdir -p {redisShakeDir} && cd{redisShakeDir}
   wget https://github.com/alibaba/RedisShake/releases/download/release-v2.0.3-20200724/{redisShakeTarGz} && tar zxvf{redisShakeTarGz} --strip-component=2
   if [[ ? == 0 ]]; then
    echo -e "\033[41;36m OK:{redisShakeTarGz} is installed, exit. \033[0m"
        chown -R 1:2 {redisShakeDir}
        return
     fi
     echo -e "\033[41;36m ERROR:{redisShakeTarGz} is NOT installed, exit. \033[0m"
}

# main entrance
username="cachecloud-open"
password="cachecloud-open"
if [[ #>0 && -n "1" ]]; then
  username="1"
  echo -e "\033[41;36m please input password for user:{username} \033[0m"
  stty -echo
  read password
  stty echo
fi
echo -e "\033[41;36m use username: {username} \033[0m"
installRedisShake "{username}" "${password}"

4 添加机器

参考
https://www.bbsmax.com/A/Gkz18r6ZdR/
https://www.cnblogs.com/yjt1993/p/14808887.html
https://github.com/sohutv/cachecloud/wiki

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: