1 mkdir -p /home/fdfs/storage/dev1 /home/fdfs/storage/conf /home/fdfs/storage/metadata
2
vi storage.conf
disabled=false
group_name=group1
bind_addr=
client_bind=true
port=23000
connect_timeout=30
network_timeout=30
heart_beat_interval=30
stat_report_interval=60
base_path=/data/fast_data
max_connections=256
buff_size = 256KB
accept_threads=1
work_threads=4
disk_rw_separated = true
disk_reader_threads = 1
disk_writer_threads = 1
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=/home/fdfs/storage/dev1
subdir_count_per_path=256
tracker_server=10.88.1.93:22122
tracker_server=10.88.1.94:22122
log_level=debug
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 = true
rotate_access_log = false
access_log_rotate_time=00:00
rotate_error_log = false
error_log_rotate_time=00:00
rotate_access_log_size = 0
rotate_error_log_size = 0
log_file_keep_days = 0
file_sync_skip_invalid_record=false
use_connection_pool = false
connection_pool_max_idle_time = 3600
http.domain_name=
http.server_port=9101
3
firewall-cmd --zone=public --add-port=23000/tcp --permanent
firewall-cmd --zone=public --add-port=9101/tcp --permanent
firewall-cmd --reload
4
vi nginx.conf
worker_processes 1;
error_log /data/fast_data/logs/nginx-error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /data/fast_data/logs/nginx-access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 9101;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location ~ /group1/M00 {
root /home/fdfs/storage/dev1/data;
ngx_fastdfs_module;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
5 vi mod_fastdfs.conf
connect_timeout=30
network_timeout=30
base_path=/data/fast_data
load_fdfs_parameters_from_tracker=true
storage_sync_file_max_delay = 86400
use_storage_id = false
storage_ids_filename = storage_ids.conf
tracker_server=10.88.1.93:22122
tracker_server=10.88.1.94:22122
storage_server_port=23000
group_name=group1
url_have_group_name = true
store_path_count=1
store_path0=/home/fdfs/storage/dev1
log_level=info
log_filename=
response_mode=proxy
if_alias_prefix=
flv_support = true
flv_extension = flv
group_count = 0
include http.conf
6vi storage.sh
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=36000/tcp --permanent
firewall-cmd --zone=public --add-port=23000/tcp --permanent
firewall-cmd --zone=public --add-port=9101/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
docker run -d --name storage3 --net=host --restart always \
-v /home/fdfs:/home/fdfs \
-v /home/fdfs/storage/metadata:/data/fast_data \
-v /etc/localtime:/etc/localtime \
-v /home/fdfs/storage/dev1:/fdfs/dev1/ \
-v /home/fdfs/storage/conf/storage.sh:/storage.sh \
-v /home/fdfs/storage/conf/storage.conf:/etc/fdfs/storage.conf \
-v /home/fdfs/storage/conf/nginx.conf:/etc/nginx/conf/nginx.conf \
-v /home/fdfs/storage/conf/mod_fastdfs.conf:/etc/fdfs/mod_fastdfs.conf \
-v /home/fdfs/storage/conf/client.conf:/data/fastdfs/conf/client.conf \
--privileged=true \
morunchang/fastdfs sh storage.sh
docker exec -it storage fdfs_monitor /data/fastdfs/conf/client.conf
docker exec -it storage3 fdfs_monitor /data/fast_data/conf/client.conf
docker exec -it storage3 fdfs_monitor /etc/fdfs/client.conf
docker run -d --name tracker1 --net=host --restart always \
-v /etc/localtime:/etc/localtime \
-v /fdfs/tracker/data:/data/fast_data/ \
-v /fdfs/tracker/conf/tracker.conf:/etc/fdfs/tracker.conf \
507f49bcf727 sh tracker.sh