Git常见的命令
远端创建, Clone本地Step 1Github上面创建一个新的仓库, 页面创建即可, 然后记录下URL。 1https://github.com/LiarLee/vps-init.git Step 2本地创建目录, 并初始化本地的仓库路径。 123mkdir project-initcd ./project-initgit clone https://github.com/LiarLee/project-init.git 关联远端仓库创建一个本地仓库。 123456789mkdir test-initcd ./test-initgit init .touch READMEecho "For test"git add -Agit commit -m "init"git remote add origin https://github.com/LiarLee/test-init.gitgit -u origin master 配置代理12345# 设置代理arch ~> git config --global http.proxy ...
Linux Redhat 9 oom不触发
测试环境Amazon AMI ID: ami-0e54fe8afeb8fa59a Operating System: Red Hat Enterprise Linux 9.2 (Plow) Kernel: Linux 5.14.0-284.11.1.el9_2.x86_64 MySQL Version: Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL) 测试步骤: 使用上面的AMI启动一个新的实例, 在实例启动之后ssh连接进去。 按照MySQL官方的 repo 安装一个社区的版本。 1234567891011121314151617# https://dev.mysql.com/downloads/repo/yum/ # (mysql80-community-release-el9-1.noarch.rpm)wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpmdnf install -y ./mysql80-...
升级以及清理内核的步骤
通常情况下升级内核版本的步骤CentOS 升级步骤 123456789yum makecache -y yum update -y grub2-editenv listgrub2-set-default 'CentOS Linux (3.10.xxxxx.el7.elrepo.x86_64) 7 (Core)' # entry_namesystemctl reboot 清理旧版本的步骤RHEL 或者 Centos 123456789101112131415161718192021222324252627282930rpm -qa kernel* # 这个命令会列出所有当前已经安装的版本的内核, 然后手动使用命令移除对应的软件包即可。 直接使用yum 移除不需要的版本即可. yum remove -y kernel-devel-5.10.216-204.855.amzn2.x86_64 kernel-devel-5.10.218-208.862.amzn2.x86_64 kernel-5.10.216-204.855.amzn2.x86_64 kernel-...
Linux内存管理笔记
内存管理部分的笔记Crash命令的使用使用这个命令需要有debuginfo 以及kernel debug 的数据包, 同时可能需要gdb。 需要在配置文件里面开启这个 仓库: rhel-8-baseos-rhui-debug-rpms 具体的步骤也可以看这个文档, 来自Redhat 官方: https://access.redhat.com/solutions/9907 123yum install -y kernel-debuginfo # 使用这个命令就可以安装, 但是尺寸非常的大。crash /boot/vmlinuz-$(uname -a) 使用命令crash来进行 PM 和 VM 的对应关系: 内核的 debug 文件在: /var/lib/debug/lib/modules/kernel-version/ 使用crash命令: 123456789101112131415161718192021222324252627282930313233343536373839404142434445...
添加一个Redhat到EKS集群, 基于Packer的步骤
Copy From zhojiew 的私有仓库文档, 已经经过授权 ~ 官方提供了基于packer工具的构建脚本 这里手动把相关的步骤执行下,基于redhat9构建一个自定义ami。据称eks优化的ami也是通过以下步骤完成的 手动构建ami拉仓库 123cd /home/ec2-suersudo yum install git -ygit clone https://github.com/awslabs/amazon-eks-ami.git 配置环境变量 1234567891011121314KUBERNETES_VERSION=1.26.4 KUBERNETES_BUILD_DATE=2023-05-11 BINARY_BUCKET_NAME=amazon-eksBINARY_BUCKET_REGION=cn-north-1DOCKER_VERSION=20.10.23-1.amzn2.0.1CONTAINERD_VERSION=1.6.*RUNC_VERSION=1.1.5-1.amzn2CNI_PLUGIN_VERSION=v0.8.6PULL_CNI_FROM_...
BufferIO与DirectIO的比较
测试方法使用BufferIO的方式, 测试文件的写入: 123#!/bin/bashperf record -T -C 0 -- taskset -c 0 dd if=/dev/zero of=./a.dat bs=4k count=16384 使用DirectIO的方式, 测试文件的写入: 123#!/bin/bashperf record -T -C 0 -- taskset -c 0 dd if=/dev/zero of=./a.dat bs=4k count=16384 oflag=direct 运行结果BufferIO: 12345678910111213141516[root@ip-172-31-53-200 perf_records]# ./start_test_bufferio.sh16384+0 records in16384+0 records out67108864 bytes (67 MB, 64 MiB) copied, 0.118848 s, 565 MB/s[ perf record: Woken up 1 times to write dat...
VPCFlowlog 解析
VPC Flow Log 怎么看https://docs.amazonaws.cn/vpc/latest/userguide/flow-logs.html#flow-log-recordshttps://docs.amazonaws.cn/vpc/latest/userguide/flow-logs-records-examples.html#flow-log-example-tcp-flag vpc flow log里的tcp-flags记录的不是某个单个tcp包头里的flag,而是单次观察的时间窗口里这条flow的所有tcp包出现过的tcp flag的合计。 TCP flags can be OR-ed during the aggregation interval. For short connections, the flags might be set on the same line in the flow log record, for example, 19 for SYN-ACK and FIN, and 3 for SYN and FIN. For a...
Linux OS Debug 方法记录
触发 EC2 Linux 的 NMI Unknown 中断发送一个诊断请求给 EC2, 触发 os 本身 NMI Unknown 事件,这个时间会触发 Kdump 记录当时的现场。 1aws ec2 send-diagnostic-interrupt --region cn-north-1 --instance-id i-******************** 记录下来的现场文件保存在 /var/crash/ 1234567[root@mysql 5.14.0-284.11.1.el9_2.x86_64]# ll /var/crash/total 0drwxr-xr-x. 2 root root 67 Jun 6 05:22 127.0.0.1-2023-06-06-05:22:11drwxr-xr-x. 2 root root 67 Jun 6 08:58 127.0.0.1-2023-06-06-08:58:20drwxr-xr-x. 2 root root 67 Jun 9 09:39 127.0.0.1-2023-06-09-09...
快速启动一个 prometheus 和 grafana
快速创建一个可用的 prometheus 和 grafana 进行测试, 并将数据保留在当前的目录中, 在重启之后数据不会丢失: 创建一个目录. 123456mkdir /opt/monitormkdir /opt/monitor/grafanamkdir /opt/monitor/grafana_datamkdir /opt/monitor/prometheusmkdir /opt/monitor/prometheus_datatouch /opt/monitor/docker-compose.yaml 创建docker-compose 文件 1234567891011121314151617181920212223242526272829303132---version: "3"services: prometheus: container_name: prometheus image: reg.liarlee.site/docker.io/prom/prometheus:latest restart: always net...
数据库单表的测试
基于这个问题的测试为什么MySQL单表不要超过2000w行? 测试过程:123456789101112131415161718192021CREATE TABLE test(id int NOT NULL AUTO_INCREMENT PRIMARY KEY comment '主键',person_id int not null comment '用户id',person_name VARCHAR(200) comment '用户名称',gmt_create datetime comment '创建时间',gmt_modified datetime comment '修改时间') comment '人员信息表';插入数据:insert into test values(1,1,'user_1', NOW(), now());insert into test (person_id, person_name, gmt_create, gmt_mo...


