部分命令

service nginx reload

反向代理,负载均衡

硬件资源信息

1
2
3
4
free -h
df -h
w top
cat /proc/cpuinfo

防火墙

保护服务器,设置防火墙规则,开闭端口

1
2
3
4
yum install firewalld
service firewalld start
service firewalld status
service firewalld stop/disable

服务

1
2
3
4
crontab
Ntpdate
Logrotate
supervisor

网络

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
scp
ssh

ifconfig
netstat


dig
host

root@tj:~/testt# host -t AAAA imwl.cf
imwl.cf has IPv6 address 2606:4700:3035::ac43:a0c6
imwl.cf has IPv6 address 2606:4700:3033::6815:eed
root@tj:~/testt# host imwl.cf

imwl.cf has address 172.67.160.198
imwl.cf has address 104.21.14.237
imwl.cf has IPv6 address 2606:4700:3033::6815:eed
imwl.cf has IPv6 address 2606:4700:3035::ac43:a0c6

curl -d '{"x" : 1}' -H "Content-Type: application/json" -X POST http://localhost:3000/api

securtCRT 提示

key_exchange_failed

1
2
3
4
5
vi /etc/ssh/sshd_config
#加入下面的文本
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
#重启ssh
systemctl restart sshd.service

nfs 使用

1
2
3
4
5
6
7
8
9
10
11
# 主节点  192.168.2.134
mkdir -p /data/nfs/direct_mount
mkdir /mnt/nfs/
echo "/data/nfs *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports
systemctl enable nfs --now
mount -t nfs 192.168.2.134:/data/nfs/direct_mount /mnt/nfs/

# 其他节点
mkdir /mnt/nfs/
systemctl enable nfs --now
mount -t nfs 192.168.2.134:/data/nfs/direct_mount /mnt/nfs/

切割 2G 大小

1
split -b 2G harbor.tar  harbor.tar_LF_

合并

1
cat   harbor.tar_LF_*  > harbor.tar