linux 组件报错笔记
  wAzzyqwRgjCe 2023年12月10日 19 0


一、GlusterFS

1、Mount failed. Please check the log file for more details

基本上有两种情况,卷不存在 或者卷卡死了

有一次不知道干啥了,宿主机挂载的gfs卷突然掉了,但进程还能查到,依稀记得是句柄的问题,先用如下方法恢复了

解决方法

登陆宿主机
mount  | grep 卷名     

ps -ef | grep 卷名

kill 进程 



//重启卷
gluster volume start force  卷名

//查看卷端口是否启动
gluster volume status detail

2、touch : cannot touch "11": Read-only file system

我在docker容器中挂载了gfs创建的卷,但是我尝试向里面写入数据时发生了如上报错

上面一遍分为两种情况
1、gfs服务器故障(少见)
2、挂载的客户端网络区域不同,到gfs的火墙不通,需要开火墙 (常见)



#火墙端口查询 (一般是直接开通一个范围的端口比如30000-60000之类的)
gluster volume status 卷名  detail

//看Brick 和TCP port的部分
//拿到ip和端口 用宿主机telnet测试,不通的话提火墙

3、Transpot endpoint is not connected

挂载成功,但意外丢失了。 我这边是容器由于kubelet重启丢失挂载,新版本修复

解决方法

//登录宿主机
umount 目录
重启容器

4、卸载文件系统失败

案例

//umount  目录失败
umount: /tmp/test1: trget is busy
        (in some cses use ful info bout processes that
         use the device is found by lsof(8) or fuser(1).)

解决方法

1、 lsof 文件系统目录   kill掉进程
2、 fuser -ck  挂载目录

//上面俩都是杀设备进程的

5、failed to cache rpm database

执行rpm --rebuilddb后再安装

6、failed to fetch volumes file

找不到卷,服务地址可能不正确或者未创建卷

7、 unknown filesystem type 'glusterfs'

可能没装gfs客户端,用mount.glusterfs试试有命令没

 8、stale file handle

陈旧的文件句柄,案例
1、在shell中打开fss目录,创建目录a并cd到此目录下
2、在另一个shell中删除目录a后在创建目录a
3、 在第一个shell中touch 1文件

路径正确,但索引不对

9、实际容量和显示容量不符

很多时候磁盘看着还剩下不少,但报错显示已经满了无法写入
df -h 显示磁盘满了,但du -sh 实际容量小于上线

解决方法

lsof | grep delete

kill delete进程

10、failed commit failed on localhost .  please check log file for details

glusterfs 创建大量卷后无法创建

解决方法

vi /etc/systemd/system.conf

DefaultTaskMax 默认值为515,改成5120   #实际建卷 5120 / 19  269个卷  同时能建这么多

11、挂载推荐

存储常用的hostpaht(宿主机申请大容量存储)  
emptydir(小容量临时存储) 
gfs、nfs  //通过pv、pvc、sc用


//另外如果不挂外部存储,临时存储最好设置为10G

12、执行shell脚本找不到

#容器启动脚本报错
/bin/sh^M bad interpreter no such file or directory



#日志报错
standard_init_linux.go:211 exec user process caused no such file or directory


#原因,在windows上保存了sh脚本,容器在启动时无法识别

dos2unix your_script.sh   后恢复,还是要改镜像上的脚本

二、prometheus

1、out of  order sample  数据无法有序的排列

特殊环境下,集群跳转了时间,无法排序,清理数据重启后恢复

解决方法

systemctl stop prometheus
rm -rf /安装目录/prometheus/data/*
systemctl start prometheus

2、一些常见的ds

eventmonitor   #负责上送数据库、监控报警,注册信息和解除注册信息的
housekeeping  #负责自动将容器信息注册到etcd 和解除注册,etcd对接HA做显示
keda  #用于替换autoscaale 负责容器弹性伸缩,数据源依旧是prometheus
loggie  #手机容器console 日志(docker logs)  上送到日志中心(es grafana)
kube-state-metrics  #日志采集

monit-controller-manager  逐步替代eventmonitor 容器数据采集,容器异常重启报警
lxcfs 功能,在容器中正确展示占用的资源信息,没有这个的话,容器查询的是宿主机的配置,安装后显示容器自身的使用情况

三、python

1、cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library

python链接oracle数据库问题

参考文档

#模块使用参考文档



#问题解决

四、ansible

1、怎么跑ansible

//后台跑剧本,写入过程日志
nohub ss.sh > ansible.log &

//查看安装进度
tail  -f  ansible.log

//检查安装结果
cat ansible.log | grep "changed.*unreachable.*failed"
【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年12月10日 0

暂无评论

推荐阅读
wAzzyqwRgjCe