autoDevops,CI,CD
本文 centos 6.5 优化 的项有18处:1、centos6.5最小化安装后启动网卡2、ifconfig查询IP进行SSH链接3、更新系统源并且升级系统4、系统时间更新和设定定时任5、修改ip地址、网关、主机名、DNS6、关闭selinux,清空iptables7、创建普通用户并进行sudo授权管理8、修改SSH端口号和屏蔽root账号远程登陆9、锁定关键文件系统(禁止非授权用户获得权限)10、精简开机自启动服务11、调整系统文件描述符大小12、设置系统字符集13、清理登陆的时候显示的系统及内核版本14、内核参数优化15、定时清理/var/spool/clientmqueue16、删除不必要的系统用户和群组17、关闭重启ctl-alt-delete组合键18、设置一些全局变量1、启动网卡#centos6.x最小化安装后,网卡默认不是启动状态 ifup eth02、SSH链接 ifconfig 查看IP后SSH终端连接。3、更新源 最小化安装是没有wget工具的,必须先安装在修改源)yum install wget备份原系统更新源mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup进入yum.repos.d目录cd /etc/yum.repos.d下载网易镜像源或者搜狐镜像源#下载网易镜像源: wget http://mirrors.163.com/.help/CentOS6-Base-163.repo #或者 #下载搜狐镜像源: w...
How to upgrade or update kernel of the CentOS to Latest stable KernelThe kernel is the core of the operating system, and runs the CPU, manages system memory, controls access to disk drives, and contains device drivers that enable you to interact with the system and use the hardware and peripherals attached to the  computer.Naturally, kernel update  appeals most system administrators who are responsible for wringing the most performance and benefit out of their existing hardware and software. In some cases, rebuilding the kernel(kernel upgrade or kernel update) is required in order to support new hardware that is not supported, or that is poorly supported, by your system’s existing kernel.Check the current kernel of the system by using uname –r option.[root@localhost ~]# uname -r 3.10.0-327.el7.x86_64 After you have determined the version of the kernel you are currently running, the next step is to obtain the latest version of the k...
大家都知道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 阅读[2069]
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 阅读[2105]
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...
    总共66页,当前第11页 | 页数:
  1. 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