centos cachecloud安装
!!!!!!!!!!执行下面步骤前先进行数据库创建,并执行cachecloud.sql!!!!!!!!!!!!
数据库:cache-cloud
1.下载 cachecloud-master.zip
下载地址:https://codeload.github.com/sohutv/cachecloud/zip/master
2.创建目录
mkdir -p /soft/
mkdir -p /soft/cachecloud/
将 cachecloud-master.zip 上传到服务器,目录为 /soft/cachecloud/
3.
cd /soft/cachecloud/
解压 unzip cachecloud-master.zip
(如果提示 : -bash: unzip: command not found 则表示没有安装unzip
安装unzip : yum install -y unzip zip )
mv cachecloud-master cachecloud
4.修改数据库的链接、用户名和密码 和 日志等配置信息
vi /soft/cachecloud/cachecloud/cachecloud-open-web/src/main/swap/online.properties
cachecloud.db.url = jdbc:mysql://172.16.1.22:3306/cachecloudtest?useUnicode=true&characterEncoding=utf-8
cachecloud.db.user = dev_wr
cachecloud.db.password = KztRzKIkCD9LhDXU
web.port=8585 #修改端口
vi /soft/cachecloud/cachecloud/cachecloud-open-web/src/main/resources/cachecloud-web.conf
JAVA_HOME=/soft/java/jdk1.7.0_80
5. cd /soft/cachecloud/cachecloud/
mvn clean compile install -Ponline
(
如果提示 -bash: mvn: command not found
安装 maven
mkdir -p /soft/maven/
下载 maven : http://mirrors.cnnic.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
上传到 服务器 /soft/maven/
cd /soft/maven
tar -xvf apache-maven-3.3.9-bin.tar.gz
mv apache-maven-3.3.9 maven3.3.9
修改环境变量
最后添加下面两行
vi /etc/profile
export MAVEN_HOME=/soft/maven/maven3.3.9
export PATH=${PATH}:${MAVEN_HOME}/bin
退出后
source /etc/profile
)
6. mkdir -p /opt/cachecloud-web/
cp -f /soft/cachecloud/cachecloud/cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war /opt/cachecloud-web/
cp -f /soft/cachecloud/cachecloud/cachecloud-open-web/src/main/resources/cachecloud-web.conf /opt/cachecloud-web/
7.
#添加端口
vi /etc/sysconfig/iptables
-A INPUT -m state –-state NEW -m tcp -p tcp –-dport 8585 -j ACCEPT
systemctl restart iptables.service #重启防火墙使配置生效
8. 启动:
1.作为系统服务启动,可能存在系统兼容性问题,目前redhat6.5,centos7正常,需要权限(建议使用第二种)
chmod 777 /etc/init.d/
ln -s /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.war /etc/init.d/cachecloud-web
/etc/init.d/cachecloud-web start
2.(使用脚本启动,大部分操作系统都正常) 拷贝启动脚本(cachecloud根目录下script目录下的start.sh和stop.sh)到/opt/cachecloud-web下
cp -f /soft/cachecloud/cachecloud/script/start.sh /opt/cachecloud-web/
cp -f /soft/cachecloud/cachecloud/script/stop.sh /opt/cachecloud-web/
cd /opt/cachecloud-web/
vi start.sh #将对应的内存改小
mkdir -p logs
vi cachecloud-web.log
:wq!
sh start.sh #如果机器内存不足,可以适当调小:-Xmx和-Xms(默认是4g)
sh stop.sh
tail -f /opt/cachecloud-web/logs/stdout.log #查看日志
9.访问 http://ip:8585
admin admin
10.!!!!!!添加集群是需提前将端口加入到iptabls 并重启iptables
-A INPUT -p tcp –dport 21:25 -j DROP #连续端口配置
!!!!!!!!!!!!注意!!!!!!!!!!!
添加集群错误请检查权限及初始目录