fastdfs icon indicating copy to clipboard operation
fastdfs copied to clipboard

./mak.sh failed in [email protected]

Open Tom-python0121 opened this issue 3 years ago • 2 comments

I have a problem:

[root@localhost fastdfs-6.07]# ./make.sh
……
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o storage_sync_func.o storage_sync_func.c  -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon
storage_sync_func.c: In function ‘storage_sync_connect_storage_server_ex’:
storage_sync_func.c:88:33: warning: passing argument 3 of ‘socketCreateExAuto’ makes integer from pointer without a cast [-Wint-conversion]
                     g_bind_addr : NULL, &result);
                                 ^
In file included from storage_sync_func.c:25:
/usr/include/fastcommon/sockopt.h:352:32: note: expected ‘int’ but argument is of type ‘char *’
   const int timeout, const int flags,
                      ~~~~~~~~~~^~~~~
storage_sync_func.c:88:41: warning: passing argument 4 of ‘socketCreateExAuto’ from incompatible pointer type [-Wincompatible-pointer-types]
                     g_bind_addr : NULL, &result);
                                         ^~~~~~~
In file included from storage_sync_func.c:25:
/usr/include/fastcommon/sockopt.h:353:21: note: expected ‘const char *’ but argument is of type ‘int *’
         const char *bind_ipaddr, int *err_no)
         ~~~~~~~~~~~~^~~~~~~~~~~
storage_sync_func.c:86:26: error: too few arguments to function ‘socketCreateExAuto’
             conn->sock = socketCreateExAuto(conn->ip_addr,
                          ^~~~~~~~~~~~~~~~~~
In file included from storage_sync_func.c:25:
/usr/include/fastcommon/sockopt.h:351:19: note: declared here
 static inline int socketCreateExAuto(const char *server_ip,
                   ^~~~~~~~~~~~~~~~~~
make: *** [Makefile:34: storage_sync_func.o] Error 1
……
[root@localhost fastdfs-6.07]# ./make.sh install
mkdir -p /usr/bin
mkdir -p /etc/fdfs
cp -f fdfs_trackerd /usr/bin
if [ ! -f /etc/fdfs/tracker.conf.sample ]; then cp -f ../conf/tracker.conf /etc/fdfs/tracker.conf.sample; fi
if [ ! -f /etc/fdfs/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf /etc/fdfs/storage_ids.conf.sample; fi
mkdir -p /usr/bin
mkdir -p /etc/fdfs
cp -f fdfs_storaged  /usr/bin
cp: cannot stat 'fdfs_storaged': No such file or directory
make: *** [Makefile:38: install] Error 1
mkdir -p /usr/bin
mkdir -p /etc/fdfs
mkdir -p /usr/lib64
mkdir -p /usr/lib
cp -f fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file fdfs_download_file fdfs_delete_file fdfs_file_info fdfs_appender_test fdfs_appender_test1 fdfs_append_file fdfs_upload_appender fdfs_regenerate_filename /usr/bin
if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi
if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;fi
mkdir -p /usr/include/fastdfs
cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../tracker/fdfs_server_id_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/include/fastdfs
if [ ! -f /etc/fdfs/client.conf.sample ]; then cp -f ../conf/client.conf /etc/fdfs/client.conf.sample; fi

Can you help fix this bug? my sysyteminfo:

  • Python: 3.6.8
  • Platform: linux-centos8-aarch64
  • Concretizer: original

Tom-python0121 avatar Jun 11 '21 08:06 Tom-python0121

you should use libfastcommon version >= 1.0.47

happyfish100 avatar Jun 11 '21 08:06 happyfish100

@happyfish100 ,Thanks for your help, I have solved the problem, but I have another test problem:

[root@centos8 fastdfs-6.07]# cd /etc/fdfs
[root@centos8 fdfs]# ls
client.conf.sample  storage.conf.sample  storage_ids.conf.sample  tracker.conf.sample
[root@centos8 fdfs]# cp tracker.conf.sample  tracker.conf
[root@centos8 fdfs]# ls
client.conf.sample  storage.conf.sample  storage_ids.conf.sample  tracker.conf  tracker.conf.sample
[root@centos8 fdfs]# cp storage.conf.sample storage.conf
[root@centos8 fdfs]# cp client.conf.sample client.conf
[root@centos8 fdfs]# ls
client.conf  client.conf.sample  storage.conf  storage.conf.sample  storage_ids.conf.sample  tracker.conf  tracker.conf.sample
[root@centos8 fdfs]# vim tracker.conf
[root@centos8 fdfs]# vim storage
storage.conf             storage.conf.sample      storage_ids.conf.sample
[root@centos8 fdfs]# vim storage.conf
[root@centos8 fdfs]# ls
client.conf  client.conf.sample  storage.conf  storage.conf.sample  storage_ids.conf.sample  tracker.conf  tracker.conf.sample
[root@centos8 fdfs]# mkdir /home/fastdfs/storage
mkdir: cannot create directory ‘/home/fastdfs/storage’: No such file or directory
[root@centos8 fdfs]# mkdir -p /home/fastdfs/storage
[root@centos8 fdfs]# mkdir -p /home/fastdfs/tracker
[root@centos8 fdfs]# mkdir -p /home/fastdfs/storage0
[root@centos8 fdfs]# /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
[root@centos8 fdfs]# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
[root@centos8 fdfs]# ps -ef | grep fdfs
root     3271331       1  0 17:10 ?        00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
root     3271352       1  0 17:10 ?        00:00:00 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
root     3271354 3270439  0 17:10 pts/1    00:00:00 grep --color=auto fdfs
[root@centos8 fdfs]# netstat -aopn | grep fdfs
tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      3271331/fdfs_tracke  off (0.00/0/0)
[root@centos8 fdfs]# netstat -aopn | grep fdfs
tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      3271331/fdfs_tracke  off (0.00/0/0)
tcp        0      1 172.19.86.115:46772     192.168.209.121:22122   SYN_SENT    3271352/fdfs_storag  on (3.34/2/0)
[root@centos8 fdfs]# mkdir -p /home/fastdfs/client
[root@centos8 fdfs]# ls
client.conf  client.conf.sample  storage.conf  storage.conf.sample  storage_ids.conf.sample  tracker.conf  tracker.conf.sample
[root@centos8 fdfs]# vim client.conf
[root@centos8 fdfs]# fdfs_test /etc/fdfs/client.conf upload  /home/fastdfs/7.jpg
This is FastDFS client test program v6.07

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.

[2021-06-11 17:12:05] DEBUG - base_path=/home/fastdfs/client, connect_timeout=5, network_timeout=60, tracker_server_count=2, 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

[2021-06-11 17:12:10] ERROR - file: connection_pool.c, line: 140, connect to server 192.168.0.196:22122 fail, errno: 110, error info: Connection timed out
[2021-06-11 17:12:15] ERROR - file: connection_pool.c, line: 140, connect to server 192.168.0.197:22122 fail, errno: 110, error info: Connection timed out

I don't know why it failed to connect.Here's my ip and the port:

[root@centos8 fdfs]# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.19.86.115  netmask 255.255.255.0  broadcast 172.19.86.255
        inet6 fe80::6567:626c:27e8:e882  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:b8:8b:98  txqueuelen 1000  (Ethernet)
        RX packets 4467164  bytes 8747616264 (8.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3250362  bytes 292718928 (279.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@centos8 fdfs]# netstat -aopn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     Timer
tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      3271331/fdfs_tracke  off (0.00/0/0)
tcp        0      0 127.0.0.1:4330          0.0.0.0:*               LISTEN      1237552/pmlogger     off (0.00/0/0)
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd            off (0.00/0/0)
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      2104/dnsmasq         off (0.00/0/0)
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1209/sshd            off (0.00/0/0)
tcp        0      0 127.0.0.1:44321         0.0.0.0:*               LISTEN      5366/pmcd            off (0.00/0/0)
tcp        0      0 172.19.86.115:22        192.168.0.46:5345       ESTABLISHED 3270408/sshd: root   keepalive (6317.91/0/0)
tcp        0      0 172.19.86.115:22        192.168.0.46:5343       ESTABLISHED 3267143/sshd: root   keepalive (1533.77/0/0)
tcp        0     72 172.19.86.115:22        192.168.0.46:5344       ESTABLISHED 3270403/sshd: root   on (0.08/0/0)
tcp        0      0 172.19.86.115:22        192.168.0.46:5342       ESTABLISHED 3267137/sshd: root   keepalive (1532.53/0/0)
tcp6       0      0 ::1:4330                :::*                    LISTEN      1237552/pmlogger     off (0.00/0/0)
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd            off (0.00/0/0)
tcp6       0      0 :::22                   :::*                    LISTEN      1209/sshd            off (0.00/0/0)
tcp6       0      0 ::1:44321               :::*                    LISTEN      5366/pmcd            off (0.00/0/0)
udp        0      0 192.168.122.1:53        0.0.0.0:*                           2104/dnsmasq         off (0.00/0/0)
udp        0      0 0.0.0.0:67              0.0.0.0:*                           2104/dnsmasq         off (0.00/0/0)
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd            off (0.00/0/0)
udp        0      0 127.0.0.1:323           0.0.0.0:*                           1176/chronyd         off (0.00/0/0)
udp6       0      0 :::111                  :::*                                1/systemd            off (0.00/0/0)
udp6       0      0 ::1:323                 :::*                                1176/chronyd         off (0.00/0/0)
raw6       0      0 :::58                   :::*                    7           1202/NetworkManager  off (0.00/0/0)

How do I set storage.conf and client.conf? image

Tom-python0121 avatar Jun 11 '21 09:06 Tom-python0121