basic
vmware三种网络类型
- bridged(桥接)通过物理主机网卡架设桥,从而连入实际网络,最接近正式网络环境
- NAT(地址转换)虚拟机通过宿主机转发地址上网,宿主机ip更改虚拟机不需要改。过程:虚拟机上网先通过宿主机转发地址,通过路由器转成公网地址
- host-only(仅主机)虚拟机只能和宿主机通信,不能上网。
配置网卡
查看系统版本
2、uname -a :显示系统名、节点名称、操作系统的发行版号、操作系统版本、运行系统的机器 ID 号。
磁盘分区
系统优化
.关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config .关闭不必要的服务
for services in `chkconfig --list |grep :on |awk -F' ' '{ print $1" " }'`;do
chkconfig $services off
done
for services in crond irqbalance network lvm2-monitor sshd rsyslog sysstat zabbix-agent ;do
chkconfig $services on
done .ssh修改
sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config是否允许使用基于 GSSAPI 的用户认证.默认值为"no".仅用于SSH-.
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config sed -i 's/#Port 22/Port 21987/' /etc/ssh/sshd_config
/etc/init.d/sshd restart .打开文件数
cat >> /etc/security/limits.conf << EOF
* soft nproc 单个用户可用的最大进程数量(软限制)
* hard nproc
* soft nofile 最大打开文件数(软限制)
* hard nofile
EOF echo "* soft nproc 65535" > /etc/security/limits.d/-nproc.conf 最大线程数 ulimit -SHn
ulimit -SHu .历史命令
#Configure history
mkdir -p /gomeo2o/histlog/ && chmod -R /gomeo2o/histlog/ && chmod o+t /gomeo2o/histlog/
cat >>/etc/profile << EOF
USER_IP=\`who -u am i >/dev/null| awk '{print \$NF}'|sed -e 's/[()]//g'\`
export HISTTIMEFORMAT="[%Y.%m.%d %H:%M:%S_\${USER_IP}_\${LOGNAME}]"
USER_IP=\`who -u am i >/dev/null| awk '{print \$NF}'|sed -e 's/[()]//g'\`
HISTDIR=/gomeo2o/histlog/.hist
if [ -z \$USER_IP ]
then
USER_IP=\`hostname\`
fi
if [ ! -d \$HISTDIR ]
then
mkdir -p \$HISTDIR
chmod \$HISTDIR
fi
if [ ! -d \$HISTDIR/\${LOGNAME} ]
then
mkdir -p \$HISTDIR/\${LOGNAME}
chmod \$HISTDIR/\${LOGNAME}
fi
export HISTSIZE=
export HISTFILESIZE=
DT=\$(date +%Y%m)
export HISTFILE="\$HISTDIR/\${LOGNAME}/\${USER_IP}.hist.\$DT"
chmod \$HISTDIR/\${LOGNAME}/*.hist* 2>/dev/null
EOF 6.内核参数
cat >> /etc/sysctl.conf << EOF
fs.file-max = 65536 最大打开文件数
kernel.shmall = 2097152 全部允许使用的共享内存大小
kernel.shmmax = 2147483648 单个段允许使用的大小
kernel.shmmni = 4096 整个系统的内存segment的总个数
kernel.sem = 250 32000 100 128
net.ipv4.tcp_max_syn_backlog = 65536 表示那些尚未收到客户端确认信息的连接(SYN消息)队列的长度
net.core.netdev_max_backlog = 32768 允许送到队列的数据包的最大数目
net.core.somaxconn = 32768 用来限制监听(LISTEN)队列最大数据包的数量 net.core.wmem_default = 8388608 发送套接字缓冲区大小的默认值
net.core.rmem_default = 8388608 接收套接字缓冲区大小的默认值
net.core.rmem_max = 16777216 接收套接字缓冲区大小的最大值
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2 为了打开对端的连接,内核需要发送一个SYN 并附带一个回应前面一个SYN 的ACK。也就是所谓三次握手中的第二次握手。这个设置决定了内核放弃连接之前发送SYN+ACK 包的数量。
net.ipv4.tcp_syn_retries = 2 在内核放弃建立连接之前发送SYN 包的数量 net.ipv4.tcp_tw_recycle = 1 开启TCP连接中TIME-WAIT sockets的快速回收
#net.ipv4.tcp_tw_len = 1
#net.ipov4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_fin_timeout = 60
#net.ipv4.tcp_keepalive_time = 120
net.ipv4.ip_local_port_range = 1024 65535
EOF
sysctl -p 7.取消三键重启
sed -i /shutdown/'s/^/#/' /etc/init/control-alt-delete.conf 8.定时任务
mkdir /etc/cron.daily.bak
mv /etc/cron.daily/makewhatis.cron /etc/cron.daily.bak
mv /etc/cron.daily/mlocate.cron /etc/cron.daily.bak 9.时间同步
sed -i '10c\restrict 10.125.14.239' /etc/ntp.conf
sed -i '11c\restrict 10.125.14.240' /etc/ntp.conf
sed -i '22,24s/^/#/' /etc/ntp.conf
sed -i '19c\server 10.125.14.239 prefer' /etc/ntp.conf
sed -i '20c\server 10.144.14.240' /etc/ntp.conf
sed -i '36s/^#//' /etc/ntp.conf
sed -i '45s/^/#/' /etc/ntp.conf
chkconfig --level 35 ntpd on
echo "*/ * * * * /usr/sbin/ntpdate ntp01.intra.gomeplus.com ntp02.intra.gomeplus.com > /dev/null >&" >
>/var/spool/cron/root .禁用ipv6
# Diable ipv6
cat > /etc/modprobe.d/ipv6.conf << EOFI
alias net-pf- off
options ipv6 disable=
EOFI
echo "NETWORKING_IPV6=off" >> /etc/sysconfig/network .设置dns
# set local dns
sed -i '/nameserver/d' /etc/resolv.conf
echo 'search dev.gomeplus.com' >> /etc/resolv.conf ##开发环境
echo 'search test.gomeplus.com' >> /etc/resolv.conf ##测试环境
echo 'nameserver 10.125.14.244' >> /etc/resolv.conf
echo 'nameserver 10.125.14.245' >> /etc/resolv.conf
echo 'nameserver 10.125.14.246' >> /etc/resolv.conf
echo 'nameserver 10.125.14.247' >> /etc/resolv.conf
\cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime .设置yum
#set LAN Yum
rm -f /etc/yum.repos.d/CentOS-Base.repo
rm -f /etc/yum.repos.d/CentOS-Debuginfo.repo
rm -f /etc/yum.repos.d/CentOS-fasttrack.repo
rm -f /etc/yum.repos.d/CentOS-Media.repo
rm -f /etc/yum.repos.d/CentOS-Vault.repo
wget http://10.125.2.1/ks/gomeo2o.repo -P /etc/yum.repos.d/
修改字符集
同步互联网时间
历史命令
文件描述符
锁定系统文件
禁ping
目录
域名解析
修改主机名
/etc/fstab 开机挂载信息的文件,使得开机能够自动挂载分区
/etc/rc.local
/etc/inittab
inode&&block


basic的更多相关文章
- Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结
Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...
- Basic Tutorials of Redis(9) -First Edition RedisHelper
After learning the basic opreation of Redis,we should take some time to summarize the usage. And I w ...
- Basic Tutorials of Redis(8) -Transaction
Data play an important part in our project,how can we ensure correctness of the data and prevent the ...
- Basic Tutorials of Redis(7) -Publish and Subscribe
This post is mainly about the publishment and subscription in Redis.I think you may subscribe some o ...
- Basic Tutorials of Redis(6) - List
Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with t ...
- Basic Tutorials of Redis(5) - Sorted Set
The last post is mainly about the unsorted set,in this post I will show you the sorted set playing a ...
- Basic Tutorials of Redis(4) -Set
This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...
- Basic Tutorials of Redis(3) -Hash
When you first saw the name of Hash,what do you think?HashSet,HashTable or other data structs of C#? ...
- Basic Tutorials of Redis(2) - String
This post is mainly about how to use the commands to handle the Strings of Redis.And I will show you ...
- Basic Tutorials of Redis(1) - Install And Configure Redis
Nowaday, Redis became more and more popular , many projects use it in the cache module and the store ...
随机推荐
- Java类库的源码
Java类库中的类,包括System.String.Scanner.Math.Random等:这些类也是用Java编写的. Java类库中包含数千个文件,其中的很多文件都包含数千行代码:因为Java类 ...
- PATB 1015. 德才论 (25)
1015. 德才论 (25) 比较函数折腾好久,最后还因为cout,printf的区别而超时,超时是因为cout输出效率低. 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 ...
- golang切片和数组的区别
好久的没有写博客了,这段时间没事研究了下go这门语言. 我们先介绍下go中的数组和切片的区别和用法 说了这么多 我们先来看段代码吧 var arr1 [3]int var arr2 [3]int = ...
- 认识Mybatis的一二级缓存
认识Mybatis的一二级缓存 一次完整的数据库请求,首先根据配置文件生成SqlSessionFactory,再通过SqlSessionFactory开启一次SqlSession,在每一个SqlSes ...
- Git使用小技巧之回滚和撤销
想要获取更多文章可以访问我的博客 - 代码无止境. 日常的开发,我们难免会创建错误的git提交记录,整个时候git给我们提供了两个命令来解决这个问题.一个命令是git reset,另一个是git re ...
- flask 请求上下文源码(转)
本篇阅读目录 一.flask请求上下文源码解读 二.http聊天室(单聊/群聊)- 基于gevent-websocket 回到顶部 转:https://www.cnblogs.com/li-li/p/ ...
- mplayer+ffmpeg 组合截图
mplayer截图的优点:对于一个时长很长的视频,可以任意指定一个时间点截图,mplayer会直接跳到这个时间点开始解码截图: 缺点:由于是直接跳到指定的时间点,也就是直接跳过了之前的帧,这样解码出来 ...
- 版本管理--svn解决代码冲突
高级的svn解决冲突的方法: 选择正在冲突的文件,右键,选择Edit confilicts,这时候出现一个弹框, 看你实际的需要用自己的代码,还是用同事的代码,或者合并起来.最后点击Mark as r ...
- Python 为什么要继承 object 类?
自己搬运自己在知乎上的回答,感觉破乎吃枣药丸,哪天挂了这里就是个备份. 链接:https://www.zhihu.com/question/19754936/answer/229327803 2017 ...
- JavaScript函数及闭包
前面一片文章讲到过一点函数,了解到每声明一个函数就会产生一个作用域.而外面的作用域访问不了里面的作用域(把里面的变量和函数隐藏起来),而里面的可以访问到外面的.对于隐藏变量和函数是一个非常有用的技术. ...