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 ...
随机推荐
- 大流量下的 ElasticSearch 搜索演进
这是泥瓦匠(bysocket.com)的第27篇精华分享 ES (ElasticSearch)是分布式搜索引擎.引擎太晦涩,其实类似一个 MySQL ,一个存储.方便提供下面功能: 近实时搜索 全文检 ...
- HTML和CSS 基本要点必看
今天的课程名称叫HTML和CSS HTML:它是标记语言,全称为超文本标记语言,它不是编译语言.(说白了就是标签) CSS:它是给标签添加样式的,全称为层叠样式表. 想了解这些必须得知道两个东西 一是 ...
- Programming In Lua 第四章
1, 2, 3, 4, 5, 6, 7,
- Oracle Awr报告_awr报告解读_基础简要信息
导出 关于awr报告的导出,上一篇博客已经进行过讲述了.博客链接地址:https://www.cnblogs.com/liyasong/p/oracle_report1.html 这里就不再赘述. ...
- 我是这么学习Selenium元素定位操作的
写在前面 做web自动化测试都有体会,本质也就是通过操作页面元素对象来模拟用户操作行为,那么首先我们先找到这些元素对象,然后才能进行一系列操作. 我们得先告诉自动化工具或者说代码要操作那个元素,毕竟代 ...
- Python 3网络爬虫开发实战中文PDF+源代码+书籍软件包(免费赠送)+崔庆才
Python 3网络爬虫开发实战中文PDF+源代码+书籍软件包+崔庆才 下载: 链接:https://pan.baidu.com/s/1H-VrvrT7wE9-CW2Dy2p0qA 提取码:35go ...
- 简述vue中父子组件是怎样相互传递值的(基础向)
前言 首先,你需要知道vue中父组件和子组件分别指的是什么? 父组件:vue的根实例——用new Vue()构造函数创建的vue实例(实例会有一个挂载点,挂载点里的所有内容可理解为父组件的内容) ...
- 【linux杂谈】在SSH连接中,openssh如何解决'Connection refused'错误?
openssh是SSH (Secure SHell) 协议的免费开源实现.SSH协议族可以用来进行远程控制, 或在计算机之间传送文件. 这就意味着远程登陆,文件推拉特别是搭建集群后公钥的部署,经常要利 ...
- Python中字符串常见操作
(1)find 查找 格式:mystr.find(str, start, end) 例如: mystr.find(str, start=0, end=len(mystr)) 作用:检测str是否包含在 ...
- 用Supervisor实现进程守护,在异常退出时自动重启
程序启动后,有些是以daemon的形式运行,但在意外退出后,如果不能及时重新启动,会有比较严重的影响. 比如Zimg在图片处理中由于某些图片处理失败,会导致zimg进程挂掉,影响正常的服务提供,并且只 ...