autoDevops,CI,CD
大家都知道Linux平台上,可以通过history命令查看最近所执行过的命令,但history命令默认所显示的只有编号和命令的,只知道命令是最近所执行的,但不知具体执行的日期、时、分、秒,有时给寻找证据带来不便,例如如下显示情况:352  exit353  history354  vi /etc/profile355  history下面就来讲一下,如何让history命令显示最近所执行过的命令的具体执行时间与修改命令保存行数为10000。步骤如下:1、以ROOT用户编辑/etc/profile文件,在里面加入下面内容(我一般习惯在最末尾加):sed -i 's/HISTSIZE=1000/HISTSIZE=10000/g' /etc/profileecho 'export HISTTIMEFORMAT="%Y%m%d-%H%M%S: “’ >> /etc/profile注意:在末尾的“引号”与“S”之间,加入一位空格,将日期时间和历史命令用空格相隔开来。2、退出系统重新登陆注意:在第2步以前所执行的历史命令,在重新登陆后,执行时间全部分显示为第二步执行时的时间,后面所执行的命令,才会显示正确的实际执行时间。
安装CentOS 6.6出现Disk sda contains BIOS RAID metadata 今天在安装CentOS 6.6的时候,当进到检测硬盘步骤的时候,总是过不去,报错如下:Disk sda contains BIOS RAID metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sda服务器有两块硬盘sda、sdb,都有这样的提示;这种情况在安装Ubuntu,SUSE都有类似的情况,只是提示不太一样而已。          故障原因:因为服务器上有两块盘,之前做过Raid1,且安装过Windows操作系统,现在直接改装CentOS不认磁盘,肿么办?          插入安装光盘,进入CetnOS 6.6安装选择菜单时,按“TAB”键,会进入到Linux的命令行模式,然后在启动命令行的后面添加 nodmraid(注意前面有个空格)并按“回车”键。加nodmraid命令是为了关掉阵列;接下来进入安装过程中检测硬盘时就会发现硬盘找到了;
 
0

Changing Network Kernel Settings

发表者:admin分类:Devops2017-04-01 13:30:36 阅读[2357]
10.2. Changing Network Kernel SettingsOracle now uses User Datagram Protocol (UDP) as the default protocol on Linux for interprocess communication, such as cache fusion buffer transfers between the instances. However, starting with Oracle 10g network settings should be adjusted for standalone databases as well.Oracle recommends the default and maximum send buffer size (SO_SNDBUF socket option) and receive buffer size (SO_RCVBUF socket option) to be set to 256 KB. The receive buffers are used by TCP and UDP to hold received data until it is read by the application. The receive buffer cannot overflow because the peer is not allowed to send data beyond the buffer size window. This means that datagrams will be discarded if they do not fit in the socket receive buffer. This could cause the sender to overwhelm the receiver.The default and maximum window size can be changed in the proc file system without reboot:The default setting in bytes of the socket receive buffer:# sysctl -w net.c...
 
0
How To: Network / TCP / UDP TuningThis is a very basic step by step description of how to improve the performancenetworking (TCP & UDP) on Linux 2.4+ for high-bandwidth applications. These settings are especiallyimportant for GigE links. Jump to Quick Step or All The Steps.AssumptionsThis howto assumes that the machine being tuned is involved in supporting high-bandwidthapplications. Making these modifications on a machine that supports multiple users and/ormultiple connections is not recommended - it may cause the machine to deny connectionsbecause of a lack of memory allocation.The StepsMake sure that you have root privleges.Type: sysctl -p | grep memThis will display your current buffer settings. Save These! You may want toroll-back these changesType: sysctl -w net.core.rmem_max=8388608 This sets the max OS receive buffer size for all types of connections.Type: sysctl -w net.core.wmem_max=8388608 This sets the max OS send buffer size for all types of connections.Type...
tag@cwtdb2 ~]$ free -g-bash: fork: Cannot allocate memoryThere is also /proc/sys/kernel/pid_max file, which specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768, results in the same range of PIDs as on earlier kernels (<=2.4). The value in this file can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). Increasing the value will help on large Linux system or clusters to ease process identification and process management. You can easily prevent fork() failures error message with this hack. Display Current Process Identifiers Limit On a Linux Based SystemsType the following command at shell prompt: $ sysctl kernel.pid_max OR $ cat /proc/sys/kernel/pid_max OR $ sysctl kernel.pid_max Sample outputs:kernel.pid_max = 32768Allow for more PIDs on a Linux based systemsup to 222 = 4,194,304Type the following command: # sysctl -w kernel.pid_max=4194303 OR # echo 4194303 ...
 
0

时间戳和标准时间的互转

发表者:admin分类:Devops2017-03-02 15:22:34 阅读[2314]
Linux时间戳和标准时间的互转在LINUX系统中,有许多场合都使用时间戳的方式表示时间,即从1970年1月1日起至当前的天数或秒数。如/etc/shadow里的密码更改日期和失效日期,还有代理服务器的访问日志对访问时间的记录等等。Unix时间戳(Unix timestamp),或称Unix时间(Unix time)、POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数。Unix时间戳不仅被使用在Unix系统、类Unix系统中(比如Linux系统),也在许多其他操作系统中被广泛采用。php中获取时间戳的方法是:time();Date();Linux中获取时间戳的方法是:date +%sLinux中将时间戳转换为日期: date -d "@<timestamp>" 下面介绍几种时间戳格式和标准时间格式转换的方法:1、分别以标准格式和时间戳来显示当前时间[root@365linux ~]# date    2010年 08月 10日 星期二 03:39:21 CST   [root@365linux ~]# date +%s 12813827752、显示指定时间的时间戳[root@365linux ~]# date -d "2010-07-20 10:25:30" +%s    1279592730 3...
内网Linux服务器巡检报告上传到FTP指定目录,通过smtp邮件发送139邮箱方法。水平有限,供参考,可以使用。具体服务器环境:20台服务器Centos6系统,全部位于防火墙后的内网环境中。其中一台主机A可以上外网。其它主机只能内网访问。具体方案:可上网的主机A,配置好smtp邮件客户端,并配置好vsftp功能。每台主机通过脚本收集巡检报告,然后通过定时任务,使用ftp将报告上传到A主机的ftp目录里面。最后将所有主机的报告打包发送到指定邮箱中。具体配置:A主机,配置vsftp功能,这里就不说了。指定FTP目录为:/home/ftp ,并配置好ftp账号与密码。然后给A主机配置好巡检报告脚本,可以根据自己情况修改检查项目,本例具体内容如下:[root@cw ~] #:vi /home/check/report.shreport_ip=`ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`report_time=`date`report_crond=`/etc/init.d/crond status`report_ntp=`cat /etc/crontab |grep ntpdate`report_cpu=`uptime`report_Mem=`free -g`report_Disk=`df -h`report_phy_disk=`/opt/MegaRAID/storcli/storcli64 /c0 show|grep DRIVE`report_Listen=`netstat -lntup |grep java`r...
Linux  too many open file与Resource temporarily unavailable解决方法Linux普通用户对打开文件最大数与最大用户进程数,有限制。[ct@hbyjsdb ~]$ ulimit -acore file size          (blocks, -c) 0data seg size           (kbytes, -d) unlimitedscheduling priority             (-e) 0file size               (blocks, -f) unlimitedpending signals                 (-i) 30439max locked memory       (kbytes, -l) 64max memory size         (kbytes, -m) unlimitedopen files                      (-n) 2048pipe size   &nbs...
SecureCRT连接到数据库服务器,提示的错误为Resource temporarily unavailable。应该是超出了系统当前设置的值。关于超出资源限制的事之前有碰到过,只不过不是这个错误,而是open files: cannot modify limit: Operation not permitted。下面描述一下关于Resource temporarily unavailable这个错误及其相关信息。ssh 命令使用普通用户连接服务器,然后就出现错误提示:Write failed: Broken pipe测试root用户连接正常,在root用户下切换普通用户报错:[root@snaqi-test3 bin]# su - oraclesu: cannot set user id: Resource temporarily unavailable bash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: retry: Resource temporarily unavailablebash: fork: Resource temporarily unavailable执行以下命令查看 ps -U oracle | wc -l lsof | grep oracle | wc -l用户打开文件资源数。这里就参照安装oracle时的配置参数修改下相对应的用户配置。 编辑系统环境配置文件/etc/profile,在最后添加以下内容if [ $USER = "oracle" ]; then&nbs...
漏洞描述 目前需要升级内核(RHEL6x,已经有升级包了)漏洞编号:CVE-2016-5195漏洞名称:脏牛(Dirty COW)漏洞危害:低权限用户利用该漏洞技术可以在全版本Linux系统上实现本地提权影响范围:Linux内核>=2.6.22(2007年发行)开始就受影响了,直到2016年10月18日才修复。                 360 Vulpecker Team:Android 7.0最新的10月补丁安全级别的系统上测试过漏洞POC,确认Android受影响为什么这个漏洞叫脏牛(Dirty COW)漏洞?Linux内核的内存子系统在处理写时拷贝(Copy-on-Write)时存在条件竞争漏洞,导致可以破坏私有只读内存映射。一个低权限的本地用户能够利用此漏洞获取其他只读内存映射的写权限,有可能进一步导致提权漏洞。近日Linux官方爆出了“脏牛”漏洞(代号:Dirty COW,漏洞编号:CVE-2016-5195),攻击者可利用该漏洞本地以低权限提升到root权限。为避免您的服务器受影响,请尽快检查您的内核版本是否受影响,并及时关注漏洞修复通告信息。【漏洞详情】:Linux内核的内存子系统在处理写入时复制(copy-on-write, COW)时产生了竞争条件(race condition)。恶...
    总共67页,当前第12页 | 页数:
  1. 2
  2. 3
  3. 4
  4. 5
  5. 6
  6. 7
  7. 8
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22