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 ...
随机推荐
- php对象在内存中创建于释放
<?php /** * 1.对象的创建占用内存, * 对象内存释放,析构方法就是在对象释放前运行最后的一步.可以自动释放和手动释放 * 手动释放:通过unset($p);来释放对象,在这个时候会 ...
- SqlServer执行计划
MSSQLSERVER执行计划详解 * from ServiceInvoke; --创建时间聚集索引扫描 * from AdoLog; --主键ID聚集索引扫描 --2.根据聚集索引排序-性能提升 - ...
- IO解惑:cephfs、libaio与io瓶颈
最近笔者在对kernel cephfs客户端进行fio direct随机大io读测试时发现,在numjobs不变的情况下,使用libaio作为ioengine,无论怎么调节iodepth,测试结果都变 ...
- SQL参数化查询
参数化查询(Parameterized Query 或 Parameterized Statement)是指在设计与数据库链接并访问数据时,在需要填入数值或数据的地方,使用参数 (Parameter) ...
- S7-300CPU存储器介绍及存储卡使用
1. S7 300存储区概述 S7-300 PLC的存储区可以划分为四个区域:装载存储器(Load Memory).工作存储器(Work Memory). 系统存储器(System Memory)和保 ...
- Markdown下,上传图片问题
最简单的方法: 1,登录qq 2,登录博客园,并打开博客园添加随笔的地方:如图: 3,选择需要截屏的地方,按住ctrl+alt+A截屏,然后在qq的发送栏内贴过去 4,鼠标左键按住不松开,然后拖到这里 ...
- ueditor 常用配置
scaleEnabled:是否可以拉伸长高,默认true(当开启时,自动长高失效) autoHeightEnabled:是否自动长高,默认true catchRemoteImageEnable:设置远 ...
- Docker笔记(四):Docker镜像管理
原文地址:http://blog.jboost.cn/2019/07/16/docker-4.html 在Docker中,应用是通过容器来运行的,而容器的运行是基于镜像的,类似面向对象设计中类与对象的 ...
- ThreadGroup详细讲解
import java.util.concurrent.TimeUnit; public class Test { public static void main(String[] args){ // ...
- vue自定义表单生成器,可根据json参数动态生成表单
介绍 form-create 是一个可以通过 JSON 生成具有动态渲染.数据收集.验证和提交功能的表单生成器.并且支持生成任何 Vue 组件.结合内置17种常用表单组件和自定义组件,再复杂的表单都可 ...