记一次·ulimit: open files: cannot modify limit:不允许操作

一、背景

在安装StarRocks,启动be进程的时候,执行start-be.sh,报错ulimit: open files: cannot modify limit:不允许操作。
查看启动脚本,发现脚本会检查nofile(可打开文件数),如果小于60000,则会调用ulimit -n 65535设置nofile的值。
但是在设置的时候就报了标题所示的异常。

# start_be.sh
if [[ $(ulimit -n) -lt 60000 ]]; thenulimit -n 65535
fi

二、操作

  1. 修改/etc/security/limit.conf
  2. 按照文件内原有的提示增加以下配置
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
##*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4# End of file
tony soft nofile 65535
tony hard nofile 65536
  • 我这里设置的第一列是用户名
  • 第二列是类型,soft设置的值,在文件修改生效后,会取该值。hard设置的值,是一个最大值,在设置时不可以超过hard的值。
  • 第三列是值的名称,nofile指可以同时打开的文件个数
  • 第四列就是具体的值。
  1. 保存后,重新登录这个用户就生效了。

三、注意点

  1. limit.conf需要使用root权限才可以编辑修改保存。

四、参考

bash: ulimit: open files: cannot modify limit: 不允许的操作 |

记一次·ulimit: open files: cannot modify limit:不允许操作相关推荐

  1. oracle用户登录报错,oracle用户登录报错-bash: ulimit: open files: cannot modify limit: Operation not permitted...

    问题现象 使用ssh连接oracle用户时提示错误 -bash: ulimit: open files: cannot modify limit: Operation not permitted 操作 ...

  2. -bash: ulimit: pipe size: cannot modify limit: Invalid argument

    从root账号切换到oracle账号时,出现了"-bash: ulimit: pipe size: cannot modify limit: Invalid argument"提示 ...

  3. ulimit: file size: cannot modify limit: Operation not permitted 修改ulimit -f 时报错

    ulimit -f  2048000 执行报错 报错原因:设定值超过系统当前设定值: 当前设定值查看:ulimit -a   查看输出中 -f的对应值 file size                ...

  4. 【core】设置core大小遇到-bash: ulimit: core file size: cannot modify limit: Operation not permitted

    在调试过程中遇到很多问题,发现网上的分享都不够清晰,所以自己写了这篇. 在Linux系统中执行程序会遇到崩溃的情况.但是,当 ulimit -c 查到的值为0时不会生成core文件.因此,通过使用 u ...

  5. python 读取pdf cid_记一次为解决Python读取PDF文件的Shell操作

    一.背景 本想将 PDF 文件转换为 Word 文档,然后网上搜索了一下发现有挺多转换的软件.有的是免费的.收费,咱也不知哪个好使,还得一个个安装试用.先不说能不解决问题,就这安装试用想想就脑壳疼.便 ...

  6. 记sentinel里防止多并发下读取脏数据的操作

    阅读sentinel的contextutil.java文件里的代码时,发现了一个在高并发场景下防止读取脏数据的操作,代码截取如下: private static volatile Map<Str ...

  7. 如何获取WIN10 Program Files 文件夹下的文件操作权限

    找到指定文件,右键-属性-找到指定用户-授"完全控制权限"--更改文件--恢复默认权限.

  8. 记一次阿里云oss挂在到服务器文件目录操作事故(阿里云oss挂在到ecs清空了原有的文件)

    ·前言· 客户说要给服务器的图片资源加上oss,我的第一反应就是对接阿里云的oss,一切对接code完毕之后,想着将oss挂在到服务器上,然后就有了这篇文章,挂在oss以前也仅仅是听说过,但是没有正式 ...

  9. ulimit调优|设置普通用户的ulimit值

    个人总结: 如何设置普通用户的ulimit值 1.vim /etc/profile 增加 ulimit -n 10240 source /etc/profile 重新启动就不需要运行这个命令了. 2. ...

最新文章

  1. vim-commentary 插件用法
  2. 20145209 《信息安全系统设计基础》第7周学习总结
  3. floa和position
  4. 微信iOS版更新:可批量管理不常联系的朋友
  5. Oracle的REDO和UNDO
  6. android室内地图控件,[开源] Android InDoorView 室内选位控件
  7. hadoop 入门学习系列十一----hue安装
  8. better-scroll插件 api
  9. Mismatch between array dtype (‘<U40‘) and format specifier (‘%.18e‘)
  10. js 原始数据类型、引用数据类型
  11. 虚拟机桌面图标开机位置错乱的解决方法
  12. VsCode模仿简单百度网页(html)
  13. 微软sccm服务器,微软SCCM是什么?
  14. 身份证号码验证——C语小程序言
  15. php.c drcom,成功 将校园客户端drcom搞进openwrt
  16. JAVA多态的理解及应用
  17. NOIP-模拟试题之--猴子摘桃
  18. IOT(4)---手机中的传感器
  19. error C2065: “pair”: 未声明的标识符
  20. Web日志安全分析浅谈

热门文章

  1. NLP数据预处理的一般方法
  2. 简单实现B/S服务器
  3. 初学者如何搭建React开发环境并且创建react项目
  4. Web前端 | HTML表单form
  5. 一篇文章搞懂「低保真原型与高保真原型」
  6. 如何高效工作,手把手教你制定自己的时间表-20200408(第1期)
  7. linuxprobe-第一节课
  8. linux 查看系统命令
  9. 算法竞赛中计算机1000ms一般能运行的范围
  10. jQuery - 基于当前元素的遍历