将csv文件导入fastdfs中

1、将生成好的文件复制到fastdfs容器内
[root@test-ctb-xiasha-10-68 mpcdata]# docker cp ./5kw5f_x_node1.csv 20:/
[root@test-ctb-xiasha-10-68 mpcdata]#
2、进入查看文件
[root@test-ctb-xiasha-10-68 term]# docker exec -it 20 bash
bash-4.3# 
bash-4.3# ls -l -h
total 8196708
-rw-r--r--    1 root     root      667.0M Feb 21 22:59 1kw5f_x_node1.csv
-rw-r--r--    1 root     root      667.0M Feb 21 22:59 1kw5f_x_node2.csv
-rw-r--r--    1 root     root        3.3G Feb 22 00:31 5kw5f_x_node1.csv
-rw-r--r--    1 root     root        3.3G Feb 22 00:30 5kw5f_x_node2.csv
drwxr-xr-x    1 root     root          33 Jan 27 17:25 bin
drwxr-xr-x    3 root     root          21 Feb 21 10:11 data
drwxr-xr-x    5 root     root         340 Feb 21 10:11 dev


bash-4.3# 
3、输入命令执行
fdfs_test /etc/fdfs/client.conf upload 5kw5f_x_node1.csv
执行过程以及结果
bash-4.3# 
bash-4.3# fdfs_test /etc/fdfs/client.conf upload 5kw5f_x_node1.csv
This is FastDFS client test program v6.06

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.fastken.com/ 
for more detail.

[2022-02-22 10:46:43] DEBUG - base_path=/data/fastdfs/storage, connect_timeout=5, network_timeout=60, 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=10.3.10.68, port=23000

group_name=group1, ip_addr=10.3.10.68, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/04/CgMKRGIUTqSAaFgi0HQcUEj2VfI291.csv
source ip address: 10.3.10.68
file timestamp=2022-02-22 10:47:00
file size=3497270352
file crc32=1224103410
example file url: http://10.3.10.68/group1/M00/00/04/CgMKRGIUTqSAaFgi0HQcUEj2VfI291.csv
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/04/CgMKRGIUTqSAaFgi0HQcUEj2VfI291_big.csv
source ip address: 10.3.10.68
file timestamp=2022-02-22 10:47:39
file size=3497270352
file crc32=1224103410
example file url: http://10.3.10.68/group1/M00/00/04/CgMKRGIUTqSAaFgi0HQcUEj2VfI291_big.csv
bash-4.3#  
4、获取文件的url地址
example file url: http://10.3.10.68/group1/M00/00/04/CgMKRGIUTqSAaFgi0HQcUEj2VfI291_big.csv
实际使用 需要加上端口号
http://10.3.10.68:8888/group1/M00/00/04/CgMKRGIUTzWASRU00HO89zMInAk613_big.csv

 

该usl为get请求接口,在浏览器中输入后可以直接下载存好的csv文件

posted @ 2022-03-12 10:40  大青橙子  阅读(79)  评论(0编辑  收藏  举报