随笔分类 -  linux

摘要:# 查看死锁 jstack -F -l 21430 # 查看进程中占用资源多的线程 top -Hp 21430 # jstat监控GC情况,其中:- `<vmid>` 是Java虚拟机的ID,通常是进程ID。 - `[interval]` 是可选的,表示采样间隔时间,单位为毫秒。- `[count] 阅读全文
posted @ 2025-03-20 20:28 钱塘江畔 阅读(7) 评论(0) 推荐(0)
摘要:1. 制作tomcat镜像 下载tomcat包,Index of /dist/tomcat/tomcat-9/v9.0.8/bin (apache.org) # 编写Dockerfile FROM java:8 COPY apache-tomcat-9.0.8.tar.gz /usr/local/ 阅读全文
posted @ 2025-03-20 20:24 钱塘江畔 阅读(16) 评论(0) 推荐(0)
摘要:1. 离线安装docker ## 下载docker.tar.gz,解压安装 tar -zxvf docker.tar.gz ## 配置为系统服务 ## 默认配置文件/etc/docker/daemon.json不可编辑时,指定配置文件启动 dockerd --config-file /data/ap 阅读全文
posted @ 2025-03-20 20:15 钱塘江畔 阅读(16) 评论(0) 推荐(0)
摘要:useradd -d /home/test1 -m test1 passwd test1 test1@123 yum install libcgroup-tools libcgroup-pam libcgroup vim /etc/cgconfig.conf group test1{ cpu{ cp 阅读全文
posted @ 2025-03-20 19:35 钱塘江畔 阅读(5) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/victorwu/p/7061168.html 阅读全文
posted @ 2025-03-20 19:12 钱塘江畔 阅读(11) 评论(0) 推荐(0)
摘要:tcpdump 是一个运行在命令行下的抓包工具。它允许用户拦截和显示发送或收到过网络连接到该计算机的TCP/IP和其他数据包。tcpdump 适用于大多数的类Unix系统操作系统(如linux,BSD等)。类Unix系统的 tcpdump 需要使用libpcap这个捕捉数据的库就像 windows下 阅读全文
posted @ 2025-03-19 22:23 钱塘江畔 阅读(104) 评论(0) 推荐(0)
摘要:1.背景 正式环境多个用户登录频繁报网络错误 2.排查及解决 ## 查看error.log 发现原因是 Too many open files ## ulimit -a命令可以查看单个进程最大打开文件的数量限制;默认1024 ## 统计指定进程打开的文件数,发现都在1024以内 lsof -p pi 阅读全文
posted @ 2024-03-22 15:18 钱塘江畔 阅读(589) 评论(0) 推荐(0)
摘要:locale cat /etc/locale.conf export LANG=zh_CN.utf8 阅读全文
posted @ 2024-03-08 11:39 钱塘江畔 阅读(28) 评论(0) 推荐(0)
摘要:1.背景 为了增强新系统的稳定性,需增加监控和预警。 Zabbix vs Prometheus 2.Prometheus试用 # Prometheus collects metrics from targets by scraping metrics HTTP endpoints. Since Pr 阅读全文
posted @ 2023-11-14 11:06 钱塘江畔 阅读(22) 评论(0) 推荐(0)
摘要:【CPU】关于x86、x86_64/x64、amd64和arm64/aarch64 阅读全文
posted @ 2023-11-13 18:18 钱塘江畔 阅读(54) 评论(0) 推荐(0)
摘要:## 1.背景 应用部署需要nginx高可用,两台服务器 ## 2.步骤 #### 2.1 两台服务器分别部署nginx ``` cd /usr/local/ mkdir nginx tar -zxvf nginx-1.24.0.tar.gz cd nginx-1.24.0 sudo ./confi 阅读全文
posted @ 2023-06-27 19:08 钱塘江畔 阅读(103) 评论(0) 推荐(0)
摘要:# 1. 离线安装docker ``` ## 下载docker.tar.gz,解压安装 tar -zxvf docker.tar.gz ## 配置为系统服务 ## 默认配置文件/etc/docker/daemon.json不可编辑时,指定配置文件启动 dockerd --config-file /d 阅读全文
posted @ 2023-06-16 16:01 钱塘江畔 阅读(288) 评论(0) 推荐(0)
摘要:``` #!/bin/bash cd /data/openapi tmp2=`ps -ef |grep old |awk '{print $2}'|xargs kill -9` sleep 10; apimps=`ps gaux | grep old |grep -v grep |awk '{pri 阅读全文
posted @ 2023-06-15 09:52 钱塘江畔 阅读(36) 评论(0) 推荐(0)
摘要:aarch64 x86_64 阅读全文
posted @ 2023-06-09 10:44 钱塘江畔 阅读(16) 评论(0) 推荐(0)
摘要:[LINUX系统的HOME、VAR目录迁移到新分区](https://www.freesion.com/article/7441437550/) [Linux添加硬盘并进行分区、格式化、挂载及卸载](https://blog.csdn.net/J080624/article/details/9463 阅读全文
posted @ 2023-05-27 16:32 钱塘江畔 阅读(18) 评论(0) 推荐(0)
摘要:## 创建虚拟RAID步骤 ``` yum install mdadm # 创建虚拟RAID阵列 mdadm -C /dev/md1 -l 1 -n 2 /dev/sda /dev/sdb mdadm -D /dev/md1 # 挂载 mkfs.xfs /dev/md1 mkdir /data mo 阅读全文
posted @ 2023-05-27 16:05 钱塘江畔 阅读(46) 评论(0) 推荐(0)
摘要:``` telnet ip port ssh -v -p port ip curl ip:port wget ip:port ``` [linux检测端口命令](http://www.taodudu.cc/news/show-3636952.html?action=onClick) [linux测试 阅读全文
posted @ 2023-05-19 14:46 钱塘江畔 阅读(83) 评论(0) 推荐(0)
摘要:1.背景 Xshell自带的配色方案不习惯,找了一些配色方案 https://github.com/netsarang/Xshell-ColorScheme 选了Obsidian.xcs先用着 2.引用 xshell配色方案分享 阅读全文
posted @ 2023-05-16 23:09 钱塘江畔 阅读(301) 评论(0) 推荐(0)
摘要:1.背景 有一台ThinkPad,安装了CentOS,打算用作个人服务器。但是合上盖子后就离线了,另一台笔记本连接不上。 2.操作 vi /etc/systemd/logind.conf HandlePowerKey 按下电源键后的行为,默认power off HandleSleepKey 按下挂起 阅读全文
posted @ 2023-05-16 22:33 钱塘江畔 阅读(172) 评论(0) 推荐(0)
摘要:限制账号登录 设置非root登录用户 groupadd bonc_zj useradd -d /data01/bonc_zj -m -s /bin/bash -g bonc_zj bonc_zj cp /etc/skel/.* /data01/bonc_zj passwd bonc_zj B0nc_ 阅读全文
posted @ 2023-05-11 21:32 钱塘江畔 阅读(20) 评论(0) 推荐(0)