"github.com/go-ping/ping"func Ping(addr string, t time.Duration) bool { // ping.New() pinger, err := ping.NewPinger(addr) if err != nil { return false } // 设置ping的次数 pinger.Count = 2 pinge
for i := 0; i < 38; i++ { fmt.Printf("interface 10GE1/0/%v\n", i+1) fmt.Printf("ipv6 enable\n ") a := strconv.Itoa(i*4 + 1*2 - 1) distInt64, _ := strconv.ParseInt(a, 10, 64) fmt.Pr
cat /etc/pcdn/pcdn.conf | grep macs | head -n 1 | awk -F" " '{print $2}'cat /etc/pcdn/pcdn.conf | grep bw | head -n 1 | awk -F" " '{print $2}'系统盘root_type=`lsblk -ar 2>>/dev/null | grep -w "
IOCountersStat, _ := gopsutil.IOCounters(true) loc, _ := time.LoadLocation("Asia/Shanghai") now := time.Now() NewNow := now.In(loc).Format("2006-01-02 15:04:00") NewDt, _ := time.Parse
1 修改 rootfs.img1.安装工具[root@localhost ~]# yum install -y squashfs-tools2.用unsuqashfs命令直接解压缩squashfs.img[root@localhost ~]# unsquashfs squashfs.img3.挂载文件系统[root@localhost ~]# cd squashfs-root/LiveOS/[ro
kind: PersistentVolumeClaimapiVersion: v1metadata: name: nginx-web-claimspec: storageClassName: nfs-client accessModes: - ReadWriteMany resources: requests: storage: 1000Mi---apiVersion
yum install -y nfs-utils rpcbind存储节点:vim /etc/exports/data1 192.168.100.0/24(rw,async,no_root_squash,no_all_squash)mkdir -p /data1systemctl start rpcbindsystemctl enable rpcbindexportfs -arv所有节点show
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.1/deploy/static/provider/cloud/deploy.yamlkubectl label nodes k8s-node1 hasIngress=truegrep -rn image deploy.yamlcrictl
监控 metrics-serverwget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlsed -i "s#k8s.gcr.io/metrics-server#registry.cn-hangzhou.aliyuncs.com/chenby#g" compon
Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "k8s.gcr.io/pause:3.6": failed to pull image "k8s.gcr.io/pause:3.6": failed to pull and unpack image "k8s.gcr
Container runtime network not ready" networkReady="NetworkRe报错解决:先部署了calico,后加入node节点,没有同步 calico认证#报错解决cd /etc/cni/net.d/scp * root@k8s-node1:/etc/cni/net.d/
master节点kubeadm token createkubeadm token listopenssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'node节点&nb
curl -L https://github.com/projectcalico/calico/releases/download/v3.23.0/calicoctl-linux-amd64 -o calicoctlchmod +x ./calicoctlmv calicoctl /usr/local/bin/wget https://docs.projectcalico.org/manifest
git clone https://github.com/yuyicai/update-kube-cert.gitcd update-kube-certchmod 755 update-kubeadm-cert.sh./update-kubeadm-cert.sh all
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yamlkubectl edit svc -n kubernetes-dashboard kubernetes-dashboard type: ClusterIP --> type:
准备工作:CentOS Linux release 8.5.2111uname -aLinux k8s-master 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxhostnamectl set-hostname k8s-masterhostnamectl
yum install -y epel-release bash-completionsource /usr/share/bash-completion/bash_completionsource <(kubectl completion bash)echo "source <(kubectl completion bash)" >> ~/.bashrc
服务端wget https://code.aliyun.com/MvsCode/frps-onekey/raw/master/install-frps.sh -O ./install-frps.shchmod 700 ./install-frps.sh./install-frps.sh install客户端wget https://github.com/fatedier/frp/releases/
openssl passwd -1 -salt 'root' '123456'## 生成密码用的密码 就是 rootpw --iscrypted 后面的ks.cfgtextskipxfirstboot --enablekeyboard --vckeymap=us --xlayouts='us'lang en_US.UTF-8selinux --disabledfirewall --disabl
package mainimport ( "encoding/csv" "fmt" "log" "math/big" "os" "sort" "strconv")func main() { filename := "1.csv" ReadCsv(filename)}func ReadCsv(filepath string) { openc
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.0/aio/deploy/recommended.yaml kubectl get svc,pods -n kubernetes-dashboardkubectl -n kubernetes-dashboard describe secr
package mainimport ( "encoding/hex" "fmt" "github.com/gogf/gf/v2/crypto/gaes")func main() { key := []byte("B4OcDhdFwIyDdjFz") // 16位 res, _ := gaes.Encrypt([]byte("hequan"), key) res2 := hex.Enc
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/curl -LO https://storage.googleap
package mainimport ( "database/sql" "fmt" _ "github.com/wenj91/taos-driver" "time")func main() { var taosUri = "root:taosdata@http(192.168.X.X:6041)/teledb" taos, err := sql.Open("ta
FRRoutingFRRVER="frr-stable"# add RPM repository on CentOS 6curl -O https://rpm.frrouting.org/repo/$FRRVER-repo-1-0.el6.noarch.rpmsudo yum install ./$FRRVER*# add RPM repository on CentOS 7curl -O htt
$ go get github.com/mitchellh/gox...$ gox -h...## 只打包linuxgox -osarch="linux/amd64"
package yilongsyncimport ( "context" "time")var Ctx = context.TODO()type CityPostStruct struct { Version string Local string Request struct { CountryType string CityIdType string Page
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号