当前位置:Gxlcms > mysql > fastdfs

fastdfs

时间:2021-07-01 10:21:17 帮助过:127人阅读

调度节点:192.168.73.129 存储节点:192.168.73.128 调度节点 yum -y install zlib-devel wget wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz wget https://fastdfs.googlecode.com/files/FastDFS_v4.01.tar.gz

调度节点:192.168.73.129
存储节点:192.168.73.128



调度节点
yum -y install zlib-devel wget
wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
wget https://fastdfs.googlecode.com/files/FastDFS_v4.01.tar.gz




tar xvzf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure
make
make install
echo '/usr/local/lib/' >> /etc/ld.so.conf


cd ..
tar xvzf FastDFS_v4.01.tar.gz
cd FastDFS
sed -i 's!TARGET_PREFIX=/usr/local!TARGET_PREFIX=/usr/local/fastdfs!' make.sh
sed -i 's!TARGET_CONF_PATH=/etc/fdfs!TARGET_CONF_PATH=/usr/local/fastdfs/etc/fdfs!' make.sh
./make.sh
./make.sh install



cat /usr/local/fastdfs/etc/tracker.conf
disabled=false
bind_addr=
port=22122
connect_timeout=30
network_timeout=60
base_path=/data/fastdfs
max_connections=1024
work_threads=8
store_lookup=2
store_group=group2
store_server=0
store_path=0
download_server=0
reserved_storage_space = 10%
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
sync_log_buff_interval = 10
check_active_interval = 120
thread_stack_size = 64KB
storage_ip_changed_auto_adjust = true
storage_sync_file_max_delay = 86400
storage_sync_file_max_time = 10
use_trunk_file = false
slot_min_size = 256
slot_max_size = 16MB
trunk_file_size = 64MB
trunk_create_file_advance = false
trunk_create_file_time_base = 02:00
trunk_create_file_interval = 86400
trunk_create_file_space_threshold = 20G
trunk_init_check_occupying = false
trunk_init_reload_from_binlog = false
use_storage_id = false
storage_ids_filename = storage_ids.conf
store_slave_file_use_link = false
http.disabled=false
http.server_port=8080
http.check_alive_interval=30
http.check_alive_type=tcp
http.check_alive_uri=/status.html
http.need_find_content_type=true


mkdir -p /data/fastdfs

/usr/local/fastdfs/bin/fdfs_trackerd /usr/local/fastdfs/etc/fdfs/tracker.conf





存储节点
yum -y install zlib-devel wget
wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar xvzf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure
make
make install
echo '/usr/local/lib/' >> /etc/ld.so.conf


cd ..
wget https://fastdfs.googlecode.com/files/FastDFS_v4.01.tar.gz
wget http://nginx.org/download/nginx-1.0.15.tar.gz
wget https://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.12.tar.gz
yum -y install pcre-devel

cd ..
tar xvzf FastDFS_v4.01.tar.gz
cd FastDFS
./make.sh
./make.sh install

vi /etc/fdfs/storage.conf
disabled=false
group_name=group1
bind_addr=192.168.188.73.128
client_bind=true
port=23000
connect_timeout=30
network_timeout=60
heart_beat_interval=30
stat_report_interval=60
base_path=/data/fastdfs
max_connections=1024
buff_size = 256KB
work_threads=8
disk_rw_separated = true
disk_reader_threads = 2
disk_writer_threads = 2
sync_wait_msec=50
sync_interval=0
sync_start_time=00:00
sync_end_time=23:59
write_mark_file_freq=500
store_path_count=1
store_path0=/data/fastdfs
subdir_count_per_path=256
tracker_server=192.168.73.129:22122
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
file_distribute_path_mode=0
file_distribute_rotate_count=100
fsync_after_written_bytes=0
sync_log_buff_interval=10
sync_binlog_buff_interval=10
sync_stat_file_interval=300
thread_stack_size=512KB
upload_priority=10
if_alias_prefix=
check_file_duplicate=0
file_signature_method=hash
key_namespace=FastDFS
keep_alive=0
use_access_log = false
rotate_access_log = false
access_log_rotate_time=00:00
http.disabled=ture
http.domain_name=
http.server_port=80
http.trunk_size=256KB
http.need_find_content_type=true



/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf










cd ..
tar xvzf fastdfs-nginx-module_v1.12.tar.gz
tar xvzf nginx-1.0.15.tar.gz
cd nginx-1.0.15
./configure --prefix=/usr/local/nginx --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --add-module=../fastdfs-nginx-module/src/
make
make install

cp ../fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/mod_fastdfs.conf


cat /etc/fdfs/mod_fastdfs.conf
connect_timeout=2
network_timeout=30
base_path=/tmp
load_fdfs_parameters_from_tracker=false
storage_sync_file_max_delay = 86400
tracker_server=192.168.73.129:22122
storage_server_port=23000
group_name=group1
url_have_group_name = false
store_path_count=1
store_path0=/data/fastdfs
log_level=debug
log_filename=
response_mode=redirect
if_alias_prefix=
http.need_find_content_type=false




vi /usr/local/nginx/conf/nginx.conf
添加
location /M00 {
root /data/fastdfs/data;
ngx_fastdfs_module;
}

ln -sv /data/fastdfs/data /data/fastdfs/data/m00


/usr/local/nginx/sbin/nginx




client节点
vim /etc/fdfs/client.conf
connect_timeout=30
network_timeout=60
base_path=/data/fastdfs
tracker_server=192.168.73.129:22122
log_level=info
http.tracker_server_port=8080

/usr/local/fastdfs/bin/fdfs_test /usr/local/fastdfs/etc/fdfs/client.conf upload /root/a.html
这样返回得到的url是调度节点的,但是真正的文件是存在存储节点,

添加存储节点,和之前的存储节点一样安装设置,

监控
/usr/local/fastdfs/bin/fdfs_monitor /etc/fdfs/storage.conf

如果有节点位WAIT_SYNC,尝试把之前的存储节点重启下



url /usr/local/fastdfs/bin/fdfs_monitor /etc/fdfs/storage.conf

人气教程排行