可使用cacheCloud進行集羣管理,項目地址:github.com/sohutv/cach…mysql
CacheCloud提供一個Redis雲管理平臺:實現多種類型(Redis Standalone、Redis Sentinel、Redis Cluster)自動部署、解決Redis實例碎片化現象、提供完善統計、監控、運維功能、減小運維成本和誤操做,提升機器的利用率,提供靈活的伸縮性,提供方便的接入客戶端。git
進入建立cachecloud目錄,執行命令:github
git clone https://github.com/sohutv/cachecloud.git
web
1:在mysql建立一個數據庫cache-cloud(UTF-8)redis
2:導入cachecloud.sqlspring
use cache-cloud;
source /usr/local/redis/cachecloud/cachecloud/script/cachecloud.sql;
複製代碼
修改配置文件online.properties:sql
vi /usr/local/redis/cachecloud/cachecloud/cachecloud-open-web/src/main/swap/online.properties
數據庫
在根目錄下執行:bash
mvn clean compile install -Ponline
複製代碼
mkdir /opt/cachecloud-web
cp cachecloud-open-web-1.0-SNAPSHOT.war /opt/cachecloud-web
複製代碼
cp cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web/
cd /opt/cachecloud-web/
mv cachecloud-web.conf cachecloud-open-web-1.0-SNAPSHOT.conf
sudo ln -s /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.war /etc/init.d/cachecloud-web
cp script/start.sh /opt/cachecloud-web/
cp script/stop.sh /opt/cachecloud-web/
複製代碼
先賦予start.sh與stop.sh可執行權限。賦予完畢後進行啓動。服務器
./start.sh
複製代碼
訪問ip:8585,使用帳號admin,密碼admin進行登陸便可。
cachecloud項目中的cachecloud-init.sh(目錄:cachecloud/script/cachecloud-init.sh)腳本是用來初始化服務器的cachecloud環境。
修改cachecloud-init.sh
中的redis版本爲5.0.0。
執行:
sh cachecloud-init.sh cachecloud
密碼填寫cachecloud,一路安裝成功。
用戶名和密碼要跟配置修改中的保持同樣:
進入後臺管理,點擊機器管理,添加新機器。
已成功導入:
因爲只添加了單個節點,因此最終效果以下所示:
出現了啓動不了的問題,以下圖所示:
首先,我在目錄下發現了hs_err_pid16687.log文件,說明啓動發生了點問題,瀏覽它。
大體就是內存溢出了。
能夠發現,cachecloud配置爲4G,可是服務器的內存並無那麼大,因此啓動失敗。
將start.sh文件中的內存設置成1G:
完成了問題1的設置以後,仍然啓動不了,但很明顯,它提示找不到日誌文件。
在相應的目錄建立cachecloudp-web.log便可,再次啓動: