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 ...
随机推荐
- 跟我学SpringCloud | 第八篇:Spring Cloud Bus 消息总线
SpringCloud系列教程 | 第八篇:Spring Cloud Bus 消息总线 Springboot: 2.1.6.RELEASE SpringCloud: Greenwich.SR1 如无特 ...
- 联盟链FISCO BCOS v2.0.0-rc3 发布
FISCO BCOS是完全开源的联盟区块链底层技术平台,由金融区块链合作联盟(深圳)(简称金链盟)成立开源工作组通力打造.开源工作组成员包括博彦科技.华为.深证通.神州数码.四方精创.腾讯.微众银行. ...
- kafka搭建相关可能出现的bug
在Kafka搭建时,首先安装zookeeper,新版本直接解压,启动就好了.由于什么原因,在虚拟机下,必须用root账户启动zookeeper,不然其中一个文件由于没有权限无法创建,导致zookeep ...
- django实战仿慕课网在线视频网站(完成了85%以上的功能已上传github:https://github.com/huwei86/mxonline):
1. 前台功能模块 基本模块:登录 注册 找回密码 / 全局搜索 / 个人中心, 课程功能:课程管理 / 讲师管理 / 授课机构管理 热门推荐 相关课程推荐 用户操作管理:用户收藏 / 课程评论 ...
- Django中使用JS通过DataTable实现表格前端分页,每页显示页数,搜索等功能
Django架构中自带了后端分页的技术,通过Paginator进行分页,前端点击按钮提交后台进行页面切换. 优缺点:后端分页对于数据量大的场景有其优势,但页面切换比较慢. 后端分页python3代码如 ...
- KVM :vnc 远程控制kvm创建虚拟机
一.vnc远程控制服务器 前期准备: 1.编辑/etc/hosts vi /etc/hosts 10.1.16.32 kvm 2.关闭防火墙 service iptables stop 3.关闭sel ...
- C# 中异常抛出捕获机制--throw / try,catch,finally
try { messagebox.show("true"); } catch { messagebox.show("false"); } finally { m ...
- Contos7 常用命令
```pythoncentos常用命令: 查看所有运行的单元:systemctl list-units 查看所有单元:systemctl list-units --all 查看所有启动的服务:syst ...
- 我这边测了一下,发现#后面参数变化浏览器不会刷新,但是#一旦去掉就会刷新了,你那边的url拼的时候能不能在没参数的时候#也拼在里面,这样应该就OK了
我这边测了一下,发现#后面参数变化浏览器不会刷新,但是#一旦去掉就会刷新了,你那边的url拼的时候能不能在没参数的时候#也拼在里面,这样应该就OK了
- Mysql 时间相关
-- 当前时间SELECT NOW(), SYSDATE(), CURRENT_TIMESTAMP(), LOCALTIME(), LOCALTIMESTAMP();SELECT CURDATE(), ...