python3调用Fdfs_client 出错

windows下使用 fdfs_client 上传文件

参考 https://www.cnblogs.com/kindleheart/p/10134502.html
已经用pip安装了fdfs_client
在用语句:client = Fdfs_client(r'C:\client.conf')
调用的时候报错:

client = Fdfs_client(r'client.conf')
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\site-packages\fdfs_client\client.py", line 51, in init
self.tracker_pool = poolclass(**self.trackers)
TypeError: type object argument after ** must be a mapping, not str

麻烦各位帮忙解答。

图片说明

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么用python3.5调用fdfs_client时报错ImportError: No module named 'mutagen'?
在已经导入fdfs-client-py==1.2.6时,用python3.5调用fdfs_client时报错ImportError: No module named 'mutagen'? ``` from fdfs_client.client import Fdfs_client Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/python/FastDFS/fdfs_client-py-master/fdfs_client/client.py", line 11, in <module> from fdfs_client.tracker_client import * File "/home/python/FastDFS/fdfs_client-py-master/fdfs_client/tracker_client.py", line 17, in <module> from fdfs_client.utils import * File "/home/python/FastDFS/fdfs_client-py-master/fdfs_client/utils.py", line 8, in <module> from mutagen._compat import StringIO ImportError: No module named 'mutagen' >>> ```
为什么用python3.5调用fdfs_client时抛出异常raise DataError(errmsg + '(uploading)')?
用python3.5调用fdfs_client时抛出异常raise DataError(errmsg + '(uploading)') ``` Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from fdfs_client.client import Fdfs_client >>> client = Fdfs_client('/etc/fdfs/client.conf') >>> ret = client.upload_by_filename('test1') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/python/FastDFS/fdfs_client-py-master/fdfs_client/client.py", line 88, in upload_by_filename raise DataError(errmsg + '(uploading)') fdfs_client.exceptions.DataError: [-] Error: test1 is not a file.(uploading) >>> ``` 可是我明明有test1这个文件啊
fastdfs python客户端fdfs_client_py上传从文件问题
有人用过fdfs的python 客户端fdfs_client_py上传文件吗?我的代码如下: ``` def upload_file(self,filePath=None,slaveFilePath=None): #upload the apk and the apk details html file into fastdfs storage #apk file as master file while html file as slave file if filePath is None: return None ret={} client=Fdfs_client(self.m_clientConf) result=client.upload_by_filename(filePath) #upload master file master_fileId='' if result is not None: #success self.m_logger.info(" save %s into fdfs success"%filePath) print " save %s into fdfs success"%filePath print result ret['storageIp']=result['Storage IP'] ret['groupName']=result['Group name'] ret['masterFileId']=result['Remote file_id'] master_fileId=result['Remote file_id'] print slaveFilePath,master_fileId if(slaveFilePath is not None): #upload slave file slave_res=client.upload_slave_by_filename(slaveFilePath,master_fileId,'-html') if slave_res is not None: #success self.m_logger.info(" save slave %s into fdfs success"%slaveFilePath) ret['slaveFileId']=slave_res['Remote file_id'] return ret #return the storage info ``` 但是老是报下面的错: ![图片说明](https://img-ask.csdn.net/upload/201511/18/1447835320_129196.jpg) 从文件老是上传不成功,但是主文件却上传成功了,当我直接指定主文件id来上传从文件时,从文件却可以上传成功,有人知道怎么解决么?
fastdfs报错undefined reference to `g_exe_name'
make: Nothing to be done for `all'. cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_storaged fdfs_storaged.c ../common/fdfs_global.o ../tracker/fdfs_shared_func.o ../tracker/tracker_proto.o tracker_client_thread.o storage_global.o storage_func.o storage_service.o storage_sync.o storage_nio.o storage_dio.o storage_ip_changed_dealer.o storage_param_getter.o storage_disk_recovery.o trunk_mgr/trunk_mem.o trunk_mgr/trunk_shared.o trunk_mgr/trunk_sync.o trunk_mgr/trunk_client.o trunk_mgr/trunk_free_block_checker.o ../client/client_global.o ../client/tracker_client.o ../client/storage_client.o ../client/client_func.o fdht_client/fdht_proto.o fdht_client/fdht_client.o fdht_client/fdht_func.o fdht_client/fdht_global.o storage_dump.o -L/usr/lib64 -lpthread -lfastcommon -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon /tmp/ccWmwyMo.o: In function `main': /home/centos/fastdfs-5.10/storage/fdfs_storaged.c:130: undefined reference to `g_exe_name' storage_dump.o: In function `fdfs_dump_global_vars': /home/centos/fastdfs-5.10/storage/storage_dump.c:36: undefined reference to `g_exe_name' collect2: error: ld returned 1 exit status make: *** [fdfs_storaged] Error 1 make: Nothing to be done for `all'.
CentOS安装FastDfs错误
最近在CentOS上安装FastDFS在 编译时出现 /usr/local/lib/libfastcommon.so: undefined reference to `sqrt' /usr/local/lib/libfastcommon.so: undefined reference to `cos' 错误,请哪位大神帮忙解决一下。 详细错误如下: ``` cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_trackerd fdfs_trackerd.c ../common/fdfs_global.o tracker_proto.o tracker_mem.o tracker_service.o tracker_status.o tracker_global.o tracker_func.o fdfs_shared_func.o tracker_nio.o tracker_relationship.o tracker_dump.o ../common/linux_stack_trace.o -L/usr/local/lib -lpthread -lrt -ldl -rdynamic -lfastcommon -I../common -I/usr/include/fastcommon /usr/local/lib/libfastcommon.so: undefined reference to `sqrt' /usr/local/lib/libfastcommon.so: undefined reference to `cos' collect2: ld 返回 1 make: *** [fdfs_trackerd] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_storaged fdfs_storaged.c ../common/fdfs_global.o ../tracker/fdfs_shared_func.o ../tracker/tracker_proto.o tracker_client_thread.o storage_global.o storage_func.o storage_service.o storage_sync.o storage_nio.o storage_dio.o storage_ip_changed_dealer.o storage_param_getter.o storage_disk_recovery.o trunk_mgr/trunk_mem.o trunk_mgr/trunk_shared.o trunk_mgr/trunk_sync.o trunk_mgr/trunk_client.o trunk_mgr/trunk_free_block_checker.o ../client/client_global.o ../client/tracker_client.o ../client/storage_client.o ../client/client_func.o fdht_client/fdht_proto.o fdht_client/fdht_client.o fdht_client/fdht_func.o fdht_client/fdht_global.o storage_dump.o ../common/linux_stack_trace.o -L/usr/local/lib -lpthread -lrt -ldl -rdynamic -lfastcommon -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon /usr/local/lib/libfastcommon.so: undefined reference to `sqrt' /usr/local/lib/libfastcommon.so: undefined reference to `cos' collect2: ld 返回 1 make: *** [fdfs_storaged] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_monitor fdfs_monitor.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -lpthread -lrt -ldl -rdynamic -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon /usr/lib/gcc/i686-redhat-linux/4.4.7/../../../libfastcommon.so: undefined reference to `sqrt' /usr/lib/gcc/i686-redhat-linux/4.4.7/../../../libfastcommon.so: undefined reference to `cos' ``` 环境:CentOS6.x, FastDFS-5.05 此问题已解决: 此问题是由于 libfastcommon-master 版本问题,改为libfastcommon-1.0.7后,再进行编译就OK了。
FastDFS 在Linux系统上安装失败
<font color='red'>在FastDFS目录下执行 ./make.sh 出现一大堆错误。这是什么问题??</font> * 目录 ``` [root@localhost fastdfs-5.10]# ll 总用量 136 drwxrwxr-x. 3 root root 4096 4月 15 20:38 client drwxrwxr-x. 2 root root 4096 4月 6 09:38 common drwxrwxr-x. 2 root root 4096 4月 6 09:38 conf -rw-rw-r--. 1 root root 35067 4月 6 09:38 COPYING-3_0.txt -rw-rw-r--. 1 root root 3171 4月 6 09:38 fastdfs.spec -rw-rw-r--. 1 root root 32930 4月 6 09:38 HISTORY drwxrwxr-x. 2 root root 4096 4月 6 09:38 init.d -rw-rw-r--. 1 root root 7755 4月 6 09:38 INSTALL -rwxrwxr-x. 1 root root 5548 4月 6 09:38 make.sh drwxrwxr-x. 2 root root 4096 4月 6 09:38 php_client -rw-rw-r--. 1 root root 2380 4月 6 09:38 README.md -rwxrwxr-x. 1 root root 1768 4月 6 09:38 restart.sh -rwxrwxr-x. 1 root root 1680 4月 6 09:38 stop.sh drwxrwxr-x. 4 root root 4096 4月 15 20:38 storage drwxrwxr-x. 2 root root 4096 4月 6 09:38 test drwxrwxr-x. 2 root root 4096 4月 15 20:38 tracker ``` * 执行结果 ``` [root@localhost fastdfs-5.10]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I../tracker -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 ```
FastDFS安装时遇到错误
今天在服务器上安装FastDFS,应该是CentOS的。 安装libfastcommon之后,就安装FastDFS的包嘛,在 ./make.sh的命令时出现一堆错误,无法继续下去了! 忘大佬解答!!~~~ ``` [root@localhost ~]# cd .. [root@localhost /]# cd software [root@localhost software]# cd FastDFS [root@localhost FastDFS]# ll 总用量 132 drwxr-xr-x. 3 8980 users 4096 12月 22 00:49 client drwxr-xr-x. 2 8980 users 4096 2月 4 2016 common drwxr-xr-x. 2 8980 users 4096 2月 4 2016 conf -rw-r--r--. 1 8980 users 35067 2月 4 2016 COPYING-3_0.txt -rw-r--r--. 1 8980 users 2857 2月 4 2016 fastdfs.spec -rw-r--r--. 1 8980 users 32218 2月 4 2016 HISTORY drwxr-xr-x. 2 8980 users 4096 2月 4 2016 init.d -rw-r--r--. 1 8980 users 7755 2月 4 2016 INSTALL -rwxr-xr-x. 1 8980 users 5548 2月 4 2016 make.sh drwxr-xr-x. 2 8980 users 4096 2月 4 2016 php_client -rw-r--r--. 1 8980 users 2380 2月 4 2016 README.md -rwxr-xr-x. 1 8980 users 1768 2月 4 2016 restart.sh -rwxr-xr-x. 1 8980 users 1680 2月 4 2016 stop.sh drwxr-xr-x. 4 8980 users 4096 12月 22 00:49 storage drwxr-xr-x. 2 8980 users 4096 2月 4 2016 test drwxr-xr-x. 2 8980 users 4096 12月 22 00:49 tracker [root@localhost FastDFS]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_ global.o ../common/fdfs_global.c -I../common -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_ global.o ../common/fdfs_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_ global.o ../common/fdfs_global.c -I../common -I../tracker -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录 在包含自 ../common/fdfs_global.c:21 的文件中: ../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录 ../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录 In file included from ../common/fdfs_global.c:21: ../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内) ../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内) ../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_fdfs_version’ ../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_use_connection_pool’ ../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef ore ‘g_connection_pool’ ../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中: ../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’ ../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’ make: *** [../common/fdfs_global.o] 错误 1 [root@localhost FastDFS]# ```
fastdfs启动失败并没有日志生成
centos7 + Fastdfs 5,安装成功后,使用systemctl启动storage和tracker,查看status显示active(exited),没有报错,netstat命令看到没有22122和23000端口被启动,status记录: fdfs_storaged.service - LSB: FastDFS storage server Loaded: loaded (/etc/rc.d/init.d/fdfs_storaged) Active: active (exited) since Fri 2016-07-08 15:53:03 CST; 18min ago Docs: man:systemd-sysv-generator(8) Process: 26569 ExecStart=/etc/rc.d/init.d/fdfs_storaged start (code=exited, status=0/SUCCESS) Jul 08 15:53:03 iZ238slz3o8Z systemd[1]: Starting LSB: FastDFS storage server... Jul 08 15:53:03 iZ238slz3o8Z fdfs_storaged[26569]: Starting FastDFS storage server: Jul 08 15:53:03 iZ238slz3o8Z systemd[1]: Started LSB: FastDFS storage server. Jul 08 15:53:03 iZ238slz3o8Z fdfs_storaged[26569]: Usage: /usr/local/bin/fdfs_storaged {start|stop|status|restart|condrestart} Jul 08 15:53:26 iZ238slz3o8Z systemd[1]: Started LSB: FastDFS storage server. storage与tracker的指定目录下没有生成log,请问会是什么原因引起的?谢谢
centOS 5.5中FastDFS v5.04时报[fdfs_storaged] 错误:
libfastcommon: ![图片说明](https://img-ask.csdn.net/upload/201611/11/1478836226_485567.png) ./make.sh FastDFS时的报错: ![图片说明](https://img-ask.csdn.net/upload/201611/11/1478836255_910775.png) ![图片说明](https://img-ask.csdn.net/upload/201611/11/1478836265_420462.png) ![图片说明](https://img-ask.csdn.net/upload/201611/11/1478836275_694713.png) ![图片说明](https://img-ask.csdn.net/upload/201611/11/1478836284_625637.png)
Linux搭建Fastdfs文件服务器安装nginx问题
/home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c In file included from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6:0: /home/jumper/fastdfs-nginx-module/src//common.c:43:2: error: unknown type name ‘FDFSStorePaths’ FDFSStorePaths store_paths; ^ /home/jumper/fastdfs-nginx-module/src//common.c: In function ‘fdfs_load_groups_store_paths’: /home/jumper/fastdfs-nginx-module/src//common.c:123:35: error: request for member ‘paths’ in something not a structure or union group_store_paths[i].store_paths.paths = \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:123:3: error: implicit declaration of function ‘storage_load_paths_from_conf_file_ex’ [-Werror=implicit-function-declaration] group_store_paths[i].store_paths.paths = \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:125:58: error: request for member ‘count’ in something not a structure or union section_name, false, &group_store_paths[i].store_paths.count, \ ^ /home/jumper/fastdfs-nginx-module/src//common.c: In function ‘fdfs_mod_init’: /home/jumper/fastdfs-nginx-module/src//common.c:338:43: error: request for member ‘count’ in something not a structure or union storage_server_port, g_fdfs_store_paths.count); ^ /home/jumper/fastdfs-nginx-module/src//common.c:339:33: error: request for member ‘count’ in something not a structure or union for (i=0; i<g_fdfs_store_paths.count; i++) ^ /home/jumper/fastdfs-nginx-module/src//common.c:343:23: error: request for member ‘paths’ in something not a structure or union g_fdfs_store_paths.paths[i]); ^ /home/jumper/fastdfs-nginx-module/src//common.c:392:48: error: request for member ‘count’ in something not a structure or union for (i=0; i<group_store_paths[k].store_paths.count; i++) ^ /home/jumper/fastdfs-nginx-module/src//common.c:396:38: error: request for member ‘paths’ in something not a structure or union group_store_paths[k].store_paths.paths[i]); ^ /home/jumper/fastdfs-nginx-module/src//common.c:403:16: error: request for member ‘count’ in something not a structure or union store_paths.count, buff); ^ /home/jumper/fastdfs-nginx-module/src//common.c: In function ‘fdfs_http_request_handler’: /home/jumper/fastdfs-nginx-module/src//common.c:556:2: error: unknown type name ‘FDFSStorePaths’ FDFSStorePaths *pStorePaths; ^ /home/jumper/fastdfs-nginx-module/src//common.c:651:15: error: assignment from incompatible pointer type [-Werror] pStorePaths = &g_fdfs_store_paths; ^ /home/jumper/fastdfs-nginx-module/src//common.c:684:15: error: assignment from incompatible pointer type [-Werror] pStorePaths = &g_fdfs_store_paths; ^ /home/jumper/fastdfs-nginx-module/src//common.c:763:35: error: request for member ‘count’ in something not a structure or union store_path_index >= pStorePaths->count) ^ /home/jumper/fastdfs-nginx-module/src//common.c:769:34: error: request for member ‘count’ in something not a structure or union store_path_index, pStorePaths->count); ^ /home/jumper/fastdfs-nginx-module/src//common.c:808:3: error: implicit declaration of function ‘trunk_file_stat_ex1’ [-Werror=implicit-function-declaration] if ((result=trunk_file_stat_ex1(pStorePaths, store_path_index, \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:868:17: error: request for member ‘paths’ in something not a structure or union pStorePaths->paths[store_path_index], \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:973:2: error: implicit declaration of function ‘fdfs_http_get_file_extension’ [-Werror=implicit-function-declaration] ext_name = fdfs_http_get_file_extension(true_filename, \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:973:11: error: assignment makes pointer from integer without a cast [-Werror] ext_name = fdfs_http_get_file_extension(true_filename, \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:977:2: error: passing argument 3 of ‘fdfs_http_get_content_type_by_extname’ makes pointer from integer without a cast [-Werror] if (fdfs_http_get_content_type_by_extname(&g_http_params, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//common.c:27:0, from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6: /usr/local/include/fastdfs/fdfs_http_shared.h:103:5: note: expected ‘char *’ but argument is of type ‘int’ int fdfs_http_get_content_type_by_extname(FDFSHTTPParams *pParams, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6:0: /home/jumper/fastdfs-nginx-module/src//common.c:977:2: error: passing argument 4 of ‘fdfs_http_get_content_type_by_extname’ makes integer from pointer without a cast [-Werror] if (fdfs_http_get_content_type_by_extname(&g_http_params, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//common.c:27:0, from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6: /usr/local/include/fastdfs/fdfs_http_shared.h:103:5: note: expected ‘int’ but argument is of type ‘char *’ int fdfs_http_get_content_type_by_extname(FDFSHTTPParams *pParams, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6:0: /home/jumper/fastdfs-nginx-module/src//common.c:977:2: error: too many arguments to function ‘fdfs_http_get_content_type_by_extname’ if (fdfs_http_get_content_type_by_extname(&g_http_params, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//common.c:27:0, from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6: /usr/local/include/fastdfs/fdfs_http_shared.h:103:5: note: declared here int fdfs_http_get_content_type_by_extname(FDFSHTTPParams *pParams, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6:0: /home/jumper/fastdfs-nginx-module/src//common.c:1092:3: error: unknown type name ‘ConnectionInfo’ ConnectionInfo storage_server; ^ /home/jumper/fastdfs-nginx-module/src//common.c:1096:24: error: request for member ‘ip_addr’ in something not a structure or union strcpy(storage_server.ip_addr, file_info.source_ip_addr); ^ /home/jumper/fastdfs-nginx-module/src//common.c:1097:17: error: request for member ‘port’ in something not a structure or union storage_server.port = the_storage_port; ^ /home/jumper/fastdfs-nginx-module/src//common.c:1098:17: error: request for member ‘sock’ in something not a structure or union storage_server.sock = -1; ^ /home/jumper/fastdfs-nginx-module/src//common.c:1104:3: error: passing argument 2 of ‘storage_download_file_ex1’ from incompatible pointer type [-Werror] result = storage_download_file_ex1(NULL, \ ^ In file included from /usr/local/include/fastdfs/fdfs_client.h:17:0, from /home/jumper/fastdfs-nginx-module/src//common.c:28, from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6: /usr/local/include/fastdfs/storage_client1.h:274:5: note: expected ‘struct TrackerServerInfo *’ but argument is of type ‘int *’ int storage_download_file_ex1(TrackerServerInfo *pTrackerServer, \ ^ In file included from /home/jumper/fastdfs-nginx-module/src//ngx_http_fastdfs_module.c:6:0: /home/jumper/fastdfs-nginx-module/src//common.c:1133:3: error: implicit declaration of function ‘trunk_get_full_filename_ex’ [-Werror=implicit-function-declaration] trunk_get_full_filename_ex(pStorePaths, &trunkInfo, \ ^ /home/jumper/fastdfs-nginx-module/src//common.c:1143:16: error: request for member ‘paths’ in something not a structure or union pStorePaths->paths[store_path_index], \ ^ cc1: all warnings being treated as errors make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1 make[1]: Leaving directory `/home/jumper/nginx-1.0.11' make: *** [build] Error 2
windows环境下安装docker来搭建fastfds服务连接失败
问题描述: 在windows10的环境下,安装docker,基于docker来搭建fastfds服务,出现连接失败。 root@linuxkit-00155d052103:/# cd /fdfs_conf/ root@linuxkit-00155d052103:/fdfs_conf# fdfs_monitor storage.conf [2019-05-13 08:30:00] DEBUG - base_path=/fastdfs/storage, connect_timeout=30, 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 server_count=1, server_index=0 [2019-05-13 08:30:01] ERROR - file: ../common/connection_pool.c, line: 84, connect to 172.16.5.40:22122 fail, errno: 111, error info: Connection refused storage.conf配置 tracker_server=172.16.5.40:22122 其中172.16.5.40:为windows(宿主机的)IP
fastdfs python客户端下载文件问题
遇到一个很奇怪的问题,从服务端下载压缩文件的的时候,再用zipfile解压时,说格式错误,不是正确的压缩问价,而用Java下载文件又没有问题,什么情况 我的代码: client = Fdfs_client(self.m_clientConf) localFileName = os.path.join(config.apksPath,apkMd5 + '.apk'); down_status = client.download_to_file(localFileName,remoteUrl) 然后用ZipFile解压报错: Traceback (most recent call last): File "D:/Projects/PythonProjects/androguard/pliblyze.py", line 220, in mfMainOperate androguard = Androguard([options.input]) File "D:\Projects\PythonProjects\androguard\androguard\core\androgen.py", line 98, in __init__ self._analyze() File "D:\Projects\PythonProjects\androguard\androguard\core\androgen.py", line 112, in _analyze x = apk.APK( i ) File "D:\Projects\PythonProjects\androguard\androguard\core\bytecodes\apk.py", line 186, in __init__ self.zip = zipfile.ZipFile(StringIO.StringIO(self.__raw), mode=mode) File "D:\Python27\lib\zipfile.py", line 770, in __init__ self._RealGetContents() File "D:\Python27\lib\zipfile.py", line 811, in _RealGetContents raise BadZipfile, "File is not a zip file" BadZipfile: File is not a zip file
django后端使用了fastdfs存储,那么用户怎么在前端input上传图片到服务器并被接收
django后端使用了fastdfs存储,那么用户在前端input上传图片到服务器,怎么接收保存,图片存哪了,怎么知道路径和名字? ![图片说明](https://img-ask.csdn.net/upload/201906/25/1561395433_293023.png) 这是上传以后前端返回结果 ![图片说明](https://img-ask.csdn.net/upload/201906/25/1561396591_360028.png) 图片里的fastdfs配置没问题,admin管理站点上传都正常,但是普通用户怎么上传图片上来呢,比如说用户想上传个头像图片什么的。 前端相关代码段 ``` <form method="post" action="/juhe/setqcode" enctype="multipart/form-data"> {%csrf_token%} <input type="file" name="pic1"/><br> <input type="submit" name="wxpay" value="上传"> </form> <p> {{ neirong }} # 这些是为了测试回传的数据有没有 </p> 这是F1{{ A }}这是F2{{ B }}然后F3{{ C }} ``` 后端该怎么写呢?半天了也没搜出来答案 是真不会 自己瞎测试一通 f1 f2 f3 都没有内容 ``` class JhQcodeUpload(LoginRequiredMixin,View): def post(self,request): # try: f1 = request.FILES.get('name') f2 = request.FILES.get('pic1') # 这个的返回值存在 f3 = request.FILES.get('wxpay') # # conf = get_tracker_conf('/etc/fastdfs/client.conf') # client = Fdfs_client(conf) # # # client.upload_by_filename(f1) # return HttpResponse('OK') return render(request, 'juhe_myqcode.html', {'neirong': 'ok1','A':f1,'B':f2,'C':f3}) ```
在linux系统中安装FastDFS,运行./make.sh报错
我是按照这篇博客来安装的http://www.bkjia.com/Linux/1048217.html 第一步安装libevent成功,后面解压fastdFS(版本跟博客说的不一致),解压后按照博文说的去配置 vim make.sh ,配置好后在执行 “./make.sh C_INCLUDE_PATH=/home/users/wangyanpei/libevent-2.0.21/include LIBRARY_PATH=/home/users/miaolinjie/libevent-2.0.21/lib/ ” 就报错: collect2: error: ld returned 1 exit status Makefile:80: recipe for target 'fdfs_monitor' failed 请问这是什么意思?
feign MultipartFile fastdfs跨服务调用文件上传
基本情况是: 不是通过浏览器请求,是微服务中在服务启动后自动把制定目录下的文件,通过feign调用文件上传接口,将文件保存到服务器。 参考了各位的建议之后,还是报相同的错误。 贴出一段idea中的异常信息: feign.FeignException: status 500 reading RemoteFdfsService#fdfsUpload(MultipartFile); content: {"msg":"Current request is not a multipart request","code":1,"data":null} at feign.FeignException.errorStatus(FeignException.java:60) at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:89) at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:143) at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:77) at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:107) at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302) at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298) at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46) at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) 调用部分代码(接口需要的是MultipartFile的文件参数) String filePath = "F:\\mac\\pic\\20181113184344_type[0]_ItsPlate.jpg"; File file = new File(filePath); FileInputStream fileInputStream = new FileInputStream(file); MultipartFile multipartFile = new MockMultipartFile(file.getName(), fileInputStream); String url = remoteFdfsService.fdfsUpload(multipartFile); feign: @FeignClient(value = ServiceNameConstant.FDFS_SERVICE, configuration = RemoteFdfsService.MultipartSupportConfig.class, fallbackFactory = RemoteFdfsServiceFallbackFactory.class) public interface RemoteFdfsService { /** * 上传图片并且生成缩略图 * @param file * @return */ @PostMapping(value = "/fdfs/upload_image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) String fdfsUploadImage(@RequestPart(value = "file") MultipartFile file); /** * 引用配置类MultipartSupportConfig.并且实例化 */ @Configuration class MultipartSupportConfig { @Bean public Encoder feignFormEncoder() { return new SpringFormEncoder(); } } } 烦请各路上仙指点一二,多谢。
fastdfs有关tracker服务器返回storage服务器ip地址的问题。
在storage.conf的配置中,tracker_server的参数配置的是外网,具体参数为183.62.##.##:23000,但是在centos里面做 测试上传的时候,却出现一下错误: tracker_query_storage_store_list_without_group: server 1. group_name=, ip_addr=192.168.1.253, port=23000 group_name=group1, ip_addr=192.168.1.253, port=23000 [2018-03-22 09:27:31] ERROR - file: connection_pool.c, line: 110, connect to 192.168.1.253:23000 fail, errno: 110, error info: Connection timed out。 然后同过命令fdfs_monitor /etc/fdfs/storage.conf查看,参数如下: Storage 1: id = 192.168.1.226 ip_addr = 192.168.1.226 (centos7) OFFLINE http domain = 183.62.**.** version = 5.05 join time = 2018-03-20 14:47:47 up time = total storage = 172651 MB free storage = 172578 MB upload priority = 10 store_path_count = 1 subdir_count_per_path = 256 storage_port = 23000 storage_http_port = 23000 current_write_path = 0 source storage id = if_trunk_server = 0 connection.alloc_count = 0 connection.current_count = 0 connection.max_count = 0 total_upload_count = 42 success_upload_count = 42 total_append_count = 0 success_append_count = 0 total_modify_count = 0 success_modify_count = 0 total_truncate_count = 0 success_truncate_count = 0 total_set_meta_count = 22 success_set_meta_count = 22 total_delete_count = 0 success_delete_count = 0 total_download_count = 0 success_download_count = 0 total_get_meta_count = 0 success_get_meta_count = 0 total_create_link_count = 0 success_create_link_count = 0 total_delete_link_count = 0 success_delete_link_count = 0 total_upload_bytes = 5524950 success_upload_bytes = 5524950 total_append_bytes = 0 success_append_bytes = 0 total_modify_bytes = 0 success_modify_bytes = 0 stotal_download_bytes = 0 success_download_bytes = 0 total_sync_in_bytes = 0 success_sync_in_bytes = 0 total_sync_out_bytes = 0 success_sync_out_bytes = 0 total_file_open_count = 42 success_file_open_count = 42 total_file_read_count = 0 success_file_read_count = 0 total_file_write_count = 42 success_file_write_count = 42 last_heart_beat_time = 2018-03-22 09:25:33 last_source_update = 2018-03-21 18:21:50 last_sync_update = 1970-01-01 08:00:00 last_synced_timestamp = 1970-01-01 08:00:00 (never synced) Storage 2: id = 192.168.1.253 ip_addr = 192.168.1.253 (gateway.lan.localnet) ACTIVE http domain = 183.62.**.** version = 5.05 join time = 2018-03-20 14:47:47 up time = 2018-03-22 09:25:51 total storage = 172651 MB free storage = 172578 MB upload priority = 10 store_path_count = 1 subdir_count_per_path = 256 storage_port = 23000 storage_http_port = 23000 current_write_path = 0 source storage id = if_trunk_server = 0 connection.alloc_count = 256 connection.current_count = 0 connection.max_count = 0 total_upload_count = 42 success_upload_count = 42 total_append_count = 0 success_append_count = 0 total_modify_count = 0 success_modify_count = 0 total_truncate_count = 0 success_truncate_count = 0 total_set_meta_count = 22 success_set_meta_count = 22 total_delete_count = 0 success_delete_count = 0 total_download_count = 0 success_download_count = 0 total_get_meta_count = 0 success_get_meta_count = 0 total_create_link_count = 0 success_create_link_count = 0 total_delete_link_count = 0 success_delete_link_count = 0 total_upload_bytes = 5524950 success_upload_bytes = 5524950 total_append_bytes = 0 success_append_bytes = 0 total_modify_bytes = 0 success_modify_bytes = 0 stotal_download_bytes = 0 success_download_bytes = 0 total_sync_in_bytes = 0 success_sync_in_bytes = 0 total_sync_out_bytes = 0 success_sync_out_bytes = 0 total_file_open_count = 42 success_file_open_count = 42 total_file_read_count = 0 success_file_read_count = 0 total_file_write_count = 42 success_file_write_count = 42 last_heart_beat_time = 2018-03-22 09:25:52 last_source_update = 2018-03-21 18:21:50 last_sync_update = 1970-01-01 08:00:00 last_synced_timestamp = 1970-01-01 08:00:00 (never synced) 请问该如何解决?
springboot整合百度Ueditor,图片上传成功,回显时,自动添加http://localhost
图片上传使用了fdfs上传到一个单独的服务器,返回的地址也对,但是到了回显图片的时候一直会自动添加localhost![图片说明](https://img-ask.csdn.net/upload/201908/12/1565580509_866059.jpg) link里放的时图片的路径192.11.xx.xx/xx/xx 但是到了loader.setAttribute('src',link);的时候就会变成localhost:8080/192.11.xx.xx/xx/xx 怎样才能让路径变成绝对的
FastDFS JAVA socket Address already in use:connect
引用可happyfish100的官方fastdfs-java-client-master的包,用线程去进行压力测试;通过不了,有谁解决过类似的问题? 主类: ``` public class FastDFSTestPool { public static void main(String[] args) throws IOException, MyException{ String local_filename = "D:\\smallData.xml"; FastDFSBean fb = new FastDFSBean(); fb.setFileName("TestFile"); fb.setFileExt("xml"); File file = new File(local_filename); fb.setFile(file); Resource resource = new FileSystemResource("d:\\fdfs_client.conf"); File file2 = resource.getFile(); String configFile = file2.getAbsolutePath(); ClientGlobal.init(configFile); ExecutorService fixedThreadPool = Executors.newFixedThreadPool(100); for (int i = 0; i < 50; i++) { fixedThreadPool.execute(new FastdfsThread(fb)); } } } ``` 线程类: ``` public class FastdfsThread implements Runnable { private FastDFSBean bean ; public FastdfsThread(){ super(); } public FastdfsThread(FastDFSBean bean1){ super(); this.bean = bean1; } @Override public void run() { try { TrackerServer trackerServer = null; StorageServer storageServer = null; for (int i = 0; i < 100000; i++) { TrackerClient tracker = new TrackerClient(); trackerServer = tracker.getConnection(); StorageClient storageClient = new StorageClient(trackerServer, storageServer); NameValuePair nvp[] = new NameValuePair[] { new NameValuePair("age", i+""), new NameValuePair("sex", Thread.currentThread().getName()+i) }; byte[] filebtyes = fileToBytes(this.bean.getFile());//bean为file的实体类 String fileIds[] = storageClient.upload_file(filebtyes, this.bean.getFileExt(), nvp); System.out.println("文件数:"+i+" 组名:" + fileIds[0]+" 路径: " + fileIds[1]); trackerServer.close(); } } catch (IOException e) { e.printStackTrace(); } catch (MyException e) { e.printStackTrace(); } } public byte[] fileToBytes(File file) { byte[] buffer = null; FileInputStream fis = null; ByteArrayOutputStream bos = null; try { fis = new FileInputStream(file); bos = new ByteArrayOutputStream(); byte[] b = new byte[1024]; int n; while ((n = fis.read(b)) != -1) { bos.write(b, 0, n); } buffer = bos.toByteArray(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { try { if (null != bos) { bos.close(); } } catch (IOException ex) { ex.printStackTrace(); } finally{ try { if(null!=fis){ fis.close(); } } catch (IOException ex) { ex.printStackTrace(); } } } return buffer; } } ```
fdfs图片服务器上传报错recv package size -1 != 10
java.io.IOException: recv package size -1 != 10 at org.csource.fastdfs.ProtoCommon.recvHeader(ProtoCommon.java:214) at org.csource.fastdfs.ProtoCommon.recvPackage(ProtoCommon.java:250) at org.csource.fastdfs.TrackerClient.getStoreStorage(TrackerClient.java:143) at org.csource.fastdfs.StorageClient.newWritableStorageConnection(StorageClient.java:1938) at org.csource.fastdfs.StorageClient.do_upload_file(StorageClient.java:703) at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:208) at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:226) at org.csource.fastdfs.StorageClient1.upload_file1(StorageClient1.java:112) at com.taotao.service.util.FastDFSClient.uploadFile(FastDFSClient.java:63) at com.taotao.service.util.FastDFSClient.uploadFile(FastDFSClient.java:72) at com.taotao.service.impl.PictureServiceImpl.upload(PictureServiceImpl.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy37.upload(Unknown Source) at com.taotao.controller.PictureController.upload(PictureController.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载 点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。 ...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
GitHub标星近1万:只需5秒音源,这个网络就能实时“克隆”你的声音
作者 | Google团队 译者 | 凯隐 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) 本文中,Google 团队提出了一种文本语音合成(text to speech)神经系统,能通过少量样本学习到多个不同说话者(speaker)的语音特征,并合成他们的讲话音频。此外,对于训练时网络没有接触过的说话者,也能在不重新训练的情况下,仅通过未知...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
4G EPS 第四代移动通信系统
目录 文章目录目录4G 与 LTE/EPCLTE/EPC 的架构E-UTRANE-UTRAN 协议栈eNodeBEPCMMES-GWP-GWHSSLTE/EPC 协议栈概览 4G 与 LTE/EPC 4G,即第四代移动通信系统,提供了 3G 不能满足的无线网络宽带化,主要提供数据(上网)业务。而 LTE(Long Term Evolution,长期演进技术)是电信领域用于手机及数据终端的高速无线通...
相关热词 c# 引用mysql c#动态加载非托管dll c# 两个表数据同步 c# 返回浮点json c# imap 链接状态 c# 漂亮字 c# 上取整 除法 c#substring c#中延时关闭 c#线段拖拉
立即提问