码迷,mamicode.com
首页 > 其他好文 > 详细

FastDFS-zyc 监控

时间:2016-08-23 20:20:27      阅读:1167      评论:0      收藏:0      [点我收藏+]

标签:

1.使用基于java 开发的开源的FastDFS 监控系统

https://code.google.com/archive/p/fastdfs-zyc/downloads

技术分享

2.fastdfs-zyc是基于java开发的,安装需要安装java环境

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm
rpm -ivh jdk-7u80-linux-x64.rpm
ln -s /usr/java/jdk1.7.0_80/ /usr/java/jdk1.7

配置环境变量
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.7
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
source /etc/profile

 3.查看安装是否成功

[root@fastdfs-zyc jdk1.7]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

 4.安装tomcat

http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4.tar.gz
tar -zxvf apache-tomcat-8.5.4.tar.gz
mv apache-tomcat-8.5.4 /usr/local/
ln -s /usr/local/apache-tomcat-8.5.4/ /usr/local/tomcat

 5.启动tomcat

cd /usr/local/tomcat/bin/
[root@fastdfs-zyc bin]# ./startup.sh 
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/java/jdk1.7
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

 6.关闭防火墙及开机自启动

[root@fastdfs-zyc bin]# chkconfig iptables off
[root@fastdfs-zyc bin]# /etc/init.d/iptables stop

 7.安装mysql,这里为了简单yum安装

[root@fastdfs-zyc bin]# yum install mysql-server                                                                  
[root@fastdfs-zyc bin]# vim /etc/my.cnf
配置文件中加入
default-character-set=utf8
[root@fastdfs-zyc bin]# /etc/init.d/mysqld start
[root@fastdfs-zyc bin]# mysqladmin -uroot password admin123

 8.创建fastdfs数据库

[root@fastdfs-zyc bin]# mysql -uroot -p
mysql> create database fastdfs;

 9.部署fastdfs-zyc监控系统

# 下载fastdfs客户端
[root@fastdfs-zyc bin]# cd /usr/local/tomcat/webapps/
[root@fastdfs-zyc webapps]# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/fastdfs-zyc/fastdfs-zyc-fastdfs_client1.24%E7%89%88%E6%9C%AC.zip --no-check-certificate
[root@fastdfs-zyc webapps]# unzip fastdfs_client1.24%88p

# 导入数据库
[root@fastdfs-zyc webapps]# cd fastdfs-zyc
[root@fastdfs-zyc fastdfs-zyc]# mysql -uroot -padmin123 --default-character-set UTF8 fastdfs < ./fdfs.sql 

 10.编辑数据连接地址

[root@fastdfs-zyc fastdfs-zyc]# vim /usr/local/tomcat/webapps/fastdfs-zyc/WEB-INF/classes/application.properties
[root@fastdfs-zyc fastdfs-zyc]# vim /usr/local/tomcat/webapps/fastdfs-zyc/WEB-INF/classes/application.properties 
datasource.type=mysql
datasource.driverClassName=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/fastdfs?useUnicode=true&characterEncoding=UTF-8      # 更改数据库连接地址
datasource.username=root    #账号
datasource.password=admin123   #密码  
datasource.maxActive=5
datasource.maxIdle=2
datasource.maxWait=120000
datasource.whenExhaustedAction=1
datasource.validationQuery=select 1 from sequenceid
datasource.testOnBorrow=true
datasource.testOnReturn=false

c3p0.acquireIncrement=3
c3p0.initialPoolSize=3
c3p0.idleConnectionTestPeriod=900
c3p0.minPoolSize=2
c3p0.maxPoolSize=50
c3p0.maxStatements=100
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600

#mail server info
mail.smtp.host=smtp.vivame.cn
mail.smtp.auth=true
mail.smtp.username=services@vivame.cn
mail.smtp.password=.`&c*43VnDMP9Y;J^9A
#cache.config=oscache.properties
~  

 11.配置存储节点的文件

[root@fastdfs-zyc fastdfs-zyc]# vim /usr/local/tomcat/webapps/fastdfs-zyc/WEB-INF/classes/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <server>
        <ip>172.16.1.42</ip>                     # 存储节点的IP地址 
        <port>22</port>
        <username>root</username>                # 数据用户
        <password>admin123</password>            
        <logpath>/usr/local/nginx-1.3.4/logs/</logpath>
    </server>            

 12.配置fdfs_client.conf

[root@fastdfs-zyc classes]# vim fdfs_client.conf 
tracker_server = 172.16.1.40:22122

 13.部署到Tomcat就可以启动了,但是你发现起来以后一直报错,无法正常使用。

更新fastdfs-client.jar,当前的最新版本为1.25:

# 进入目录
[root@fastdfs-zyc ]# cd /usr/local/tomcat/webapps/fastdfs-zyc/WEB-INF/
[root@fastdfs-zyc WEB-INF]# rz -y
或
[root@fastdfs-zyc WEB-INF]# wget https://sourceforge.net/projects/fastdfs/files/Java%20Client%20API%20Source%20Code/Java%20Client%20API%20Source%20Code%20V1.25/fastdfs_client_java._v1.25.tar.gz/download

# 备份原文件,并替换源文件
[root@fastdfs-zyc WEB-INF]# cp lib/fastdfs_client-1.24.jar lib/fastdfs_client-1.24.jar.bak
[root@fastdfs-zyc WEB-INF]# mv fastdfs_client-1.25.jar lib/fastdfs_client-1.24.jar

# 重启tomcat
[root@fastdfs-zyc WEB-INF]# /usr/local/tomcat/bin/shutdown.sh
[root@fastdfs-zyc WEB-INF]# /usr/local/tomcat/bin/startup.sh 

 14.客户端访问,http://172.16.1.50:8080/fastdfs-zyc

默认管理:admin密码123456,这个看看数据库即可

技术分享

技术分享

 

参考资料

http://blog.csdn.net/foreversunshine/article/details/51907659

FastDFS-zyc 监控

标签:

原文地址:http://www.cnblogs.com/sunmmi/p/5799863.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!