Centos安装与配置
2024-09-06 00:31:05
一、安装
- 默认安装
二、配置
- 配置网卡
BOOTPROTO=none
ONBOOT=yes
IPADDR=xxx.xxx.x.xx
PREFIX=24
GATEWAY=xxx.xxx.x.x
DNS1=xxx.xxx.x.x 注:删掉网卡内的UUID ,通用唯一识别码和HWADDR MAC地址 这两行。 所有网卡都需要删除 - 安装wget:yum -y install wget;
- 修改为阿里的yum源
1、cd /etc/yum.repos.d
2、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
或
mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}
3、下载版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、添加epel
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
5、生成缓存
yum clean all
yum makecache - 下载常用工具
yum -y install wget net-tools screen lsof tcpdump nc mtr openssl-devel vim bash-completion lrzsz nmap telnet tree ntpdate bash-completion chrony vsftpd
提升效率:
yum -y install ncdu glances mosh rsync - 关闭selinux
sed -i.bak 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
- 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld - 修改主机名
hostnamectl set-hostname 7mini
- 修改字符集
localectl status #查看当前字符集
# localectl set-locale LANG=zh_CN.UTF-8 #修改字符集为zh_CN.UTF-8,命令行和配置文件都生效
# cat /etc/locale.conf #查看配置文件
LANG=zh_CN.UTF-8 - 修改文件数限制
ulimit -n #默认大小
1024
echo "* soft nofile 65536" >> /etc/security/limits.conf #xi修改最大限制为65535
echo "* hard nofile 65536" >> /etc/security/limits.conf
reboot #重启后生效 - 时间同步
ntpdate ntp1.aliyun.com
cp /etc/chrony.conf{,.bak} vim /etc/chrony.conf
server ntp6.aliyun.com iburst systemctl start chronyd
systemctl enable chronyd #开机启动
systemctl restart chronyd
chronyc sources #查看同步源
[root@7mini-node2 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88 2 6 17 31 +653us[+1965us] +/- 32ms 2)或者通过计划任务进行同步
[root@linux-node1 ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@linux-node1 ~]# crontab -l
*/5 * * * * /usr/sbin/ntpdate time1.aliyun.com > /dev/null - 可参考:https://www.cnblogs.com/jokerbj/p/9133093.html
最新文章
- Web jquery表格组件 JQGrid 的使用 - 从入门到精通 开篇及索引
- 常用 Git 命令
- SQLServer学习笔记系列11
- python之选课系统详解[功能未完善]
- hdoj 5124lines
- struts2 xml中重定向
- C语言-sizeof()与strlen()的区别【转】
- solr中通过SFTP访问文件建立索引
- (转载)用SQL语句创建Access表
- redis 本机链接服务端命令
- uploadify3.1 参数 中文详解
- 实战ajax
- 虚拟机安装中文Fedora14和C/C++IDE开发环境
- 利用python 实现微信公众号群发图片与文本消息功能
- [转载] 应用于负载均衡的一致性哈希及java实现
- 【Tools】linux更改分辨率,解决虚拟机安装后太小的问题
- Java中的return关键字
- VS2017开发.net core 时默认发布路径文件夹多个BPC
- 2018-2019-2 20175126谢文航 实验一《Java开发环境的熟悉》实验报告
- Salesforce Sales Cloud 零基础学习(一) Product 和 Price Book
热门文章
- 程序员Meme 第02期
- Nginx结构原理全解析
- 攻击科普:ARP攻击
- Python matplotlib绘制圆环图
- windows10 安装 Mysql8.0
- HMS Core版本发布公告
- AT2287 [ARC067B] Walk and Teleport 题解
- Jaeger知识点补充
- TensorFlow.NET机器学习入门【2】线性回归
- Java 常用类库一,main方法传参String[] args;获取输入Scanner ;hasNext();hasNextInt()