gqinvs 发表于 2019-2-1 06:50:31

FastDFS 分布式文件系统之一trackerd 服务部署

  1, 安装相关库文件
      git clone https://github.com/happyfish100/libfastcommon.git
      cd libfastcommon/
      sh make.sh
      sh make.sh install  2, 安装fastDFS trackerd
      git clone https://github.com/happyfish100/fastdfs.git
      cd fastdfs
      sh make.sh
      sh make.sh install  3, 安装完成信息
      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
      mkdir -p /usr/bin
      mkdir -p /etc/fdfs
      cp -f fdfs_storaged/usr/bin
      if [ ! -f /etc/fdfs/storage.conf.sample ]; then cp -f ../conf/storage.conf /etc/fdfs/storage.conf.sample; fi
      mkdir -p /usr/bin
      mkdir -p /etc/fdfs
      mkdir -p /usr/lib64
      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 /usr/bin
      if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; fi
      if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; 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 ../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  4,traced 配置
      1, 查看 tracker 服务配置文件
            # cat tracker.conf |grep -v '^#'|grep -v '^$'
            disabled=false
            bind_addr=192.168.6.49
            port=22122
            connect_timeout=30
            network_timeout=120
            base_path=/var/log/fastdfs
            max_connections=256
            accept_threads=1
            work_threads=4
            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 = 300
            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
            trunk_compress_binlog_min_interval = 0
            use_storage_id = false
            storage_ids_filename = storage_ids.conf
            id_type_in_filename = ip
            store_slave_file_use_link = false
            rotate_error_log = false
            error_log_rotate_time=00:00
            rotate_error_log_size = 0
            log_file_keep_days = 0
            use_connection_pool = false
            connection_pool_max_idle_time = 3600
            http.server_port=8080
            http.check_alive_interval=30
            http.check_alive_type=tcp
            http.check_alive_uri=/status.html      2, 创建日志目录
            mkdir /var/log/fastdfs  5, 启动服务
         cp -fr restart.sh stop.sh/usr/bin/fdfs_* /usr/local/bin/
         systemctl daemon-reload
         service fdfs_trackerd restart  6, 验证服务
      # netstat -tnpl
      Active Internet connections (only servers)
      Proto Recv-Q Send-Q Local Address         Foreign Address         State       PID/Program name   
      tcp      0      0 192.168.6.49:22122      0.0.0.0:*               LISTEN      15064/fdfs_trackerd
      tcp      0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      627/rpcbind         
      tcp      0      0 192.168.122.1:53      0.0.0.0:*               LISTEN      3113/dnsmasq      
      tcp      0      0 0.0.0.0:22            0.0.0.0:*               LISTEN      1365/sshd         
      tcp      0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2630/master         
      tcp6       0      0 :::111                  :::*                  LISTEN      627/rpcbind         
      tcp6       0      0 :::22                   :::*                  LISTEN      1365/sshd         
      tcp6       0      0 ::1:25                  :::*                  LISTEN      2630/master         
      #  




页: [1]
查看完整版本: FastDFS 分布式文件系统之一trackerd 服务部署