潭州课堂25班:Ph201805201 django 项目 第三十八课 后台 文章发布,FastDFS安装 配置(课堂笔记)
,
# 从docker hub中拉取fastdfs镜像
docker pull youkou1/fastdfs
# 查看镜像是否拉取成功
docker images
# 安装tracker
docker run -dti --network=host --name tracker -v /var/fdfs/tracker:/var/fdfs youkou1/fastdfs tracker
# 安装storage
docker run -dti --network=host --name storage -e TRACKER_SERVER=10.0.1.15:22122 -v /var/fdfs/storage:/var/fdfs youkou1/fastdfs storage
这里看看自己的 ip 是多少,后边端口不要改TRACKER_SERVER=10.0.1.15:22122
# 查看容器是否启动成功,如果为Up状态则启动成功
docker container ls -a
# 创建utils/fastdfs/client.conf配置文件,在同目录下创建 logs 文件
复制 logs 文件路径
# connect timeout in seconds
# default value is 30s
connect_timeout=30
# network timeout in seconds
# default value is 30s
network_timeout=60
# the base path to store log files
base_path=utils/fastdfs/logs
# tracker_server can ocur more than once, and tracker_server format is
# "host:port", host can be hostname or ip address
tracker_server=10.0.1.15:22122
#standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info
# if use connection pool
# default value is false
use_connection_pool = false
# connections whose the idle time exceeds this time will be closed
# unit: second
# default value is 3600
connection_pool_max_idle_time = 3600
# if load FastDFS parameters from tracker server
# default value is false
load_fdfs_parameters_from_tracker=false
# if use storage ID instead of IP address
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# default value is false
use_storage_id = false
# specify storage ids filename, can use relative or absolute path
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
storage_ids_filename = storage_ids.conf
#HTTP settings
http.tracker_server_port=80
安装相关包
# 安装相关包
# fdfs_client.zip文件从百度云中下载
pip install fdfs_client.zip
pip install mutagen
pip install requests
进入虚拟环境
把这个文件 rz 到根目录下
安装这个包
安装好后测试是否正常:
如果导入不出错,说明三个包安装成功
出现这个字样,说明连接成功
其中这是远程 id,可以通过浏览器进行访问
访问地址拼接: http://域名:8888 / 远程 id