Cachecloudgithub Address
Https://github.com/sohutv/cachecloud
Build the Environment
Host |
IP |
Java 7 |
Maven 3 |
MySQL |
Redis 3 |
Cachecloud Manage |
192.168.197.61 |
V |
V |
V |
X |
Redis Client |
192.168.197.62 |
X |
X |
X |
V |
Cachecloud Installation
Description: The steps required to install MAVEN, JDK, and MySQL software on the machine before installing Cachecloud are not explained, and the test Software installation path is:/OPT.
Download
# cd /opt/# git clone https://github.com/sohutv/cachecloud.git
Table Structure Import
create database cachecloud character set utf8; use cachecloud;mysql> source /opt/cachecloud/script/cachecloud.sql;
Installing Cachecloud
Modifying a program configuration file
# cat/opt/cachecloud/cachecloud-open-web/src/main/resources/cachecloud-web.confpid_folder=/opt/ Cachecloud-weblog_folder=/opt/cachecloud-web/logslog_filename=cachecloud-web.logapp_name=cachecloud-webrun_ Args=java_home=/opt/jdk1.7.0_45java_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:-O Mitstacktraceinfastthrow-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 "# cat/opt/cachecloud/cachecloud-open-web/src/main/swap/ Online.propertiescachecloud.db.url = Jdbc:mysql://localhost:3306/cachecloudcachecloud.db.user = Admincachecloud.db.password = Admincachecloud.maxpoolsize = 20isClustered = Trueisdebug = Falsespring-file=classpath: Spring/spring-online.xmllog_base=/opt/cachecloud-web/logsweb.port=8585log.level=warn
Maven Pack
# pwd/opt/cachecloud# mvn clean compile install -Ponline
Deployment
# sh script/deploy.sh /opt
Start
# cd /opt/cachecloud-web/# sh start.shStarting the cachecloud ....OK!PID: 2643STDOUT: /opt/cachecloud-web/logs/cachecloud-web.log
Note that the memory allocation of the program in the start.sh file needs to be allocated according to the actual situation, and my side is to adjust the program memory to 1G.
If the program starts successfully in the browse input: http://192.168.197.61:8585, the default account password is admin.
Redis Client Installation
yum install -y gccuseradd cachecloudecho "cachecloud" |passwd --stdin cachecloudmkdir -p /opt/cachecloud/datamkdir -p /opt/cachecloud/confmkdir -p /opt/cachecloud/logsmkdir -p /opt/cachecloud/redismkdir -p /tmp/cachecloudcd /opt/cachecloud/rediswget wget http://download.redis.io/releases/redis-3.0.7.tar.gz && mv redis-3.0.7.tar.gz redis.tar.gz && tar zxvf redis.tar.gz --strip-component=1make echo "export PATH=$PATH:/opt/cachecloud/redis/src" >/etc/profile.d/redis.shsource /etc/profile.d/redis.shchown -R cachecloud.cachecloud /opt/cachecloud/chown -R cachecloud.cachecloud /tmp/cachecloud/
Use an example account to apply
Click to submit the application after the login Admin account to set up. Note Cachecloud also has a management backstage, enter the way is: click on the upper right corner of the account--click on the management background to enter.
Click OK after you can log in through the application of the account, note cachecloud login is the default new application account is not password can log on. If you need a password, you need to develop it two times.
Apply for Application
After logging into the background with the account you just requested, click on the top right corner to access the app application screen.
The rest of the information is filled out according to the actual needs, then click the bottom of the submission request.
Add Host
The Cachecloud is communicated via SSH's account password, so the account and password that we create in Redis client must be the same as the account password that manages the background access.
Create an App
After entering the creation of the application interface at the bottom of the machine information configuration, before the installation needs to do a format check, check through the deployment.
After successful deployment, click OK to automatically jump to the approval list, click through and then you can use it.
Code access
Login request the user selects the app that you just created, which appears in the background as follows:
Code Access information:
# curl http://192.168.197.61:8585/cache/client/redis/cluster/10000.json?clientVersion=1.0-SNAPSHOT{"message":"appId:10000 client is up to date, Cheers!","shardNum":6,"appId":10000,"status":1,"shardInfo":"192.168.197.62:6379 192.168.197.62:6380 192.168.197.62:6381 192.168.197.62:6382 192.168.197.62:6383 192.168.197.62:6384"}
Cachecloud Construction. MD