2021-02-16
2522 단어 linux
docker run -d --name storage --restart=always --net host -v /root/fastdfs/storage:/var/fdfs -e TRACKER_SERVER="IP :22122" delron/fastdfs storage
docker exec -it storage bash
echo "test" > test.txt
fdfs_upload_file /etc/fdfs/client.conf test.txt
ip:8888/group1/M00/00/00/**********************
프로젝트 환경은 단일 노드로 같은 그룹 아래에서 프로젝트 디렉터리로 나누어 서로 다른 프로젝트 내용을 저장한다.
새 스토리지 디렉토리
mkdir -p/data/fastdfs/storage/blog
저장 파일 편집
vim/etc/fdfs/storage를 편집합니다.conf
store_path_count=2
store_path0=/data/fastdfs/storage/blog
store_path1=/data/fastdfs/storage/img
mod 편집fastdfs.conf
[root@VM-0-9-centos ~]# vim /etc/fdfs/mod_fastdfs.conf
store_path_count=2
store_path0=/data/fastdfs/storage/blog
store_path1=/data/fastdfs/storage/img
group_count = 0
[group1]
group_name=group1
storage_server_port=23000
store_path_count=2
store_path0=/data/fastdfs/storage/blog
store_path1=/data/fastdfs/storage/img
nginx 설정
server {
listen 80;
server_name img.lvxiaoyi.top;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://IP :8888;
}
}
server {
listen 8888;
server_name ;
#location ~/group[0-9]/ {
# ngx_fastdfs_module;
#}
#
location /group1/M00 {
alias /data/fastdfs/storage/blog/data;
# ngx_fastdfs_module;
}
location /group1/M01 {
alias /data/fastdfs/storage/img/data;
# ngx_fastdfs_module;
}
테스트
파일을 첫 번째 항목으로 전송
fdfs_upload_file /etc/fdfs/client.conf test.txt IP :23000 0
group1/M00/00/00/rBEACWAqiOeAD54SAAAAIE3xxaY240.txt
파일을 두 번째 파일로 전송
fdfs_upload_file /etc/fdfs/client.conf test.txt IP :23000 1
방문
http:// /group1/M00/00/00/rBEACWAqiOeAD54SAAAAIE3xxaY240.txt
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
용감한 바로 가기 및 우분투 응용 프로그램안녕하세요 여러분, 이 기사에서는 모든 사이트에서 pwa를 생성하고 실행기 응용 프로그램으로 추가하는 방법을 설명하고 싶습니다. 일부 웹사이트는 PWA로 설치를 허용하지 않지만 유사한 애플리케이션을 원합니다. 1. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.