安装fastDFS文件

安装fastDFS文件服务器


tracker storage都在同一台服务器上。

首先,下载一下所有必需文件,然后上传至目标服务器。


nginx-1.6.0.tar.gz

FastDFS_v5.01.tar.gz

libevent-2.0.21-stable.tar.gz

fastdfs-nginx-module_v1.16.tar.gz


上传命令:  

scp -P 端口  Downloads/目标文件 jishi@10.10.xx.xx:hbase-1.3.1-bin.tar.gz


依次 tar -zxvf xxx.tar.gz 

参数说明:

z:是否同时具有gzip的属性,是否需要使用gzip压缩 

v :显示详细信息

f:  使用压缩包的名字,必需放后面..


libevent安装:


tar  -zxvf libevent-2.0.21-stable.tar.gz
cd  libevent-2.0.21-stable
mkdir -p /usr/local/libevnet
./configure --prefix=/usr/local/libevent
make && make install
#libevent创建软链接到/lib库下

ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5

FastDFS安装


进入解压后的FastDFS文件夹

cd /usr/local/FastDFS/

vim make.sh
#WITH_LINUX_SERVICE=1  /取消此行的注释

make 

make install

配置文件:



 

其中fdfs_restart.shfdfs_stop.sh以前叫restart.shstop.sh,为了避免混淆,重命名了。




首先配置tracker.conf

disabled=false            #启用配置文件
port=22122                #设置tracker的端口号
base_path=/usr/local/FastDFS/tracker   #设置tracker的数据文件和日志目录(需预先创建)
http.server_port=9090     #设置http端口号

配置好之后,启动tracker:

cd /usr/local/bin

[root@centos7-tmp bin]# ./fdfs_trackerd /etc/fdfs/tracker.conf 

查看状态:


看到storage是因为已经安装了storage后查到的。

查看日志:




然后配置storage.conf


vim /etc/fdfs/storage.conf

disabled=false
# the name of the group this storage server belongs to
group_name=group1
# the storage server port
port=23000
# the base path to store data and log files
base_path=/usr/local/FastDFS/storage
# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
store_path0=/usr/local/FastDFS/storage
# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
tracker_server=10.10.20.207:22122
# the port of the web server on this storage server
http.server_port=9090

之后启动:

cd /usr/local/bin

[root@centos7-tmp bin]# ./fdfs_storaged /etc/fdfs/storage.conf restart

然后会创建目录

之后再按trakcer的方式,查看进程,查看log,没有报错就好了。

./fdfs_monitor /etc/fdfs/storage.conf

查看storage是否已经登记到tracker

至此,tracker和storage已经安装完毕


storage节点安装nginx和fastdfs-nginx-module模块:

“在storage上安装的nginx主要为了提供http的访问服务,同时解决group中storage服务器的同步延迟问题。”

要求必须先安装zlib和pcre包。

yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel

解压fastdfs-nginx-module,解压后的路径:/usr/local/fastdfs-nginx-module

解压nginx,configuration命令,把fastdfs-nginx-module加上

./configure --user=csrr --group=jishi --prefix=/usr/local/nginx-1.11.13 --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-pcre --with-pcre-jit --add-module=/usr/local/fastdfs-nginx-module/src 


然后make&&make install


安装完之后,将插件的配置fastdfs-nginx-module文件拷贝到FastDFS配置文件目录下:

cp /usr/local/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

编辑这个文件

vim /etc/fdfs/mod_fastdfs.conf



# the base path to store log files
base_path=/usr/local/FastDFS/storage
# FastDFS tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
# valid only when load_fdfs_parameters_from_tracker is true
tracker_server=10.10.20.207:22122
# the port of the local storage server
# the default value is 23000
storage_server_port=23000
# the group name of the local storage server
group_name=group1


# if the url / uri including the group name
# set to false when uri like /M00/00/00/xxx
# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx
# default value is false
url_have_group_name=true    #设置为true。。。不然之后ngxin访问文件的时候会报错,400
# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
# must same as storage.conf
store_path0=/usr/local/FastDFS/storage
[group1]
group_name=group1
storage_server_port=23000
store_path_count=1
store_path0=/usr/local/FastDFS/storage


[group2]
group_name=group2
storage_server_port=23000
store_path_count=1
store_path0=/usr/local/FastDFS/storage


建立软连接:

ln -s /usr/local/FastDFS/storage/data/ /usr/local/FastDFS/storage/data/M00


nginx.conf配置:



上传文件进行测试:

[jishi@centos7-tmp ~]$ cd /usr/local/bin/

[jishi@centos7-tmp bin]$ sudo -s

[root@centos7-tmp bin]# ./fdfs_upload_file /etc/fdfs/client.conf /home/jishi/wendy.jpg 

group1/M00/00/00/CgoUz1lTaF-AMyMMAAGxlGN_EAs711.jpg

进入目标路径查看:



然后通过地址访问:




DONE...

//todo 权限

参考:http://www.cnblogs.com/radio/p/3799922.html

http://www.linuxdiyf.com/linux/10581.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
图像识别技术在病虫害检测中的应用是一个快速发展的领域,它结合了计算机视觉和机器学习算法来自动识别和分类植物上的病虫害。以下是这一技术的一些关键步骤和组成部分: 1. **数据收集**:首先需要收集大量的植物图像数据,这些数据包括健康植物的图像以及受不同病虫害影响的植物图像。 2. **图像预处理**:对收集到的图像进行处理,以提高后续分析的准确性。这可能包括调整亮度、对比度、去噪、裁剪、缩放等。 3. **特征提取**:从图像中提取有助于识别病虫害的特征。这些特征可能包括颜色、纹理、形状、边缘等。 4. **模型训练**:使用机器学习算法(如支持向量机、随机森林、卷积神经网络等)来训练模型。训练过程中,算法会学习如何根据提取的特征来识别不同的病虫害。 5. **模型验证和测试**:在独立的测试集上验证模型的性能,以确保其准确性和泛化能力。 6. **部署和应用**:将训练好的模型部署到实际的病虫害检测系统中,可以是移动应用、网页服务或集成到智能农业设备中。 7. **实时监测**:在实际应用中,系统可以实时接收植物图像,并快速给出病虫害的检测结果。 8. **持续学习**:随着时间的推移,系统可以不断学习新的病虫害样本,以提高其识别能力。 9. **用户界面**:为了方便用户使用,通常会有一个用户友好的界面,显示检测结果,并提供进一步的指导或建议。 这项技术的优势在于它可以快速、准确地识别出病虫害,甚至在早期阶段就能发现问题,从而及时采取措施。此外,它还可以减少对化学农药的依赖,支持可持续农业发展。随着技术的不断进步,图像识别在病虫害检测中的应用将越来越广泛。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值