免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8618 | 回复: 7
打印 上一主题 下一主题

[服务应用] 求助--本机连接到linux虚拟机的服务一会就自动断开 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-03-14 09:49 |只看该作者 |倒序浏览
求助--本机连接到linux虚拟机的服务一会就自动断开。
环境:vm+oracle 10g+rhel5.4

1)最开始发现secureCRT自动断开,后来加了反空闲设置后解决。

2)sqlplus连接到linux虚拟机的oracle数据库,用sys登录。空闲一会就自动断开了(有20s左右),开始以为是linux防火墙问题,把防火墙停掉后问题依旧。
查询  dba_profiles    select * from dba_profiles 结果 DEFAULT        IDLE_TIME        KERNEL        UNLIMITED

3)本机连接到linux虚拟机的ftp服务,空闲30s后自动断开,但是vsftp参数Idle_session_timeout=600(秒),不会这么快断开。

本机ping linux虚拟机没问题,不是网络的原因

是不是还有别的什么设置导致所有的服务空闲一会就断开?

那位遇到过这类问题,还请解惑。

论坛徽章:
21
白羊座
日期:2013-08-23 15:49:17金牛座
日期:2013-10-08 17:00:03处女座
日期:2013-10-12 11:54:11CU十二周年纪念徽章
日期:2013-10-24 15:41:34午马
日期:2013-11-27 14:07:21巨蟹座
日期:2013-12-04 10:56:03水瓶座
日期:2013-12-04 15:58:00亥猪
日期:2014-05-24 16:02:3115-16赛季CBA联赛之辽宁
日期:2016-11-07 13:52:53戌狗
日期:2013-08-23 16:15:31白羊座
日期:2013-08-24 21:59:24巨蟹座
日期:2013-08-25 16:34:24
2 [报告]
发表于 2013-03-14 10:11 |只看该作者
看一下/etc/profile 里设置没设置TMOUT 参数.

论坛徽章:
0
3 [报告]
发表于 2013-03-14 10:22 |只看该作者
本帖最后由 liyijie79 于 2013-03-14 10:23 编辑

回复 2# zongg
  1. [root@mytest ~]# cat /etc/profile
  2. # /etc/profile

  3. # System wide environment and startup programs, for login setup
  4. # Functions and aliases go in /etc/bashrc

  5. pathmunge () {
  6.         if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
  7.            if [ "$2" = "after" ] ; then
  8.               PATH=$PATH:$1
  9.            else
  10.               PATH=$1:$PATH
  11.            fi
  12.         fi
  13. }

  14. # ksh workaround
  15. if [ -z "$EUID" -a -x /usr/bin/id ]; then
  16.         EUID=`id -u`
  17.         UID=`id -ru`
  18. fi

  19. # Path manipulation
  20. if [ "$EUID" = "0" ]; then
  21.         pathmunge /sbin
  22.         pathmunge /usr/sbin
  23.         pathmunge /usr/local/sbin
  24. fi

  25. # No core files by default
  26. ulimit -S -c 0 > /dev/null 2>&1

  27. if [ -x /usr/bin/id ]; then
  28.         USER="`id -un`"
  29.         LOGNAME=$USER
  30.         MAIL="/var/spool/mail/$USER"
  31. fi

  32. HOSTNAME=`/bin/hostname`
  33. HISTSIZE=1000

  34. if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
  35.     INPUTRC=/etc/inputrc
  36. fi

  37. export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

  38. for i in /etc/profile.d/*.sh ; do
  39.     if [ -r "$i" ]; then
  40.         if [ "$PS1" ]; then
  41.             . $i
  42.         else
  43.             . $i >/dev/null 2>&1
  44.         fi
  45.     fi
  46. done

  47. unset i
  48. unset pathmunge
  49. TMOUT=6000

  50. TMOUT=6000
  51. if [ $USER = "oracle" ]; then
  52.   if [ $SHELL = "/bin/ksh" ]; then
  53.   ulimit -p 16384
  54.   ulimit -n 65536
  55.   else
  56.   ulimit -u 16384 -n 65536
  57.   fi
  58.   umask 022
  59. fi
复制代码

论坛徽章:
21
白羊座
日期:2013-08-23 15:49:17金牛座
日期:2013-10-08 17:00:03处女座
日期:2013-10-12 11:54:11CU十二周年纪念徽章
日期:2013-10-24 15:41:34午马
日期:2013-11-27 14:07:21巨蟹座
日期:2013-12-04 10:56:03水瓶座
日期:2013-12-04 15:58:00亥猪
日期:2014-05-24 16:02:3115-16赛季CBA联赛之辽宁
日期:2016-11-07 13:52:53戌狗
日期:2013-08-23 16:15:31白羊座
日期:2013-08-24 21:59:24巨蟹座
日期:2013-08-25 16:34:24
4 [报告]
发表于 2013-03-14 10:26 |只看该作者
TMOUT=6000


这个单位是s , 6000s 也就是说600分,10小时。

不是这个参数的事,不知道你自己设置其它的参数了吗? 默认的不会断开啊。

论坛徽章:
0
5 [报告]
发表于 2013-03-14 10:55 |只看该作者
回复 4# zongg


    也没设置什么参数,就是安装oracle的时候根据文档设置的一些参数。

论坛徽章:
0
6 [报告]
发表于 2013-03-14 11:24 |只看该作者
  1. [oracle@mytest ~]$  cat .bash_profile
  2. # .bash_profile

  3. # Get the aliases and functions
  4. if [ -f ~/.bashrc ]; then
  5.         . ~/.bashrc
  6. fi

  7. # User specific environment and startup programs

  8. PATH=$PATH:$HOME/bin
  9. TMP=/tmp
  10. TMPDIR=$TMP
  11. ORACLE_BASE=/opt/app/oracle
  12. export ORACLE_BASE
  13. ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
  14. export ORACLE_HOME
  15. ORACLE_SID=ORCL
  16. export ORACLE_SID
  17. PATH=/usr/sbin:$PATH
  18. PATH=$ORACLE_HOME/bin:$PATH
  19. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib:/lib:/usr/lib
  20. export LD_LIBRARY_PATH
  21. CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
  22. unset USERNAME
  23. umask 022

  24. export  LANG=en
  25. [oracle@mytest ~]$
复制代码
  1. [oracle@mytest ~]$ cat /etc/security/limits.conf
  2. # /etc/security/limits.conf
  3. #
  4. #Each line describes a limit for a user in the form:
  5. #
  6. #<domain>        <type>  <item>  <value>
  7. #
  8. #Where:
  9. #<domain> can be:
  10. #        - an user name
  11. #        - a group name, with @group syntax
  12. #        - the wildcard *, for default entry
  13. #        - the wildcard %, can be also used with %group syntax,
  14. #                 for maxlogin limit
  15. #
  16. #<type> can have the two values:
  17. #        - "soft" for enforcing the soft limits
  18. #        - "hard" for enforcing hard limits
  19. #
  20. #<item> can be one of the following:
  21. #        - core - limits the core file size (KB)
  22. #        - data - max data size (KB)
  23. #        - fsize - maximum filesize (KB)
  24. #        - memlock - max locked-in-memory address space (KB)
  25. #        - nofile - max number of open files
  26. #        - rss - max resident set size (KB)
  27. #        - stack - max stack size (KB)
  28. #        - cpu - max CPU time (MIN)
  29. #        - nproc - max number of processes
  30. #        - as - address space limit
  31. #        - maxlogins - max number of logins for this user
  32. #        - maxsyslogins - max number of logins on the system
  33. #        - priority - the priority to run user process with
  34. #        - locks - max number of file locks the user can hold
  35. #        - sigpending - max number of pending signals
  36. #        - msgqueue - max memory used by POSIX message queues (bytes)
  37. #        - nice - max nice priority allowed to raise to
  38. #        - rtprio - max realtime priority
  39. #
  40. #<domain>      <type>  <item>         <value>
  41. #

  42. #*               soft    core            0
  43. #*               hard    rss             10000
  44. #@student        hard    nproc           20
  45. #@faculty        soft    nproc           20
  46. #@faculty        hard    nproc           50
  47. #ftp             hard    nproc           0
  48. #@student        -       maxlogins       4

  49. #nofile(可打开的文件描述符的最大数)和nproc(单个用户可用的最大进程数量)
  50. oracle soft nproc 2047
  51. oracle hard nproc 16384
  52. oracle soft nofile 1024
  53. oracle hard nofile 65536

  54. # End of file
复制代码
  1. [oracle@mytest ~]$ cat  /etc/profile
  2. # /etc/profile

  3. # System wide environment and startup programs, for login setup
  4. # Functions and aliases go in /etc/bashrc

  5. pathmunge () {
  6.         if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
  7.            if [ "$2" = "after" ] ; then
  8.               PATH=$PATH:$1
  9.            else
  10.               PATH=$1:$PATH
  11.            fi
  12.         fi
  13. }

  14. # ksh workaround
  15. if [ -z "$EUID" -a -x /usr/bin/id ]; then
  16.         EUID=`id -u`
  17.         UID=`id -ru`
  18. fi

  19. # Path manipulation
  20. if [ "$EUID" = "0" ]; then
  21.         pathmunge /sbin
  22.         pathmunge /usr/sbin
  23.         pathmunge /usr/local/sbin
  24. fi

  25. # No core files by default
  26. ulimit -S -c 0 > /dev/null 2>&1

  27. if [ -x /usr/bin/id ]; then
  28.         USER="`id -un`"
  29.         LOGNAME=$USER
  30.         MAIL="/var/spool/mail/$USER"
  31. fi

  32. HOSTNAME=`/bin/hostname`
  33. HISTSIZE=1000

  34. if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
  35.     INPUTRC=/etc/inputrc
  36. fi

  37. export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

  38. for i in /etc/profile.d/*.sh ; do
  39.     if [ -r "$i" ]; then
  40.         if [ "$PS1" ]; then
  41.             . $i
  42.         else
  43.             . $i >/dev/null 2>&1
  44.         fi
  45.     fi
  46. done

  47. unset i
  48. unset pathmunge
  49. TMOUT=6000

  50. TMOUT=6000
  51. if [ $USER = "oracle" ]; then
  52.   if [ $SHELL = "/bin/ksh" ]; then
  53.   ulimit -p 16384
  54.   ulimit -n 65536
  55.   else
  56.   ulimit -u 16384 -n 65536
  57.   fi
  58.   umask 022
  59. fi
复制代码

论坛徽章:
0
7 [报告]
发表于 2013-03-14 16:05 |只看该作者
谁还知道啊哪里的问题啊。

论坛徽章:
0
8 [报告]
发表于 2013-03-23 21:12 |只看该作者
用VBOX+Oracle  Linux+Oracle 10g搭建环境,还是同样的配置,没有出现类似的问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP