FastDFS部署之踩坑.

FastDFS部署迁移 开发者中心主节点FastDFS数据存放路径:/data/developercenter_enterprise/data_center/fastdfs/store_path/00/00。启动成功会自动在/data/fastdfs/tracker目录新建data和logs目录(启动storage server的前提是tracker server必须事先已启动)在新集群的storage节点查看,若状态为ACTIVE,可去/data/fastdfs/storage/data/00/00下查看文件是否同步过来, 阅读详情

开一台新的 centos 虚拟机.

  1. 安装 jdk1.8
yum install java-1.8.0-openjdk*

自己配置环境变量也可以,个人选择.


  1. 安装Nginx所需要的环境.(此案例自己下载nginx,自己编译.)
安装环境可参考【https://www.jianshu.com/p/780a0530ed8f】

  1. 安装libevent
yum -y install libevent

1.png
准备好安装包,并解压(没有包自己去官网下载)=-=.


  1. 安装libfastcommon

将libfastcommonV1.0.7.tar.gz拷贝至/usr/local/下
cd /usr/local
tar -zxvf libfastcommonV1.0.7.tar.gz
cd libfastcommon-1.0.7
./make.sh
./make.sh install

注意:libfastcommon安装好后会自动将库文件拷贝至/usr/lib64下,由于FastDFS程序引用usr/lib目录所以需要将/usr/lib64下的库文件拷贝至/usr/lib下。
要拷贝的文件【libfastcommon.so】

[root@192 lib64]# cp libfastcommon.so ../lib

2.png

  1. tracker编译安装

将FastDFS_v5.05.tar.gz拷贝至/usr/local/下
tar -zxvf FastDFS_v5.05.tar.gz
cd FastDFS
./make.sh
./make.sh install
安装成功将安装目录下的conf下的文件拷贝到/etc/fdfs/下。
3.png

  1. 配置
    6.1进入/etc/fdfs目录
拷贝一份新的tracker配置文件:
cp tracker.conf.sample tracker.conf
修改tracker.conf
vim tracker.conf
base_path=/home/yuqing/fastdfs
改为:
base_path=/home/fastdfs

6.2启动

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

4.png
error 意思就是没有 ‘/home/fastdfs’ 这个目录,那就 mkdir -p 创建一下=。=.
然后在 启动.
5.png

6.3设置开机自动启动

vim /etc/rc.d/rc.loca
将命令添加到文件:/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

然后 wq 保存=。=.

  1. FastDFS–storage安装(和 5.tracker编译安装)一模一样,不做解释.

7.1 配置
进入/etc/fdfs目录:

拷贝一份新的storage配置文件:
cp storage.conf.sample storage.conf
修改storage.conf
vim storage.conf
group_name=group1
base_path=/home/yuqing/fastdfs改为:base_path=/home/fastdfs
store_path0=/home/yuqing/fastdfs改为:store_path0=/home/fastdfs/fdfs_storage
#如果有多个挂载磁盘则定义多个store_path,如下
#store_path1=.....
#store_path2=......
tracker_server=192.168.101.3:22122 #配置tracker服务器:IP
#如果有多个则配置多个tracker
tracker_server=192.168.101.4:22122

7.2 启动

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

一样的 写到 【/etc/rc.d/rc.local】里面

vim /etc/rc.d/rc.local
将命令添加到文件:/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
  1. 修改/etc/fdfs/client.conf
vim /etc/fdfs/client.conf
base_path=/home/fastdfs
tracker_server=192.168.101.3:22122

6.png

  1. FastDFS安装成功可通过/usr/bin/fdfs_test测试上传、下载等操作。
使用格式:
/usr/bin/fdfs_test 客户端配置文件地址  upload  上传文件

比如将/root下的图片上传到FastDFS中:
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /root/1.png

7.png


  1. FastDFS 和nginx整合
    一开始Nginx的环境已经安装好了,直接开始编译.
    8.png
    一个Nginx 一个 Fast模块

10.1 先处理下 fast-nginx-module
11.png
将FastDFS-nginx-module_v1.16.tar.gz传至/usr/local/下
cd /usr/local
tar -zxvf FastDFS-nginx-module_v1.16.tar.gz
cd FastDFS-nginx-module/src
修改config文件将/usr/local/路径改为/usr/
10.png

将FastDFS-nginx-module/src下的mod_fastdfs.conf拷贝至/etc/fdfs/下
cp mod_fastdfs.conf /etc/fdfs/
并修改mod_fastdfs.conf的内容:
vi /etc/fdfs/mod_fastdfs.conf
base_path=/home/fastdfs
tracker_server=192.168.101.3:22122
#tracker_server=192.168.101.4:22122(多个tracker配置多行)
url_have_group_name=true		#url中包含group名称
store_path0=/home/fastdfs   #指定文件存储路径
将libfdfsclient.so拷贝至/usr/lib下
cp /usr/lib64/libfdfsclient.so /usr/lib/
创建nginx/client目录
mkdir -p /var/temp/nginx/client

11.png

10.2 开始编译Nginx
进入 Nginx目录
12.png

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/fastdfs-nginx-module/src

然后 make
然后 make install


切换目录配置 nginx.conf

cd /usr/local/nginx
vim nginx.conf

13.png
最后启动Nginx
14.png

再执行一下

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /root/1.png
[root@192 conf]# /usr/bin/fdfs_test /etc/fdfs/client.conf upload /root/1.png
This is FastDFS client test program v5.05

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/ 
for more detail.

[2018-10-20 15:04:41] DEBUG - base_path=/home/fastdfs, connect_timeout=30, network_timeout=30, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0

tracker_query_storage_store_list_without_group: 
        server 1. group_name=, ip_addr=192.168.0.103, port=23000

group_name=group1, ip_addr=192.168.0.103, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKgAZ1vLpnmAL9sKAACS3YKjgyI364.png
source ip address: 192.168.0.103
file timestamp=2018-10-20 15:04:41
file size=37597
file crc32=2191754018
example file url: http://192.168.0.103/group1/M00/00/00/wKgAZ1vLpnmAL9sKAACS3YKjgyI364.png
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKgAZ1vLpnmAL9sKAACS3YKjgyI364_big.png
source ip address: 192.168.0.103
file timestamp=2018-10-20 15:04:41
file size=37597
file crc32=2191754018
example file url: http://192.168.0.103/group1/M00/00/00/wKgAZ1vLpnmAL9sKAACS3YKjgyI364_big.png
[root@192 conf]# 

访问:http://192.168.0.103/group1/M00/00/00/wKgAZ1vLpnmAL9sKAACS3YKjgyI364_big.png
15.png

迁移FastDFS 把旧集群的配置文件复制到新的集群上,并修改对应的IP地址,路径可以保持不变。 阅读详情

相关推荐

fastDFS部署及客户端的开发

非常好的指引资料 https://www.cnblogs.com/chiangchou/p/fastdfs.html按照这个指引可以完整不fastdfs部署出来,然后通过客户端(linux)进行文件上传下载,安装FastDFS环境操作环境:CentOS7 X64,以下操作都是单机环境。# vim /etc/hosts 增加如下一行,这是我的IP 192.168.51.128 file.ljzsg...

u014397507的博客 3059

FastDFS在图片上传成功之后浏览器无法通过url访问,(1.检查防火墙是否关闭,排除防火墙的问题)

This is FastDFS client test program v5.05 Copyright (C) 2008, Happy Fish / YuQing FastDFS may be copied only under the terms of the GNU General Public License V3, which may be found in the FastDFS s...

CQ_bluesky的博客 3783

FastDFS 介绍及安装部署

FastDFS 组成FastDFS上传机制FastDFS使用场景FastDFS架构实验环境部署 FastDFS安装依赖安装服务端配置 Tracker 服务端配置 Storage 服务端文件上传测试安装配置 NginxNginx 集成 FastDFS 模块FastDFS 开启自启制作 RPM 包模拟文件迁移停止旧集群服务启动新集群服务FastDFS 常用命令查看集群状态删除节点FastDFS 是一款开源的轻量级分布式文件系统,纯C实现,支持Linux、FreeBSD等类UNIX系统;

cc20100608的专栏 7419

FastDFS的安装

FastDFS 分布式文件系统 1 FastDFS介绍 1.1 什么是FastDFS ...

chenming1846的博客 295

单机版Fastdfs安装部署

一、软件包准备: 1、FastDFS_v5.05.tar.gz 2、libfastcommonV1.0.7.tar.gz 3、fastdfs-nginx-module_v1.16.tar.gz 4、nginx-1.10.2.tar.gz 二、确认环境端口是否可用,也可更换fastdfs默认端口 tracker使用:22122 storage使用:23000 ...

阿索的专栏 5308

华为 S2600T 存储 3 种网络端口(H4/H5/串口)用途解析与故障恢复实战

本文深度解析华为S2600T存储设备的三种关键网络端口(H4/H5/串口)的功能用途与故障恢复方法。通过详细的配置指南和实战案例,帮助管理员掌握管理接口(H4)的日常运维、维护接口(H5)的高级应用以及串口的应急操作,提升存储设备的可靠性和维护效率。

weixin_30899023的博客 337

Fastdfs客户端连接超时解决方案

Linux服务器上安装好的FastDFS之后,在服务器上测试上传是没问题的: /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload a.html 返回的信息如下: This is FastDFS client test program v3.06 Copyright (C) 2008, Happy Fish / YuQing Fast

Java高知社区 4万+

【网络】PFC背景和原理 、文档(DCB=PFC + ETS,DCBX=DCB扩展)

目录 零、背景 一、PFC 1.概述 2.报文格式 3.工作机制 二、ETS 产生原因 基本原理 优先级组的调度 优先级的调度 三、DCBX 产生原因 基本原理 DCBX TLV介绍 五、PFC 拥塞研究(文档收集) 六、DC-QCN算法 (网络工程师必会) 7.1 α更新 7.2 降速 7.3 提速 8.总结 ...

小鱼菜鸟的博客 2165

fastdfs单机部署踩坑

fastdfs https://github.com/happyfish100/fastdfs/wiki https://blog.csdn.net/qq_41946543/article/details/102811191 环境准备 使用的系统软件 centos7 libfatscommon FastDFS分离出的一些公用函数包 FastDFS ...

qq_43480519的博客 353

Uds诊断自动化(CANoe.diva应用)

(7)其他配置选择可以保持默认(一般情况下,DTC以及31服务、下载服务需要另外测试)。(1)打开CANoe.Diva软件,并新建Diva工程。(2)设置工程名和保存位置;在"Specification file"(3)测试案例打开后的界面如下,可以对要进行测试的案例进行勾选,(可查看下角的进度条)后;(3)等待DIva工程的生成;(4)接下来是修改Diva工程选项,如下图点击。,如用例间的时间间隔、复位等待时间等。,即可打开导入的测试工程。,即可生成测试用例。(1)在CANoe中。

LIUJIAAAAA的博客 3443

精通DC-DC变换器:Boost升压电路全解析

Boost升压变换器是一种将低直流电压转换为高直流电压的常用电路。其核心工作原理是通过电感储能:开关导通时电感充电,关断时电感与电源串联向负载供电。关键公式表明输出电压Vo=Vi/(1-D),占空比D越大,升压比越高。变换器工作时会产生电感电流纹波和输出电压纹波,需合理选择电感和电容参数。开关管和二极管需承受完整的输出电压,对元器件选型要求较高。理解这些原理是设计高效升压电源的基础。

2511_92918351的博客 3709

MAC【已解决】使用Docker部署的FastDFS踩过的坑

如下图: storage日志中的问题: [2021-12-30 06:33:09] ERROR - file: tracker_proto.c, line: 48, server: 192.168.1.6:22122, response status 2 != 0 [2021-12-30 06:33:09] ERROR - file: tracker_client_thread.c, line: 2377, fdfs_recv_response fail, result: 2 tracker日志中的问题:

qq_45296221的博客 1617

人大金仓V8R3企业版License更新全攻略:从查看到重启一步到位

本文详细解析了人大金仓V8R3企业版License更新的完整运维流程,涵盖从诊断当前授权状态、获取与验证新文件、精准定位旧文件路径,到安全替换文件及服务重启验证的全过程。重点针对更新流程中常见的版本匹配、文件定位、权限与服务重启等关键环节提供了实战解决方案和避坑指南,帮助运维人员高效、平稳地完成授权续期。

redis7keeper的博客 900

FastDFS分布式文件系统的安装和部署(带文件资源)

FastDFS分布式文件系统的安装和部署(带文件资源) 文章目录FastDFS分布式文件系统的安装和部署(带文件资源)前言一、前期准备1. 1 安装资源1.2. 使用的系统软件1.3. 安装所需软件编译环境1.4. 上传所需文件(资源在底部)二、安装流程2.1 解压libfastcommon-1.0.42.tar.gz2.2 解压FastDFS本体安装包,老样子进入FastDFS路径,解压,进入,编译,安装2.3 配置tracker/storage/client conf文件三、 测试 - 配置clie

Genmer的博客 484

从数据库到数据仓库:数据仓库导论

本文为数据仓库导论,旨在介绍数据仓库的基本理念和应用场景,帮助读者理解数据仓库的重要性及其在企业中的实际应用。

探索大数据世界 - 深入解析数据存储、分布式计算与人工智能 2784

挖矿病毒解决实例(隐藏进程,文章较好)(入侵)

CPU起飞了 最近有朋友在群里反馈,自己服务器的CPU一直处于高占用状态,但用top、ps等命令却一直找不到是哪个进程在占用,怀疑中了挖矿病毒,急的团团转。 根据经验,我赶紧让他看一下当前服务器的网络连接,看看有没有可疑连接,果然发现了有点东西: 上Shodan查一下这IP地址: 反向查找,发现有诸多域名曾经解析到这个IP地址: 这是一个位于德国的IP地址,开放了4444,5555,7777等数个特殊的服务端口: 其中这位朋友服务器上发现的连接到的是7777端口,

墨痕诉清风的博客 1万+

fastdfs安装实记

踩坑记录,方便以后使用 fastdfs 系统:centos7.4 FastDFS:5.11 libfastcommon:1.0.39 fastdfs-nginx-module:1.20 nginx:1.14.1 实测目前这个版本可用,版本更换会遇到很多奇奇怪怪的问题需要改配置 作者的GitHub地址:https://github.com/happyfish100 使用 FastDFS:5.11.z...

智树的博客 206

【教程4>第4章>第20节】基于FPGA的costas环整体实现与仿真测试

Costas 环是一种用于载波同步的闭环反馈控制系统,主要应用于通信系统中的相干解调。其基本原理是通过鉴相器(Phase Detector,PD)比较接收信号与本地载波信号的相位差,将这个相位差信息经过环路滤波器(Loop Filter,LF)滤波后,去控制数控振荡器(Numerically Controlled Oscillator,NCO)的输出频率和相位,使得本地载波能够跟踪接收信号的载波,最终实现载波同步。Costas 环环路滤波器在载波同步过程中起着不可或缺的作用。

FPGA/MATLAB学习教程/源码/项目合作开发 1263

记一次Nginx和FastDfs置过程遇到的错误解决

手动部署了一次fastdfs,遇到几个问题,本文对部署过程中出现的问题做简单说明。 部署过程参照:https://blog.csdn.net/qq_34301871/article/details/80060235 astdfs 5.11版本对照:Version 5.11对应的fastdfs-nginx-module的Version 1.20 注意1:fastdfs-nginx-module的时候,master对应的是1.21版本,配置会报错,需要选择tag中的1.20版本下载。 注..

lpping90的专栏 776

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Linux新手入门系列:FastDFS单机安装部署

本文是FastDFS的单机部署。 本系列文章是把作者刚接触和学习Linux时候的实操记录分享出来,内容主要包括Linux入门的一些理论概念知识、Web程序、mysql数据库的简单安装部署,希望能够帮到一些初学者,少走一些弯路。 注意: Linux下区分大小写; Linux多用户多线程; Linux下每个文件和目录都有访问权限; FastDFS单机安装部署 本文是FastDFS的单机部署。 安装环境:CentOS7 64位、FasDFS-5.12、libfastcommon-1.0.38、fastdf

IT小胖豆的博客 1802

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

FastDFS 的安装、使用、踩坑过程

FastDFS 的一系列踩坑1. 什么是 FastDFS2. 为什么要使用 FastDFS3. FastDFS 安装【CentOS】3.1 Tracker 安装3.2 Storage 安装4. Java 客户端测试4.1 文件上传功能测试5. Nginx 安装5.1 安装 Nginx【CentOS】5.2 安装 fastdfs-nginx-module6. Java 客户端访问图片测试7. 文件下...

永远年轻 4974

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

FastDFS踩坑日记

1.使用FastDFs正确步骤 1.在服务器部署FastDFS环境,详见:FastDFS安装 2.使用工具类完成文件上传 踩坑:目前已有前辈封装的FastDFS Java API,但是在实践的过程中可能回出现trackerClient.getConnection()为Null的问题,经过排查,与并非服务器环境的问题,所以,极有可能是上传工具类的问题。 2.如何使用工具类完成上传 1.在pom中引入fastdfs-client-java jar包1.2.7版本,目前已更新至1.2.9版本,所以,需要下载1.2

FirstMrRight的博客 446

k8s部署fastdfs

1.环境准备 1.1、准备好3台服务器,这里我以两台服务器搭建的k8s集群,还有一台用来搭建好harbor远程仓库 1.2、准备好构建fdfs所需的安装包 1.3、准备好fastdfs中相关配置文件模板 2、编写创建fastdfs镜像的Dockerfile脚本 内容如下: FROM centos:7 MAINTAINER kgf <kgf@123.com> ENV FASTDFS_PAT...

花&败 4094

fastdfs部署详解

FastDFS 是一个开源的高性能分布式文件系统。它的主要功能包括:文件存储、文件同步和文件访问(文件上传和文件下载),它可以解决高容量和负载均衡问题。FastDFS应该能满足图片分享网站、视频分享网站等以文件为基础服务的网站的要求。FastDFS有两个角色:tracker和storage。跟踪器负责文件访问的调度和负载均衡。storage 存储文件,其功能是文件管理,包括:文件存储,文件同步,提供文件访问接口。它还管理元数据,这些元数据是表示文件键值对的属性。

凤凰涅槃而生 2399

FastDFS的docker部署

usr/bin/fdfs_upload_file /etc/fdfs/client.conf /home/fastdfs/666.jpg##目标文件。tracker_server=10.30.10.186:22122 # 服务器1。tracker_server=10.30.10.188:22122 # 服务器3。tracker_server=10.30.10.188:22122 # 服务器3。tracker_server=10.30.10.188:22122 # 服务器3。

HAOQIU666的博客 924
上一篇: Centos6.4 升级内核
下一篇: 阿里-Springboot+Dubbo2.7.3使用
.JWY.
博客等级 码龄11年 10粉丝 67原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值