Centos7基础环境配置

Posted

tags:

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

参考技术A

基础软件安装

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

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

yum makecache

yum repolist

mkdir ~/.pip

touch ~/.pip/pip.conf

vim ~/.pip/pip.conf

pip3 install aliyun-python-sdk-core

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



















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

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

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

基于Centos7.4安装部署大数据基础软件环境

基于Centos7.4安装部署大数据基础软件环境

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

Docker学习1使用 Linux(CentOS7)搭建 Docker 基础环境