fastdfs文件服务器部署
操作系统:CentOS 7.6
需开启端口:80(nginx),8888(nginx),22122(tracker),23000(storage)
注:所有前面带“#”号的linux命令输入到linux后不留“#”号
准备工作
1 查看防火墙运行状态
# firewall-cmd --state
正常结果是
running
如果不正常,使用# systemctl start firewalld
命令开启防火墙
2 查看防火墙某一端口开启状态
# firewall-cmd --query-port=80/tcp
3 防火墙开启某一端口
需要开启80(nginx),8888(nginx),22122(tracker),23000(storage)四个端口
# firewall-cmd --permanent --add-port=80/tcp
成功即显示
success
4 防火墙关闭某一端口
# firewall-cmd --permanent --remove-port=8080/tcp
成功即显示
success
5 重启防火墙
使用
(1)# firewall-cmd --reload
(2)# systemctl restart firewalld
使用(1)成功后会显示success
6 安装netstat
# yum install -y net-tools
7 查看正在监听的端口
# netstat -lnpt
结果如下
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 0.0.0.0I22 0.0.0.0:* LISTEN 9382/sshd
tcp 0 0 127.0.0.1I25 0.0.0.0:* LISTEN 10059/master
tcp6 0 0 :::22 :::* LISTEN 9382/sshd
tcp6 0 0 ::1I25 :::* LISTEN 10059/master
8 检查端口被哪个进程占用
# netstat -lnpt | grep 8080
9 查看进程
# ps 9382
10 中止进程
# kill -9 1234
11 安装webget包
# yum -y install wget
12 安装zip、unzip
# yum -y install zip unzip
13 安装perl
# yum -y install perl*
14 同步服务器时间
安装linux系统时间同步服务软件
# yum -y install ntpdate
让当前服务器系统时间同步网络时间
# ntpdate ntp1.aliyun.com
Linux硬件时间同步命令
# hwclock --systohc
或使用下方命令同步时间
# hwclock -w
同步后使用date
或hwclock
查看时间是否同步,不出意外两个命令显示的时间相同。
安装
安装方案:环境中&#