Sunday Blog

人生是一场刻意练习

Raid Disk Health Check

Raid Disk Health Check

磁盘阵列卡检测与监控硬盘健康状况 常用软件 MegeRAID Hard Disk Sentinel 一般地,支持RAID 5的卡,我们称其为阵列卡,都可以使用LSI官方提供的MegaCli工具来

Dingtalk Shell 脚本

Dingtalk Shell

#!/bin/bash export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH" # 钉钉关键词: 20, ERROR, INFO, WARN title="Dingtalk Test" content="Hello" atMobiles=("156xxx") atUserIds=() isAtAll="False" dingtalk_text(){ webhook_url='https://oapi.dingtalk.com/robot/send?access_token=097cxxxxxxxxxxxxxxxxxxxc924' current_time=$(date +"%Y-%m-%d %H:%M:%S") if [[ $content != "" ]];then title_date="【$(hostname) $title】 $current_time" message="{ \"msgtype\": \"text\",

CentOS 7.4 安装 Cobbler 实现自动化安装 Ubuntu 18.04

Cobbler + Kickstart

https://cobbler.github.io 环境准备 OS: CentOS 7.6 IP: 192.168.1.22 关闭防火墙 sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config setenforce 0 systemctl stop firewalld.service systemctl disable firewalld.service 阿里云源 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 安装Cobbler 安装cobbler yum install cobbler cobbler-web dhcp debmirror pykickstart fence-agents -y 开机启动

Java Redis Exception Connection Reset by Peer

Java Redis Exception Connection Reset by Peer

报错信息 2023-05-18 14:18:01.916 ERROR 109202 --- [pool-6-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task. org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:74) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceSetCommands.convertLettuceAccessException(LettuceSetCommands.java:520) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceSetCommands.sMembers(LettuceSetCommands.java:245) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.connection.DefaultedRedisConnection.sMembers(DefaultedRedisConnection.java:607) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.DefaultSetOperations.lambda$members$6(DefaultSetOperations.java:158) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) ~[spring-data-redis-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.data.redis.core.DefaultSetOperations.members(DefaultSetOperations.java:158)

Golang 基础知识笔记

Golang Basic Knowledge Notes

一、GO变量 1.1 变量的介绍 变量概念 变量相当于内存中的一个数据存储空间,可以将变量看做是一个房间的门牌号,通过门牌号我们可以找到房间,同样的道理

ESXi 6.6 固态硬盘阵列不识别为SSD类型解决

Esxi 6 Ssd Arry Identification

ESXi开启SSH,登陆ESXI主机 # 列出储存清单 esxcli storage nmp device list # WEB界面 - 存储 - 设备 查看 naa.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 设置为SSD类型 esxcli storage nmp satp rule add -s VMW_SATP_LOCAL --device naa.644a84200b26dc0023dda3c80dcac2xx --option="enable_ssd" 重启ESX

Dell R620 R630 R720 R730 通过IPMI手动控制服务器风扇转速

Dell Server Ipmi Fan Offset

测试IPMI的连接性: ipmitool -I lanplus -H 192.168.1.149 -U root -P root raw 将风扇设置为手动调节转速 ipmitool -I lanplus -H 192.168.1.149 -U root -P root-passwd raw 0x30 0x30 0x01 0x00 手动设置风扇转速(最后一字节指示风扇转速的百分

Ubuntu 20.04 Netplan Dns

Ubuntu 20.04 Netplan Dns

如果在netplan设置dns了,但是实际验证中发现无效。 例如通过nslookup去解析域名,显示的是 dns服务器是127.0.0.53 但是

Ubuntu UFW防火墙启用NAT共享上网

Ufw firewall enable nat shared Internet access

内核打开转发 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf sysctl -p ufw打开转发 cat /etc/default/ufw | grep FORWARD DEFAULT_FORWARD_POLICY="ACCEPT" ufw规则配置 cat /etc/ufw/before.rules # # rules.before # # Rules that should be run before the ufw command line added rules. Custom # rules should be added to one of these chains: # ufw-before-input # ufw-before-output # ufw-before-forward

sed引用变量及追加文件内容到文件首部

Sed Head File

只能将昨天的日志文件内容追加到今天的日志文件的首部,从第 1 行后开始,而不是完全从第 1 行开始。 # 表示将 yesterday.log 文件中的内容添加到 today 文件中,且从第一行

Namespace Terminating

Namespace Terminating

问题 删除 namespace 失败,一直处于 terminating 状态。 [root@ha ~]# kubectl get ns NAME STATUS AGE default Active 4d kube-system Active 4d local Active 3d6h monitoring Terminating 19m 排查 检查该 namespace 中是否还存在未被清理的资源 namespace=monitoring kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found

Kubernetes监控kube-prometheus使用

Kube Prometheus

kube-prometheus github 部署 git clone https://github.com/prometheus-operator/kube-prometheus.git cd kube-prometheus git checkout v0.11.0 # 切换kubernetes兼容版本 首先创建需要的命名空间和 CRDs,等待它们可用后再创建其余资源 kubectl apply --server-side -f manifests/setup kubectl wait \ --for condition=Established

Kubernetes EFK日志收集

Kubernetes Es Logging

上传镜像(可选) export tag=7.17.3 images=( docker.elastic.co/elasticsearch/elasticsearch:${tag} docker.elastic.co/kibana/kibana:${tag} docker.elastic.co/beats/filebeat:${tag} ) # 上传至harhar export https_proxy="192.168.10.250:7890" # 代理 for image in ${images[@]}; do skopeo copy docker://${image} docker://registry.sundayhk.com/elastic/${image#*/}; done 部署Elasticsearch helm及添加storageC

RocketMQ deleteSubscriptionGroup 不删除 consumer offset 解决

Rocketmq Delete Consumer Group

https://github.com/apache/rocketmq/issues/3660 使用下面命令,删除订阅组成功但在rocketmq-dashboard 还能看到订阅组信息,只不过会显示1970-01-01 08:00:00,

SSH 一次执行多个命令

Ssh Multiple Commands

分号 ssh User@Host 'source /etc/profile; date' 写EOF ssh User@Host /bin/bash << EOF date ls -la uptime EOF 使用脚本 echo 'date' > 1.sh ssh User@Host bash -s < 1.sh