2021-06-09

Linux命令

rz 上传本地文件到服务器

rz -y 上传覆盖

centos输入rz命令出现waiting to receive

rz 与 sz 需要端支持,linux默认终端是不支持的。

常见的远程链接服务器的终端是 XShell,CRT

安装上XShell后完美解决,弹出选择文件框。

安装Xshell 可以连接到远程服务器

下载fastdfs

https://www.cnblogs.com/centos2017/p/7896760.html

fastdfs安装成功:查看目录 草地 cd /usr/bin

[root@localhost etc]# cd fdfs/
[root@localhost fdfs]# ll
total 24
-rw-r–r--. 1 root root 1461 Dec 4 15:32 client.conf.sample 客户端连接
-rw-r–r--. 1 root root 7927 Dec 4 15:32 storage.conf.sample !!
-rw-r–r--. 1 root root 105 Dec 4 15:32 storage_ids.conf.sample
-rw-r–r--. 1 root root 7389 Dec 4 15:32 tracker.conf.sample !!

fdfs配置文件

拷贝文件

[root@localhost conf]# cp http.conf /etc/fdfs/

fastdfs 只提供了linux版本

下载文件

[root@localhost fdfs]# sz storage.conf.sample

启动tracker服务器

[root@localhost fdfs]# fdfs_trackerd /etc/fdfs/tracker.conf

启动storage服务器

[root@localhost fdfs]# fdfs_storaged /etc/fdfs/storage.conf

查看服务是否开启

[root@localhost fdfs]# ps -ef | grep storage

配置成功

[root@localhost fdfs]# ps -ef | grep fdfs
root 63344 1 0 16:06 ? 00:00:04 fdfs_trackerd /etc/fdfs/tracker.conf
root 63590 1 32 16:20 ? 00:00:24 fdfs_storaged /etc/fdfs/storage.conf
root 63612 60706 0 16:21 pts/1 00:00:00 grep --color=auto fdfs

63344端口号

fastdf会自动创建data目录:

/opt/fastdfs/storage/files/data

dada里面有256个文件夹

命令行提示

[root@localhost fdfs]# fdfs_trackerd
Usage: fdfs_trackerd <config_file> [start | stop | restart]

关闭服务:

[root@localhost 00]# fdfs_trackerd /etc/fdfs/tracker.conf stop
waiting for pid [63344] exit …
pid [63344] exit.

kill -9强制杀掉进程

保存文件 退出:esc shift+: wq

文件上传命令

Usage: fdfs_test <config_file>
operation: upload, download, getmeta, setmeta, delete and query_servers
[root@localhost ~]#

usage: fdfs_test <config_file> upload <local_filename> [FILE | BUFF | CALLBACK]

[root@localhost ~]# fdfs_test /etc/fdfs/client.conf upload aa.txt

上传成功

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

group_name=group1, ip_addr=192.168.179.128, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816.txt
source ip address: 192.168.179.128
file timestamp=2020-12-04 16:48:41
file size=28
file crc32=1308385189
example file url: http://192.168.179.128/group1/M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816.txt
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816_big.txt
source ip address: 192.168.179.128
file timestamp=2020-12-04 16:48:41
file size=28
file crc32=1308385189
example file url: http://192.168.179.128/group1/M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816_big.txt
[root@localhost ~]#

文件存放地址:

group_name=group1, remote_filename=M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816.txt

M00 对应 /opt/fastdfs/storage/files(只有一个磁盘)

-rw-r–r--. 1 root root 28 Dec 4 16:48 wKizgF_J9-mADvXWAAAAHE38X6U816_big.txt 备份
-rw-r–r--. 1 root root 49 Dec 4 16:48 wKizgF_J9-mADvXWAAAAHE38X6U816_big.txt-m
-rw-r–r--. 1 root root 28 Dec 4 16:48 wKizgF_J9-mADvXWAAAAHE38X6U816.txt 本文件
-rw-r–r--. 1 root root 49 Dec 4 16:48 wKizgF_J9-mADvXWAAAAHE38X6U816.txt-m

测试下载和删除

Usage: fdfs_test <config_file>
operation: upload, download, getmeta, setmeta, delete and query_servers
[root@localhost ~]# fdfs_test /etc/fdfs/client.conf download

下载:

Usage: fdfs_test <config_file> download <group_name> <remote_filename>
[root@localhost ~]# fdfs_test /etc/fdfs/client.conf download group1 M00/00/00/wKizgF_J9-mADvXWAAAAHE38X6U816.txt

删除:delete

Linux下删除文件用rm命令

新建一个名为test的文件夹在home下
view source1 mkdir /home/test

配置nginx

/root/soft/fastdfs-nginx-module-master/src

解压文件:

[root@localhost soft]# tar -zxvf nginx-1.14.2.tar.gz

扩展模块的安装路径:/root/soft/fastdfs-nginx-module-master/src

[root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/nginx_fdfs --add-module=/root/soft/fastdfs-nginx-module-master/src

Configuration summary

  • using system PCRE library
  • OpenSSL library is not used
  • using system zlib library

nginx path prefix: “/usr/local/nginx_fdfs”
nginx binary file: “/usr/local/nginx_fdfs/sbin/nginx”
nginx modules path: “/usr/local/nginx_fdfs/modules”
nginx configuration prefix: “/usr/local/nginx_fdfs/conf”
nginx configuration file: “/usr/local/nginx_fdfs/conf/nginx.conf”
nginx pid file: “/usr/local/nginx_fdfs/logs/nginx.pid”
nginx error log file: “/usr/local/nginx_fdfs/logs/error.log”
nginx http access log file: “/usr/local/nginx_fdfs/logs/access.log”
nginx http client request body temporary files: “client_body_temp”
nginx http proxy temporary files: “proxy_temp”
nginx http fastcgi temporary files: “fastcgi_temp”
nginx http uwsgi temporary files: “uwsgi_temp”
nginx http scgi temporary files: “scgi_temp”

make: *** No rule to make target build', needed bydefault’. Stop.

解决Centos7 解决安装Nginx编辑make && make install的不成功

make: *** No rule to make target `build', needed by `default'.  Stop.

解决方案

1、安装下面配置

yum -y install make zlib-devel gcc-c++ libtool openssl openssl-devel

2、重新configure

./configure 

3、编译

make && make install

-r是递归的删除参数表中的目录及其子目录。 目录将被清空并且删除。 当删除目录包含的具有写保护的文件时用户通常是被提示的。

rm -rf /home/test

https://segmentfault.com/a/1190000018251300?utm_source=tag-newest

/root/soft/fastdfs-nginx-module-master/src

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值