FashDFS开发环境及配置

参考资源(以后经常补写)

问查询某个端口是否已被使用 
#netstat -na |grep tcp
列出所有开放的TCP端口(已经占用的)
netstat -an | grep 8080
查询8080端口是否占用


0\在windows eclipse 下的编译
首先建一个hello 工程,并且能编译通过,然后把FastDfs文件目录copy到 src目录下
a:设置环境变量 CYGWIN_HOME
b:在properties中的c/c++ build的build command设置 ${CYGWIN_HOME}/bin/sh.exe /cygdrive/u/programe/testproject/test/src/FastDFS/make.sh
1\基本配置
参看install
主要是调路径,端口号等
2\如果要支持http Server
配 置
tracker.conf ,把##include http.conf改成 #include http.conf
storage.conf ,把##include http.conf改成 #include http.conf
修改mash.sh 把 #WITH_HTTPD=1 改成 WITH_HTTPD=1(重要)
安装libEvent库
1. # tar xzvf libevent-2.0.4-alpha.tar.gz
2. # cd libevent-2.0.4
3. # ./configure --prefix=/home/super/installLIB
4. # make
5. # make install
3\执行
./make.sh
./make.sh install (如果要卸载,./make.sh clean)


可能会出现
error while loading shared libraries: libevent_core.so.3: cannot open shared object file: No such file or directory

执行
ln -s /home/super/installLIB/lib/libevent_core.so.3 /lib/libevent_core.so.3

4\注意
运行情况请看日志文件
trackerd.log
storaged.log
它们具体内容如下
trackerd.log
[2010-05-03 06:47:26] INFO - FastDFS v1.27, base_path=/fastdfs/FastDFS, network_timeout=60s, port=22122, bind_addr=, max_connections=256, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=1024MB, download_server=0, allow_ip_count=-1, sync_log_buff_interval=10s, check_active_interval=120s, thread_stack_size=64 KB, storage_ip_changed_auto_adjust=1
[2010-05-03 06:47:26] INFO - HTTP supported: server_port=8080, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0, check_active_interval=30, check_active_type=tcp, check_active_uri=/status.html
storaged.log
[2010-05-03 06:47:29] INFO - FastDFS v1.27, base_path=/fastdfs/FastDFS, store_path_count=1, subdir_count_per_path=256, group_name=group1, network_timeout=60s, port=23000, bind_addr=, client_bind=1, max_connections=256, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=200ms, sync_interval=0ms, sync_start_time=00:00, sync_end_time: 23:59, allow_ip_count=-1, file_distribute_path_mode=0, file_distribute_rotate_count=100, fsync_after_written_bytes=0, sync_log_buff_interval=10s, sync_binlog_buff_interval=60s, thread_stack_size=512 KB, upload_priority=10, if_alias_prefix=, check_file_duplicate=0, FDHT group count=0, FDHT server count=0, FDHT key_namespace=, FDHT keep_alive=0, HTTP server port=8888, domain name=
[2010-05-03 06:47:29] INFO - HTTP supported: server_port=8888, http_trunk_size=262144, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0
[2010-05-03 06:47:30] INFO - file: storage_param_getter.c, line: 225, storage_ip_changed_auto_adjust=1
[2010-05-03 06:47:31] INFO - file: tracker_client_thread.c, line: 257, successfully connect to tracker server 192.168.247.128:22122, as a tracker client, my ip is 192.168.247.128

5\上传图片后(参看install文件)
则返回 http://192.168.247.128:8080/group1/M00/00/00/wKj3gEvd84oAAAAAAABdrVV-uEs424_big.jpg
在ie中执行 http://192.168.247.128:8080/group1/M00/00/00/wKj3gEvd84oAAAAAAABdrVV-uEs424_big.jpg 看到此图片正常运行


6、
查看端口号
lsof -i :端口 号
lsof -i :8080
显示结果
# lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
fdfs_trac 4742 root 10u IPv4 14679 TCP *:webcache (LISTEN)


# netstat -anp
显示结果
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2129/hpiod
tcp 0 0 0.0.0.0:835 0.0.0.0:* LISTEN 1925/rpc.statd
tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 4742/fdfs_trackerd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1891/portmap
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 4742/fdfs_trackerd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2146/cupsd
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 5006/fdfs_storaged
tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 5006/fdfs_storaged
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2192/sendmail: acce
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 2134/python
tcp 0 0 192.168.247.128:22122 192.168.247.128:48836 ESTABLISHED 4742/fdfs_trackerd
tcp 0 0 192.168.247.128:48836 192.168.247.128:22122 ESTABLISHED 5006/fdfs_storaged
tcp 0 0 192.168.247.128:57448 192.168.247.128:8888 TIME_WAIT -
tcp 0 0 192.168.247.128:57447 192.168.247.128:8888 TIME_WAIT -
tcp 0 0 :::22 :::* LISTEN 2160/sshd
tcp 0 0 ::ffff:192.168.247.128:22 ::ffff:192.168.247.1:1038 ESTABLISHED 2754/0
tcp 0 0 ::ffff:192.168.247.128:22 ::ffff:192.168.247.1:1051 ESTABLISHED 3358/1
tcp 0 48 ::ffff:192.168.247.128:22 ::ffff:192.168.247.1:1101 ESTABLISHED 4149/2
udp 0 0 0.0.0.0:32768 0.0.0.0:* 2317/avahi-daemon:
udp 0 0 0.0.0.0:829 0.0.0.0:* 1925/rpc.statd
udp 0 0 0.0.0.0:832 0.0.0.0:* 1925/rpc.statd
udp 0 0 0.0.0.0:68 0.0.0.0:* 1748/dhclient
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2317/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 1891/portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 2146/cupsd
udp 0 0 :::32769 :::* 2317/avahi-daemon:
udp 0 0 :::5353 :::* 2317/avahi-daemon:
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 11230 2723/gam_server @/tmp/fam-root-
unix 25 [ ] DGRAM 6411 1847/syslogd /dev/log
unix 2 [ ACC ] STREAM LISTENING 10819 2679/scim-launcher /tmp/scim-socket-frontend-root
unix 2 [ ACC ] STREAM LISTENING 11363 2741/mapping-daemon /tmp/mapping-root


7\
wget -S file_url
wget -S http://192.168.247.128:8888/group1/M00/00/00/wKj3gEvd84oAAAAAAABdrVV-uEs424_big.jpg 可以得到文件,并把文件保存在当前路径下


8\
>> 3.store_path这个参数的作用
同一个GROUP中的store_path目录个数必须大小一样,但目录名称可以不相同。

>> 4.能直接访问吗?我认为不能?
可以配合apache使用。在存储服务器上安装apache,将DocumentRoot配置到${base_path}/data目录。
以前有人问过类似的问题,参阅:[url]http://linux.chinaunix.net/bbs/thread-1062825-1-1.html[/url]


2.其它这个10台电脑.用rsync就可能实现.好像也没有必要使用fast-dfs吧!


问题一
无法断点调试,断点时报错如下,
Can't find a source file at "/cygdrive/d/eclipse-cpp/workspaces/easyhello/easyhello.cpp"
Locate the file or edit the source lookup path to include its location.
解决:
must provide a mapping from /cygdrive/d to d:\ (or whatever your drive letter is).
in the eclipse IDE, go to menu Window -> Preferences -> C/C++ -> Debug-> Common Source Lookup Path -> Add.
增加一个Path Mapping
名字debugmapping 点击 add
Compilation path ---->/cygdrive/d
Local File System Path ---> d:\
Select OK to finish the dialogs.

注意(Windows平台下),特别要在
[i][b]make.sh 中加入如下三行[/b][/i]
[b]cd /cygdrive/j
cd /cygdrive/j/fastdfs/fastv1.21_twoDevelope/fdstdfs/dfsfast/src/FastDFS
pwd[/b]
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值