侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 466 篇文章
  • 累计创建 185 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

FastDFS增加path横向扩容

WinJay
2022-03-11 / 0 评论 / 0 点赞 / 117 阅读 / 5798 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

FastDFS增加path横向扩容

关注点:

1.规划好新的挂载点. ##目前环境的规则为/mnt/fdfs01

2.集群内的每个节点的path数(store_path_count)必须一致.

3.每个集群节点的path路径和大小最好一致.

操作步骤:

一、停止FDFS服务

systemctl stop fdfs_storaged.service fdfs_trackerd.service

二、修改fastdfs配置(每个节点都需要修改)

image.png

cd /etc/fdfs/
vim storage.conf
# 修改完配置如下:

disabled=false
group_name=ahFastDFS
bind_addr=
client_bind=true
port=23000
connect_timeout=30
network_timeout=60
heart_beat_interval=30
stat_report_interval=60
base_path=/opt/fdfs_storage
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=2						//修改为2 原为1
store_path0=/opt/fdfs_storage_data		//原有path
store_path1=/mnt/fdfs01					//新增path
subdir_count_per_path=256
tracker_server=192.168.1.179: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
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=8888

image.png

vim mod_fastdfs.conf
# 修改完配置如下:

connect_timeout=2
network_timeout=30
load_fdfs_parameters_from_tracker=true
storage_sync_file_max_delay = 86400
use_storage_id = false
storage_ids_filename = storage_ids.conf
tracker_server=192.168.1.179:22122
storage_server_port=23000
group_name=group1
url_have_group_name = true
store_path_count=2
log_level=info
log_filename=
response_mode=proxy
if_alias_prefix=
flv_support = true
flv_extension = flv
group_count = 1
[group1]
group_name=ahFastDFS
storage_server_port=23000
store_path_count=2							//修改为2 原为1
store_path0=/opt/fdfs_storage_data			//原有path
store_path1=/mnt/fdfs01						//新增path
base_path=/opt/fdfs_storage

image.png

三、启动服务

systemctl stop fdfs_storaged.service fdfs_trackerd.service

四、查看各节点的状态

fdfs_monitor /etc/fdfs/client.conf
fdfs_monitor /etc/fdfs/client.conf | grep ACTIVE

image.png

五、文件写入读取测试

略…–开发补充。

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区