常用运维命令

## 测试存储LACP
ovs-vsctl bond/show
ovs-appctl bond/show
ovs-vsctl show

## iperf测试
服务端
iperf -s
client
iperf -c 192.168.55.2 -t 10 -i 2
iperf -c 192.168.44.2 -t 10 -i 2 -b 15G
iperf -c 192.168.55.2 -b 15360M -t 10

## 查看bond
mdadm --detail /dev/md127
mdadm --detail /dev/md0
mdadm /dev/md/root --remove /dev/md127
mdadm /dev/md127 --remove /dev/sdg1
zbs-deploy-manage mount-disk /dev/sdg smtx_system
mdadm --detail /dev/md127
cat /proc/net/bonding/bond0


## 创建镜像
qemu-img create -f qcow2 /root/zml/centos76v1.qcow2 3G
virt-install --virt-type kvm --name centos76full --ram 4096 --vcpus=2 --os-type=linux --cdrom=/root/image/CentOS-7-x86_64-DVD-1810.iso --disk path=/root/zml/centos76v1.qcow2,format=qcow2,bus=virtio --network bridge=virbr0,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole

## 开启LLDP
systemctl restart lldpad && systemctl restart lldpd && sleep 10
lldpctl

## openstack
vip查询绑定设备方法 "etcdctl get /lport --prefix |grep 192.168.0.250
查看虚拟机vnc密码 nova show uuid
查询虚拟机项目 openstack project show tenant_id
查询虚拟机安全组 openstack security group list|grep security_groups名字
查询安全组详细信息 openstack security group show id
设置项目配额 openstack quota --set xxx -1 projectid

迁移虚拟机 nova live-migration uuid host
下载镜像 glance image-download --file /opt/centos72.qcow2 --progress
查询共享网络
openstack network list --share
查询共享网络的port id和project id
--device-owner compute:sugon ---》nova-compute的可用域是sugon
openstack port list --device-owner compute:sugon --network 网络id
查询共享网络port在etcd中的信息
openstack port list --device-owner compute:sugon --network 网络id
查询共享网络下,使用了共享网络的port
openstack port list --device-owner compute:sugon --network 网络id


创建镜像 glance image-create --visibility public --disk-format raw --container-format bare --min-disk 50 --property hypervisor_type=kvm --property purpose=kvm --property hw_qemu_guest_agent=yes --property os_type=linux --property architecture=x86_64 --property os_version=Kylinv10 --property os_bits=64 --file ./ --name nfs --progress

## 查看硬件序列号等
dmidecode | grep "System Information" -A9 | egrep "Manufacturer|Product|Serial"

## k8s create
kubectl create ns zml
kubectl create role zhoumlrole --verb=get --verb=list --resource=pods --namespace=zml
kubectl create sa zhoumlsa -nzml
kubectl create rolebinding zhoumlrolebd --serviceaccount=zml:zhoumlsa --role=zhoumlrole --namespace=zml
kubectl auth can-i list pods --as=system:serviceaccount:zml:zhoumlsa -n zml

kubectl create clusterrole zhoumlclusterole --verb=get,list --resource=pods
kubectl create sa zhoumlclustersa -nzml
kubectl create clusterrolebinding zhoumlclusterbd --clusterrole=zhoumlclusterole --serviceaccount=zml:zhoumlclustersa

 

## 曙光SDN
ovs-ofctl dump-flows br-int table=115

## 网络走向定位
tracepath 114.114.114.114

## 高负载排查

sar -d

iostat
vmstat
iotop

## 防火墙规则
 防火墙规则添加:针对单独的ip+端口
示例:
添加:
firewall-cmd --permanent --zone=external --add-rich-rule="rule family="ipv4" source address="2.0.0.22" port protocol="tcp" port="3307" accept"
删除:
firewall-cmd --permanent --zone=external --remove-rich-rule="rule family="ipv4" source address="2.0.0.22" port protocol="tcp" port="3307" accept"


## 清理挂了ceph缓存盘
dmsetup remove ceph--32719f23--6727--4f7d--a4da--ef53a1d54605-osd--data--5f1e3758--ef5d--4cc3--89e4--f8a3029e11dc -f


## mariadb
mysql -uroot -pdatabase_sugon -e "SHOW STATUS LIKE 'wsrep%';"|grep wsrep_cluster_size
mysql -uroot -pdatabase_sugon -e "SHOW STATUS LIKE 'wsrep%';"|grep wsrep_connected|grep ON


## gfs
systemctl stop glusterd && sleep 5 && systemctl start glusterd && sleep 5 && gluster volume status micro
mount -a

## xstor版本
/home/parastor/bin/oSan -v
/home/parastor/bin/oMgcd -v

 

logo
posted @ 2023-06-09 10:04  欠时间个自圆其说  阅读(46)  评论(0)    收藏  举报