Linux
罗罗的1024
做个幸福的小吃货
展开
-
页缓存(PageCache)和预读机制(readahead )
假设用户线程请求读取磁盘上文件 A 的 offset 为 0-3KB 范围内的数据,由于磁盘的基本读写单位为 page(4KB),于是操作系统至少会读 0-4KB 的内容,这恰好可以在一个 page 中装下,但是操作系统出于局部性原理,会选择将相邻磁盘块 offset [4KB,8KB)、[8KB,12KB) 以及 [12KB,16KB) 都加载到PageCache,于是额外在PageCache中申请了 3 个 page用于缓存。原创 2024-04-15 21:59:31 · 454 阅读 · 0 评论 -
cron表达式使用手册
Cron表达式中的通配符是用于指定时间范围的特殊字符,使得表达式的编写更加灵活和方便。我们在使用定时调度任务的时候,最常用的就是cron表达式。通过cron表达式来指定任务在某个时间点或者周期性执行。周(1-7),星期一到星期天。时,要留意是否支持这个语法。秒(0-59)(可选)原创 2024-04-14 01:02:13 · 426 阅读 · 0 评论 -
Linux--swap分区
早期的Linux由于内存不足,于是想把内存中暂不使用的程序或者数据存放到磁盘中,而磁盘中的这个区域就叫做内存交换分区(swap),此时系统就腾挪出了更多的内存为各个进程服务,而当系统需要访问swap上存储的内容时,再将swap上的数据加载到内存中,这就是我们常说的swap out和swap in,通常伴随着大量的IO。我早期就遇到过一个现场问题,应用进程被自动 kill 掉了,现在想来很有可能是没有配置swap分区,在内存不够时导致触发OOM killer。原创 2024-04-13 17:31:12 · 244 阅读 · 0 评论 -
Linux目录--proc详解
proc简介Linux 内核提供了一种进程信息虚拟文件系统(Process information virtual file system) ,简称 proc,通过 proc 这个虚拟的文件系统,可以在运行时访问内核(core)内部数据结构、改变内核的某些参数设置。如进程,是动态改变的,所以用户或应用程序读取proc文件时,proc文件系统是动态从系统内核读出所需信息并提交的。proc 放置的数据都是在内存当中,例如系统内核、进程、外部设备的状态及网络状态等。因为这个目录下的数据都是在内存当中,所以本身不原创 2022-06-29 13:22:32 · 824 阅读 · 0 评论 -
ubuntu18.04 安装redis
话不多说,直接安装1、安装Redis服务器端,会自动地一起安装Redis命令行客户端apt-get install redis-server2、检查Redis服务器系统进程ps -ef|grep redis3、修改配置文件vim /etc/redis/redis.confsupervised systemd #因为我的操作系统是ubuntubind 127.0.0.1 ::1requirepass foobared4、启动与关闭service redis startsyst原创 2021-04-11 21:06:06 · 249 阅读 · 0 评论 -
failed to obtain node locks, tried [[/usr/local/elasticsearch-7.1.1/data/my-application]] with lock
failed to obtain node locks, tried [[/usr/local/elasticsearch-7.1.1/data/my-application]] with lock解决方案elasticsearch进程被占用,杀掉重启即可原创 2021-03-12 00:34:55 · 1687 阅读 · 1 评论 -
ERROR: [1] bootstrap checks failed
查看错误日志[1] bootstrap checks failed[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured[2021-03-11T11:57:48,648][INFO ][o.e原创 2021-03-11 12:32:26 · 1579 阅读 · 0 评论 -
Existing lock /var/run/yum.pid: another copy is running as pid 22873. Another app is currently hold.
Existing lock /var/run/yum.pid: another copy is running as pid 22873.Another app is currently holding the yum lock; waiting for it to exit…解决方案杀掉此进程kill -9 22873原创 2021-03-11 10:23:17 · 350 阅读 · 0 评论 -
No space left on device或者Insufficient space
什么是inode和block?inode就是索引节点(index node)的意思,在每一个存储设备被格式化创建文件系统后,所有的文件大致被分为了两部分,分别是inode和block。inode用来存储文件属性信息,其中包括了文件大小,文件的归属者,文件的归属组,权限,类型,修改时间,以及指向文件实体数据(block)的指针。block中存储的就是文件的实际数据,比如说,照片,视频,音频等等。注意:inode当中不包含文件名!一个文件的文件名,存储在上级目录的block中!开始分析No sp原创 2021-03-01 14:34:15 · 1732 阅读 · 0 评论 -
Statement violates GTID consistency: Updates to non-transactional tables
Statement violates GTID consistency: Updates to non-transactional tables,can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.解决在my.cnf 中将gtid_mode = O.原创 2021-01-28 10:23:29 · 2595 阅读 · 0 评论 -
-bash: wget: command not found
在部署项目环境时,发现报如下错误[root@izbp1gb52c9au4ljt3u7w8z test]# wget http://nginx.org/download/nginx-1.13.7.tar.gz -bash: wget: command not found[root@izbp1gb52c9au4ljt3u7w8z test]#看到了这个错误,我就去安装 wget[root@izbp1gb52c9au4ljt3u7w8z test]# yum -y install wgetLoad原创 2021-01-21 12:13:47 · 331 阅读 · 0 评论 -
chmod: changing permissions of ‘/root/.ssh/authorized_keys’: Operation not permitted
一般,Linux下root用户的权限是最大 (Linux下UID数值越小的用户,权限越大,可以看到最小值为0,即root用户)但是在使用chmod改变文件权限的时候,即使在root用户下,也会遇到operation not permitted的问题。其实chmod的底层实现是chattr命令,用此命的功能更为强大,甚至可以锁定文件,即使root用户也操作不了此文件。然后执行下面的命令查看当前文件属性,可以发现有 i 和 a 两个属性:lsattr authorized_keys说明此时的文件是原创 2021-01-21 11:27:42 · 2213 阅读 · 0 评论 -
linux忘记密码怎么办?看我
1、重新启动,出现下面界面,按下ESC 或者 e2、在核心命令行最后加入 rd.break3、再按下Ctrl+x ,重新以这个设定开机,以单用户模式启动,输入相关命令修改用户密码3.1 、重新挂载/sysroot成可读可写,并切换到/sysroot switch_root:/# mount –o remount,rw /sysroot switch_root:/# chroot /sysroot3.2、 设定密码sh-4.2# passwd 用户名(要修改用户名就带上新的用户名,不修改不原创 2021-01-05 16:52:29 · 486 阅读 · 0 评论 -
‘FirewallD‘ object has no attribute ‘path‘ 、‘fw‘、is not registered
问题描述:[root@localhost apache-tomcat-9.0.16]# firewall-cmd --add-port=80/tcp --permanentERROR:dbus.proxies:Introspect error on :1.65:/org/fedoraproject/FirewallD1: dbus.exceptions.DBusException: org.fedoraproject.FirewallD1.Exception: 'FirewallD' object ha原创 2020-12-29 15:49:48 · 1565 阅读 · 1 评论