linux 系统环境设置

 

yum--update 服务停止

/sbin/service yum-updatesd status

/sbin/service yum-updatesd stop

 

/sbin/chkconfig --list

/sbin/chkconfig  -----level  yum-updatesd 2345 off

 

设置hostname

vi /etc/sysconfig/network

 hostname server20

 

设置DNS

ivi /etc/resolv.conf

 

设置ip

setup

 

重启网络服务

service   network    restart

 

查看网卡情况

ip addr

参考: http://www.cnitblog.com/201/archive/2009/08/20/60887.html

 

创建用户

groupadd admin
useradd -m -g admin admin
userdel -fr admin

 

sudo 免输入密码

需要root权限

vi /etc/sudoers

# User privilege specification 
root    ALL=(ALL:ALL) ALL  
后面一行新增
admin   ALL=(ALL)       NOPASSWD :ALL

 

 

配置ssh

1.ssh-keygen

2. cp id_rsa authorized_keys (目的是保证authorized_keys的权限一致)

3. vi authorized_keys

4. vi /etc/ssh/sshd_config

设置下面的选项:

Port 2209
PermitRootLogin no
UseDNS no
PasswordAuthentication no
GSSAPIAuthentication no #此项默认为yes,默认登录很慢

5. /etc/init.d/sshd restart

 

配置limit

/etc/security/limits.conf
# End of file 一行后:
admin soft nofile 65535
admin hard nofile 65535

 

配置limit系统内核

vi /etc/sysctl.conf

sudo /sbin/sysctl -p 生效

 

#kernel.shmall = 4294967296 一行后新增:

net.core.wmem_max=12582912
net.core.rmem_max=12582912
net.ipv4.tcp_rmem= 10240 87380 12582912
net.ipv4.tcp_wmem= 10240 87380 12582912
net.ipv4.tcp_mem=  10240 87380 12582912
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 0
net.ipv4.tcp_fack = 1
net.ipv4.tcp_no_metrics_save = 1
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_fin_timeout = 8
net.ipv4.tcp_keepalive_intvl = 20
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_time = 20
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.ip_local_port_range = 32768 65535
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_max_tw_buckets = 1000
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.core.somaxconn=131072
fs.file-max=3224775

注意 :内核2.6.32需要修改ulimit 中的max user processes(参考:http://blog.yufeng.info/archives/2568

[admin@server3 app]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 192090
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 192090
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
  • 修改 /etc/security/limits.d/90-nproc.conf ,把默认的1024修改为unlimited
    *          soft    nproc     unlimited
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值