文章目錄
- 環境
- 開始前先創建個快照
- 步驟
- 1、環境準備
- 2、準備libfastcommon、fastdfs、nginx-1.15.4、fastdfs-nginx-module的包
- 3、安裝libfastcommon
- 4、安裝fastdfs(tracker+storage)
- (1)、安裝fastdfs
- (2)、配置并啟動Tracker服務
- (3)、配置并啟動Storage服務
- (4)、可以查看下啟動情況
- 5、配置客戶端
- 6、測驗FastDFS
- (1)、建個檔案,用于傳輸,
- (2)、測驗上傳
- (3)、測驗下載
- (4)、測驗洗掉
- 7、安裝nginx-1.15.4及nginx的插件fastdfs-nginx-module
- (1)、安裝nginx
- (2)、配置nginx
- (3)、配置fastdfs-nginx-module
- (4)、啟動nginx
- 8、測驗用http訪問上傳到Storage的檔案
- 參考
- 列下老師給的步驟
環境
阿里云服務器、CentOS 7.9.2009,下文要安裝的nginx是1.15.4版本的,
開始前先創建個快照
創建一個云盤快照 - 云服務器 ECS - 阿里云
|
步驟
1、環境準備
1、安裝依賴的環境
# 一次性下載多個依賴包
# FastDFS是C語言開發,安裝FastDFS需要先從官網下載原始碼,然后進行編譯,但編譯依賴gcc環境,所以里面有gcc gcc-c++,
# 其他依賴包也一樣,FastDFS依賴它們,所以要下載它們,
[root@wu1 init.d]# yum install wget git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y
2、打開安全組的22122和23000和80埠,在阿里云網站上,


3、打開防火墻的22122和23000和80埠,
可以用命令打開,
# FastDFS-Tracker
firewall-cmd --zone=public --add-port=22122/tcp --permanent
# FastDFS-Storage
firewall-cmd --zone=public --add-port=23000/tcp --permanent
# Nginx默認監聽80埠
firewall-cmd --zone=public --add-port=80/tcp --permanent
# 重新加載后才能生效
firewall-cmd --reload
我直接用寶塔面板打開的,


4、提前建立tracker和storage的存盤資料和日志檔案的目錄
[root@wu1 ~]# mkdir -p /home/fastdfs/tracker # 后面把它設為:tracker的存盤資料和日志檔案的目錄
[root@wu1 ~]# mkdir -p /home/fastdfs/storage # 后面把它設為:storage的存盤資料和日志檔案的目錄
2、準備libfastcommon、fastdfs、nginx-1.15.4、fastdfs-nginx-module的包
可以命令下載:
[root@wu1 ~]# cd /usr/local/src
[root@wu1 src]# git clone https://github.com/happyfish100/libfastcommon.git --depth 1 # libfastcommon,它是FastDFS官方提供的,包含了FastDFS運行所需要的一些基礎庫,
[root@wu1 src]# git clone https://github.com/happyfish100/fastdfs.git --depth 1 # fastdfs
[root@wu1 src]# git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 # nginx+fastdfs的插件
[root@wu1 src]# wget http://nginx.org/download/nginx-1.15.4.tar.gz # nginx
[root@wu1 src]# tar -zxvf nginx-1.15.4.tar.gz
[root@wu1 src]# rm -rf /usr/local/src/nginx-1.15.4.tar.gz
也可以直接把老師給的附件的幾個包傳輸過去,我是直接傳輸的,
最后,/usr/local/src目錄下,有這四個檔案,

3、安裝libfastcommon
[root@wu1 src]# cd /usr/local/src/libfastcommon/
[root@wu1 libfastcommon]# chmod 744 /usr/local/src/libfastcommon/make.sh # 讓用戶有執行/usr/local/src/libfastcommon/make.sh檔案的權限
[root@wu1 libfastcommon]# ./make.sh
[root@wu1 libfastcommon]# ./make.sh install #下方復制了下這個命令的輸出,這些輸出顯示出該命令做了哪些操作
mkdir -p /usr/lib64
mkdir -p /usr/lib
mkdir -p /usr/include/fastcommon
install -m 755 libfastcommon.so /usr/lib64
install -m 644 common_define.h hash.h chain.h logger.h base64.h shared_func.h pthread_func.h ini_file_reader.h _os_define.h sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h fast_timer.h process_ctrl.h fast_mblock.h connection_pool.h fast_mpool.h fast_allocator.h fast_buffer.h skiplist.h multi_skiplist.h flat_skiplist.h skiplist_common.h system_info.h fast_blocked_queue.h php7_ext_wrapper.h id_generator.h char_converter.h char_convert_loader.h common_blocked_queue.h multi_socket_client.h skiplist_set.h uniq_skiplist.h fc_list.h json_parser.h buffered_file_writer.h server_id_func.h /usr/include/fastcommon
if [ ! -e /usr/lib/libfastcommon.so ]; then ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so; fi
4、安裝fastdfs(tracker+storage)
(1)、安裝fastdfs
[root@wu1 libfastcommon]# cd /usr/local/src/fastdfs
[root@wu1 fastdfs]# chmod 744 /usr/local/src/fastdfs/make.sh
[root@wu1 fastdfs]# ./make.sh
[root@wu1 fastdfs]# ./make.sh install # 下方復制了下這個命令的輸出,這些輸出顯示出該命令做了哪些操作
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
if [ ! -f /etc/fdfs/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf /etc/fdfs/storage_ids.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
mkdir -p /usr/lib
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 fdfs_regenerate_filename /usr/bin
if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi
if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;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 ../tracker/fdfs_server_id_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
linux中/etc是組態檔的目錄,這里把fastdfs的組態檔復制過去,后面修改的是/etc/fdfs下的組態檔,
[root@wu1 fastdfs]# cp /usr/local/src/fastdfs/conf/* /etc/fdfs
(2)、配置并啟動Tracker服務
[root@wu1 fastdfs]# vim /etc/fdfs/tracker.conf # 下方是修改后的base_path的配置
# 存盤資料和日志檔案的基本路徑
base_path = /home/fastdfs/tracker
# 啟動tracker
[root@wu1 fastdfs]# /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
(3)、配置并啟動Storage服務
[root@wu1 fastdfs]# vim /etc/fdfs/storage.conf # 下方是修改后的幾個配置
# 存盤資料和日志檔案的基本路徑
base_path = /home/fastdfs/storage
# 存盤路徑,基于0,配置存盤路徑以存盤檔案
store_path0 = /home/fastdfs/storage
# tracker_server的地址,因為我們把tracker和storage安裝在同一臺服務器上,所以這里的ip填當前服務器的公網ip
tracker_server = 填寫你的tracker服務器的ip地址:22122
# 啟動storage
[root@wu1 fastdfs]# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
(4)、可以查看下啟動情況
[root@wu1 fastdfs]# ps -ef | grep fdfs
root 24550 1 0 16:34 ? 00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf # tracker已經啟動
root 25609 1 0 16:51 ? 00:00:00 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf # storage已經啟動
root 28436 20871 0 17:33 pts/0 00:00:00 grep --color=auto fdfs # 當前的grep命令
或者
[root@wu1 src]# netstat -ntlp | grep fdfs
tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 25609/fdfs_storaged
tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 24550/fdfs_trackerd
5、配置客戶端
[root@wu1 fastdfs]# cp /usr/local/src/fastdfs/client/libfdfsclient.so /usr/lib
cp: overwrite ‘/usr/lib/libfdfsclient.so’? y
[root@wu1 fastdfs]# vim /etc/fdfs/client.conf # 下方是修改后的幾個配置
base_path = /home/fastdfs/tracker
tracker_server = 填寫你的tracker服務器的ip地址:22122
6、測驗FastDFS
(1)、建個檔案,用于傳輸,
[root@wu1 fastdfs]# vim /root/hi.html # 下方是檔案內容
hi,fastdfs!
(2)、測驗上傳
# 復制了下輸出,輸出中展示了它把檔案傳到了哪里,
[root@wu1 fastdfs]# /usr/bin/fdfs_test /etc/fdfs/client.conf upload /root/hi.html
This is FastDFS client test program v6.06
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.fastken.com/
for more detail.
[2021-04-16 17:48:32] DEBUG - base_path=/home/fastdfs/tracker, connect_timeout=5, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
tracker_query_storage_store_list_without_group:
server 1. group_name=, ip_addr=120.77.151.233, port=23000
group_name=group1, ip_addr=120.77.151.233, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23.html
source ip address: 120.77.151.233
file timestamp=2021-04-16 17:48:32
file size=12
file crc32=494541238
example file url: http://120.77.151.233/group1/M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23.html
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23_big.html
source ip address: 120.77.151.233
file timestamp=2021-04-16 17:48:32
file size=12
file crc32=494541238
example file url: http://120.77.151.233/group1/M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23_big.html
# 上方回應的路徑,告訴你它把檔案放到哪里去了,你可以去那個目錄下找,
[root@wu1 fastdfs]# cd /home/fastdfs/storage/data/00/00/
# 可以看到檔案被傳上去了,但此時,只有我們服務器內部可以訪問,外部訪問不了,
# 因為FastDFS無法處理http請求,于是,我們需要安裝能處理http請求的Nginx,Nginx還有負載均衡的能力,
[root@wu1 00]# ll
total 16
-rw-r--r-- 1 root root 12 Apr 16 17:48 eE2X6WB5XXCAV7AqAAAADB16GbY23_big.html
-rw-r--r-- 1 root root 49 Apr 16 17:48 eE2X6WB5XXCAV7AqAAAADB16GbY23_big.html-m
-rw-r--r-- 1 root root 12 Apr 16 17:48 eE2X6WB5XXCAV7AqAAAADB16GbY23.html
-rw-r--r-- 1 root root 49 Apr 16 17:48 eE2X6WB5XXCAV7AqAAAADB16GbY23.html-m
(3)、測驗下載
[root@wu1 fastdfs]# cd /usr/local/src
# 復制了下輸出,可以看到下載成功,通過命令ll可以看到下載到了當前目錄下,
[root@wu1 src]# /usr/bin/fdfs_test /etc/fdfs/client.conf download group1 M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23.html
This is FastDFS client test program v6.06
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.fastken.com/
for more detail.
[2021-04-17 17:53:06] DEBUG - base_path=/home/fastdfs/tracker, connect_timeout=5, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
storage=120.77.151.233:23000
download file success, file size=12, file save to eE2X6WB5XXCAV7AqAAAADB16GbY23.html
(4)、測驗洗掉
(別真洗掉,這里只是先列下洗掉要用的命令,可以后面安裝完nginx和nginx的插件,測驗完可以用http訪問上傳到Storage的檔案,再回來測驗洗掉,)
[root@wu1 src]# /usr/bin/fdfs_test /etc/fdfs/client.conf delete group1 M00/00/00/eE2X6WB5XXCAV7AqAAAADB16GbY23.html
7、安裝nginx-1.15.4及nginx的插件fastdfs-nginx-module
為什么要安裝nginx?
1、讓FastDFS具備http訪問的能力,
2、使FastDFS有負載均衡的能力,

(1)、安裝nginx
[root@wu1 src]# cd /usr/local/src/nginx-1.15.4
# /usr/local/src/nginx-1.15.4/configure是可執行檔案,
# --add-module指定擴展模塊的路徑,
# 默認把nginx安裝到/usr/local目錄下,即安裝完成后多出一個/usr/local/nginx的檔案夾,
[root@wu1 nginx-1.15.4]# ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ # 列一下部分輸出
,,,,,,
configuring additional modules
adding module in /usr/local/src/fastdfs-nginx-module/src/
+ ngx_http_fastdfs_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
[root@wu1 nginx-1.15.4]# make
[root@wu1 nginx-1.15.4]# make install
(2)、配置nginx
[root@wu1 nginx-1.15.4]# cd /usr/local/nginx/conf
[root@wu1 conf]# cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak # .bak是備份檔案,備份下nginx.conf檔案
[root@wu1 conf]# vim /usr/local/nginx/conf/nginx.conf # 在該檔案中插入下方內容,插入位置如下圖所示
# 攔截請求路徑中包含/group[1-9]/M0[0-9]的請求,用fastdfs的Nginx模塊進行轉發
location ~ /group[1-9]/M0[0-9]{
ngx_fastdfs_module;
}

(3)、配置fastdfs-nginx-module
[root@wu1 conf]# cp /usr/local/src/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
[root@wu1 conf]# vim /etc/fdfs/mod_fastdfs.conf # 修改下方配置
# 存盤日志檔案的基本路徑,這里可改可不改
base_path=/tmp
# tracker_server的ip地址
tracker_server=你安裝tracker的服務器的ip:22122
# 請求中是不是包含組名
# 當uri類似于/M00/00/00/xxx時設定為false
# 當uri類似于${group_name}/M00/00/00/xxx時,如group1/M00/xxx,則設定為true
url_have_group_name = true
# 檔案存放路徑
# store_path#, based 0, 如果 store_path0 不存在, 其值是 base_path
# 必須和storage.conf(/etc/fdfs/storage.conf)里配置的store_path0相同
store_path0=/home/fastdfs/storage
(4)、啟動nginx
[root@wu1 conf]# /usr/local/nginx/sbin/nginx # /usr/local/nginx/sbin/nginx該檔案是可執行檔案
ngx_http_fastdfs_set pid=28285 #回傳pid表示啟動成功
[root@wu1 conf]# ps -ef | grep nginx # 要nginx的master和worker都啟動,如下,才是啟動了nginx
root 28286 1 0 19:04 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 28287 28286 0 19:04 ? 00:00:00 nginx: worker process
root 28334 9106 0 19:05 pts/1 00:00:00 grep --color=auto nginx
8、測驗用http訪問上傳到Storage的檔案

參考
CentOS7使用firewall-cmd打開關閉防火墻與埠_s_p_j的專欄-CSDN博客_firewall-cmd
手把手帶你安裝FastDFS及與SpringBoot整合_嗶哩嗶哩 (゜-゜)つロ 干杯~-bilibili
列下老師給的步驟
1. 關閉虛擬機
2. 設定 > CD/DVD 取消 Connect CD/DVD Drive,選擇AutoDetect
3. 選單 > 檔案 > 匯出 > OVA格式 等待匯出結束
4. 選單 > 檔案 > 匯入 > 選擇檔案路徑 > 修改配置(cpu, 記憶體,硬碟)
5. 啟動新匯入的虛擬機 查看IP,ip addr
修改IP(靜態IP)vi \ifcfg-ens32
service network restart
ping www.baidu.com
6. 啟動原來的虛擬機,測驗虛擬機之間的連通性(ping),SecureCRT遠程連上,
7. 掛起新機器,快照走起
8. 演示 三臺 10.10.10.102/103/104
102 storage tracker nginx
103 tracker client
104 storage nginx
9. 初始化 view -> command window 右鍵 send command to all sessions
#shutdown selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
cat /etc/selinux/config
#install iptables # firewalld
service iptables status
service firewalld status
service firewalld stop
systemctl disable firewalld
yum install -y iptables-services #安裝
systemctl enable iptables #開機自啟動
systemctl start iptables #啟動
systemctl status iptables #查看狀態
#reboot
reboot
10. 安裝 storage和tracker的區別在于組態檔上
#下載依賴包
yum install wget git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y
#下載fastDFS
cd /usr/local/src
git clone https://github.com/happyfish100/libfastcommon.git --depth 1
git clone https://github.com/happyfish100/fastdfs.git --depth 1
如果git下載很慢,打包上傳到linux,然后解壓到指定目錄
rz
tar zxvf fastdfs.tar.gz
mv fastdfs fastdfs-nginx-module libfastcommon /usr/local/src/
#安裝libfatscommon
cd /usr/local/src/libfastcommon
./make.sh && ./make.sh install
保證不出ERROR錯誤
#安裝FastDFS
cd /usr/local/src/fastdfs
./make.sh && ./make.sh install
保證不出ERROR錯誤
11 配置 tracker
mkdir -p /home/fastdfs/tracker
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
sed -i 's?base_path = /home/yuqing/fastdfs?base_path = /home/fastdfs/tracker?g' /etc/fdfs/tracker.conf
/etc/init.d/fdfs_trackerd start | stop
chkconfig fdfs_trackerd on #開機自啟動
netstat -ntlp | grep fdfs
cat /etc/sysconfig/iptables
sed -i "10 a -A INPUT -p tcp -m state --state NEW -m tcp --dport 22122 -j ACCEPT" /etc/sysconfig/iptables
cat /etc/sysconfig/iptables
service iptables restart
ls /home/fastdfs/tracker
12 配置 storage
mkdir -p /home/fastdfs/storage
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
sed -i 's?base_path = /home/yuqing/fastdfs?base_path = /home/fastdfs/storage?g' /etc/fdfs/storage.conf
sed -i 's?store_path0 = /home/yuqing/fastdfs?store_path0 = /home/fastdfs/storage?g' /etc/fdfs/storage.conf
vi /etc/fdfs/storage.conf
#tracker_server
tracker_server = 10.10.10.102:22122
tracker_server = 10.10.10.103:22122
/etc/init.d/fdfs_storaged start
chkconfig fdfs_storaged on
chkconfig fdfs_storaged --list
netstat -ntlp | grep fdfs
sed -i "10 a -A INPUT -p tcp -m state --state NEW -m tcp --dport 23000 -j ACCEPT" /etc/sysconfig/iptables
service iptables restart
cat /etc/sysconfig/iptables
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
13 測驗上傳 #在tracker上測驗
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
sed -i 's?base_path = /home/yuqing/fastdfs?base_path = /home/fastdfs/tracker?g' /etc/fdfs/client.conf
vi /etc/fdfs/client.conf
tracker_server = 10.10.10.102:22122
tracker_server = 10.10.10.103:22122
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /usr/local/src/fastdfs/COPYING-3_0.txt
cd /home/fastdfs/storage/data/00/00/***
/usr/bin/fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/CgoKZl6evi6AIFQ0AACI-7zX1qU910.txt
14 配置nginx #需要部署在storage機器上
cp /usr/local/src/fastdfs/conf/http.conf /etc/fdfs/
cp /usr/local/src/fastdfs/conf/mime.types /etc/fdfs/
cd /usr/local/src
git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1
wget http://nginx.org/download/nginx-1.15.4.tar.gz
tar -zxvf nginx-1.15.4.tar.gz
cd nginx-1.15.4/
./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/
make && make install
mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak
cp /root/fastdfs/nginx.conf /usr/local/nginx/conf/nginx.conf
cp /usr/local/src/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
sed -i 's?store_path0=/home/yuqing/fastdfs?store_path0=/home/fastdfs/storage?g' /etc/fdfs/mod_fastdfs.conf
sed -i 's/url_have_group_name = false/url_have_group_name = true/g' /etc/fdfs/mod_fastdfs.conf
vi /etc/fdfs/mod_fastdfs.conf
tracker_server = 10.10.10.102:22122
tracker_server = 10.10.10.103:22122
cp /root/fastdfs/nginx.service /lib/systemd/system/
systemctl enable nginx.service
service nginx start
ps -ef | grep nginx
sed -i "10 a -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables
sed -i "10 a -A INPUT -p tcp -m state --state NEW -m tcp --dport 8888 -j ACCEPT" /etc/sysconfig/iptables
service iptables restart
http://ip:port/group*/M**/...
一些命令還沒學,所以比較難懂,可以看下方的網址理解下:
sed linux命令 在線中文手冊
如何讓一個服務或腳本開機自啟動?-李導的博客-51CTO博客
chkconfig的原理 和添加開機自啟動的辦法 - 陳雷雷 - 博客園
還比如:
sed -i "10 a -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables # 通過修改/etc/sysconfig/iptables檔案來開啟防火墻80埠
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/277821.html
標籤:其他
上一篇:大資料Hadoop3.1.3 HDFS 詳細入門筆記
下一篇:常用Git命令
