工作笔记
查看端口占用
netstat -lnp|grep port 或者 lsof -i :port
杀死进程
kill -9 pid
常用资源占用情况
free
free 命令
total used free shared buff/cache available
Mem: 16265804 12963028 2327736 16392 975040 2975784
Swap: 4095996 4079824 16172
查看各个进程占用情况
top
top命令 按M键,可按内存占用倒序
top - 22:11:28 up 318 days, 11:55, 2 users, load average: 0.17, 0.28, 0.44
Tasks: 181 total, 1 running, 180 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.5 us, 0.4 sy, 0.0 ni, 98.7 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 16265804 total, 1748564 free, 13442716 used, 1074524 buff/cache
KiB Swap: 4095996 total, 18264 free, 4077732 used. 2496076 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17933 root 20 0 6041316 1.7g 436 S 0.0 10.8 62:46.54 java
8516 root 20 0 8356080 1.2g 0 S 2.0 8.0 1156:20 java
10184 root 20 0 6925008 871892 2652 S 0.0 5.4 2:52.74 java
14794 hbase 20 0 4058564 859440 2228 S 0.3 5.3 3:25.70 java
13362 root 20 0 7074716 690944 0 S 0.0 4.2 240:12.53 java
31876 root 20 0 6148284 642748 14332 S 0.7 4.0 2:47.68 java
31811 root 20 0 6120892 565988 14280 S 0.3 3.5 2:22.40 java
31083 root 20 0 6089844 548588 13840 S 0.7 3.4 2:14.36 java
11524 root 20 0 6536588 507656 0 S 1.3 3.1 91:44.92 java
3374 root 20 0 6078324 463624 14260 S 0.3 2.9 1:18.90 java
9372 hdfs 20 0 2949660 441516 2208 S 0.0 2.7 294:47.19 java
4151 yarn 20 0 2988672 388868 204 S 0.3 2.4 362:20.00 java
14224 zookeep+ 20 0 5049964 381084 4536 S 0.0 2.3 2:12.18 java
2318 mysql 20 0 4786420 361852 0 S 0.0 2.2 427:01.56 mysqld
查看进程位置
ps -aux |grep -v grep|grep pid
查看命令执行历史记录
history|grep uaa //查看执行的历史命令中包含uaa的
进入Docker修改nginx配置
docker exec -it 容器名称 /bin/bash
docker exec -it /bin/bash
docker exec -it b98c /bin/bash
nginx -t //查看配置文件是否正确
nginx -s reload //加载nginx配置文件
126数据库备份
mysqldump -u flh-integration-wh -p jiujiang_uaa_new > 20200420.sql
进入114服务器docker方式安装的mysql
docker exec -it mysql-5.7 bash(在文件中./root/shell/mysql-bash.sh)
网友评论