centos基础环境配置

Posted 小怪獣55

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos基础环境配置相关的知识,希望对你有一定的参考价值。

1.常用软件安装

yum install  vim iotop bc gcc gcc-c++ glibc glibc-devel pcre \\
pcre-devel openssl openssl-devel zip unzip zlib-devel net-tools \\
lrzsz tree ntpdate telnet lsof tcpdump wget libevent libevent-devel \\
bc systemd-devel bash-completion traceroute firewalld bridge-utils -y

2.CentOS Linux release 7.2.1511 (Core) 修改网卡名

原网卡名为:ifcfg-eno16777736

#1.
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv eno16777736 ifcfg-eth0
[root@localhost network-scripts]# vi ifcfg-eth0
NAME=eth0 #修改
DEVICE=eth0 #修改

#2.
[root@localhost ~]# vim /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg

#3.
[root@localhost ~]# cd /etc/udev/rules.d
[root@localhost ~]# vi 70-persistent-net.rules
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTRaddress=="00:0c:29:44:17:2b",ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0"
00:0c:29:44:17:2b #为Mac地址

#4.
[root@localhost ~]# reboot

3.内核版本查看

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 ​4.关闭防火墙/NetworkManager/selinux

#1.
systemctl stop firewalld && systemctl disable firewalld

#2.
systemctl stop NetworkManager && systemctl disable NetworkManager

#3.
sed -i -r s@(^SELINUX=).*$@\\1disabled@ /etc/selinux/config

5.常用yum源

#CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

#CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

#CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo



















以上是关于centos基础环境配置的主要内容,如果未能解决你的问题,请参考以下文章

Oracle VM + centos7.1+openstack kilo 多结点安装教程---基础环境配置

Centos 7 搭建OpenStack 私有云——基础环境配置

openstack 入门 准备篇二:基础环境的搭建和配置centos M版本

Linux基础环境_安装配置教程(CentOS7.2 64JDK1.8Tomcat8)

docker配置centos7的python2.7下scrapy基础环境遇到的问题

MySQL基础环境_安装配置教程(Windows7 64或Centos7.2 64MySQL5.7)