1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
网络设置:
setup设置网络
vi /etc/sysconfig/netwrok-scripts/ifcfg-eth0
删除HWADDR和UUID行
dns:/etc/resolv.conf
 
 
linux版本,内核查看
cat /etc/redhat-release
uname -r
uname -m
 
SELINUX
[root@lufengcentos ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@lufengcentos ~]# setenforce 0
[root@lufengcentos ~]# getenforce
 
开机自启动
[root@lufengcentos ~]# for oldboy in `chkconfig --list|grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $oldboy off;done 
[root@lufengcentos ~]# for oldboy in crond network rsyslog sshd sysstat ;do chkconfig --level 3 $oldboy on;done
[root@lufengcentos ~]# chkconfig --list|grep 3:on  
 
防火墙
[root@lufengcentos ~]# /etc/init.d/iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
 
中文字符
[root@lufengcentos ~]# cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
[root@lufengcentos ~]# cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori 
[root@lufengcentos ~]# echo ' LANG="zh_CN.UTF-8"' >/etc/sysconfig/i18n
[root@lufengcentos ~]# source /etc/sysconfig/i18n
[root@lufengcentos ~]# echo $LANG
 
时间同步
[root@lufengcentos ~]# echo '#time sync by lufeng @2017-3-14' >>/var/spool/cron/root
[root@lufengcentos ~]# echo '*/5 * * * * /usr/sbin/ntpdate time.nist.gov' >/dev/null2>&1 >>/var/spool/cron/root
[root@lufengcentos ~]# crontab -l
#time sync by lufeng @2017-3-14
*/5 * * * * /usr/sbin/ntpdate time.nist.gov
 
文件描述符设置
[root@lufengcentos ~]# ulimit -n
1024
[root@lufengcentos ~]# vim /etc/security/limits.conf
*                -        nofile          65535
 
内核优化
[root@lufengcentos ~]# vi /etc/sysctl.conf
 
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl =15
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_fin_timeout = 2
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_orphans = 32768
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_wmem = 8192 131072 16777216
net.ipv4.tcp_rmem = 32768 131072 16777216
net.ipv4.tcp_mem = 786432 1048576 1572864
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_conntrack_max = 65536
net.ipv4.netfilter.ip_conntrack_max=65536
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=180
net.core.somaxconn = 16384
net.core.netdev_max_backlog = 16384
 
[root@lufengcentos ~]# sysctl -p

本文出自 “大梦初醒” 博客,请务必保留此出处http://bestlufeng.blog.51cto.com/11790256/1906914

新系统基础优化--Centos6.6的更多相关文章

  1. Linux实战教学笔记06:Linux系统基础优化

    第六节 Linux系统基础优化 标签(空格分隔):Linux实战教学笔记-陈思齐 第1章 基础环境 第2章 使用网易163镜像做yum源 默认国外的yum源速度很慢,所以换成国内的. 第一步:先备份 ...

  2. Linu之linux系统基础优化和基本命令

    Linux系统基础优化和基本命令 网络参数设定命令 ifconfig: 查询,设置网卡和ip等参数 ifup,ifdown: 脚本命令,更简单的方式 ip: 符合指令,直接修改上述功能 编辑网卡配置文 ...

  3. Linux 系统基础优化和常用命令

    目录 Linux 系统基础优化和常用命令 软连接 tar解压命令 gzip命令 netstart命令 ps命令 kill命令 killall命令 SELinux功能 iptables防火墙 Linux ...

  4. Centos 7.x 系统基础优化

    Centos 7.x 系统基础优化 1.更换国内yum源 删除系统带的centos官方yum源 rm -rf /etc/yum.repos.d/* 使用国内阿里云源 curl -o /etc/yum. ...

  5. centos 6.x 系统基础优化简版

    Centos 6.x 系统基础优化 1.更换国内yum源 删除系统带的centos官方yum源 rm -rf /etc/yum.repos.d/* 使用国内阿里云源 curl -o /etc/yum. ...

  6. 运维 07 Linux系统基础优化及常用命令

    Linux系统基础优化及常用命令   Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令 ...

  7. 系统基础优化 vim

    系统基础优化 vim 1系统基础优化 (CPU-lscpu 内存-free 磁盘-df 负载-w/uptime) 1.1 系统基础优化 准备工作:如何查看系统的信息 (1)cat /etc/redha ...

  8. 系统基础优化( 创建yum私有仓库最详细操作及解释 )

    目录 系统基础优化 一.Linux中安装软件的方式 安装方式 三种安装方式的区别 二.RPM安装☆ 1.安装及其他命令 2.手动下载软件包,可将其拖入shell中自动传入 1).手动网页下载软件包 2 ...

  9. Centos6.5 64linux系统基础优化(二)

    1  操作的最小化原则 1)安装系统最小化 2)开启程序服务最小化原则 3)操作最小化原则 4)登陆最小化原则;平时没有需求不用root登陆,要用普通登陆. 2  更改ssh服务默认端口及常规配置 # ...

随机推荐

  1. Android -- Drag&&Drop

    Android3.0提供了drag/drop框架,利用此框架可以实现使用拖放手势将一个view拖放到当前布局中的另外一个view中. 实现拖放的步骤 首先,我们先了解一下拖放过程,从官方文档可以知道, ...

  2. Android -- queryIntentActivities

    某些时候你想要知道某个APP是否有注册了一个明确的intent,比如说你想要检查某个receiver是否存在,然后根据是否存在来这个receiver来在你的AP里面enable某些功能.我们可以通过P ...

  3. Spark简介及其在ubuntu下的安装使用

    转:http://blog.csdn.net/pelick/article/details/9888311 Spark概述 Spark是一种与 Hadoop 相似的开源集群计算环境,在性能和迭代计算上 ...

  4. [Functional Programming] Using Last monoid with Maybe

    Imaging we have a deck of cards, eveytimes we need to pick one card from deck, the result we want to ...

  5. 编码GBK的不可映射字符

    1.错误描写叙述 [ERROR] /E:/Eclipse/workspace/huxs/src/test/java/com/you/huxs/utils/SpringTestBase.java:[14 ...

  6. WIN10系统右击开始菜单没有属性选项怎么办

    修复方法一:1.按下"WIN+R"输入:regedit回车,进入注册表编辑器:2.在注册表左侧依次打开:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ ...

  7. springboot项目在Eclipse/Myeclipse中Debug启动跳转至断点(exitCurrentThread)

    Spring Boot项目使用了spring-boot-devtools工具且在Eclipse中Debug调试会自动跳转到这个方法: public static void exitCurrentThr ...

  8. Objective-C编程 - 关于Block的要点

    1. 首先,我们快速过一下,什么是Block? Block是一段代码,它在OC中以^开头,可以有返回值,和参数列表,但就是没有名字. 所以,你可以把它认为是匿名函数. 事实上,它和Swift中的闭包( ...

  9. C# “贝格尔”编排法

    采用“贝格尔”编排法,编排时如果参赛队为双数时,把参赛队数分一半(参赛队为单数时,最后以“0”表示形成双数),前一半由1号开始,自上而下写在左边:后一半的数自下而上写在右边,然后用横线把相对的号数连接 ...

  10. 使用Spring框架入门三:基于XML配置的AOP的使用

    一.引入Jar包 <!--测试1使用--> <dependency> <groupId>org.springframework</groupId> &l ...