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 ...
随机推荐
- Unity Shader 屏幕后效果——颜色校正
屏幕后效果指的是,当前整个场景图已经渲染完成输出到屏幕后,再对输出的屏幕图像进行的操作. 在Unity中,一般过程通常是: 1.建立用于处理效果的shader和临时材质,给shader脚本传递需要控制 ...
- Java多线程学习(吐血超详细总结)
Java多线程学习(吐血超详细总结) 林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 写在前面的话:此文只能说是java多线程的一个入门,其实 ...
- TCP/IP 第三章
1,ip协议不可靠.无连接特性介绍 不可靠:计算机A往计算机B发送数据报1,若途径的路由器缓存已满,或者ttl(time to live 生存周期)到了,则路由器直接丢弃数据包1,并产生icmp数据包 ...
- 【Linux】一步一步学Linux——VMware Workstation 15 Pro安装图解教程(06)
目录 00. 目录 01. VMware Workstation Pro15下载 02. VMware Workstation Pro15安装 03. VMware Workstation Pro 1 ...
- Rxjs中Notification 介绍
timer(0, 1000) // 计时器,每1000ms发射一个值,初始发射值延迟时间为0s: .pipe( take(5), // 取前5个值 takeWhile(value => valu ...
- Cisco packet tracer下dhcp的配置的vlan的应用
话不多说,先上拓扑图. pc0和pc1分别接在三层交换机的F0/1.F0/2接口,ser接在F0/24接口,用ser用作dhcp的服务器. 0x01:配置server0 先配置server的IP地址. ...
- Azkaban Flow 2.0 使用简介
官方建议使用Flow 2.0来创建Azkaban工作流,且Flow 1.0将被弃用 目录 目录 一.简单的Flow 1. 新建 flow20.project 文件 2. 新建 .flow 文件 3. ...
- 数字IC前后端设计中的时序收敛(一)前言
本文转自:自己的微信公众号<数字集成电路设计及EDA教程> 里面主要讲解数字IC前端.后端.DFT.低功耗设计以及验证等相关知识,并且讲解了其中用到的各种EDA工具的教程. 为了纪念,同时 ...
- windows美化工具7+ Taskbar Tweaker
今天分享一个windows美化工具 7+ Taskbar Tweaker 调整工具专为 Windows 任务栏工作者量身定制,支持 Windows 7 以及更高版本的(非服务器版)微软操作系统平台. ...
- tomcat问题解决
tomcat问题解决 运行tomcat环境下,idea中出现 error running 项目名address localhost1099 is already in use 的时候,如何解决? 1, ...