linux 集群
Last updated on November 22, 2024 pm
🧙 Questions
☄️ Ideas
hostname
修改hostname
执行成功后,建议重新登录用户
sudo hostnamectl set-hostname isxcode
设置hostname配置
sudo vim /etc/sysconfig/network
HOSTNAME=isxcode
修改hosts域名映射
sudo vim /etc/hosts
# 建议注释掉内网ip那一行
# 建议使用内网映射
#172.26.34.192 iZ8vba7fpabuah6hxfi5m1Z iZ8vba7fpabuah6hxfi5m1Z
172.26.34.192 isxcode
集群时区同步
前提
- 关闭防火墙
- 关闭selinux
- 安装ntpd
修改ntpd配置
sudo systemctl start ntpd
sudo systemctl stop ntpd
sudo systemctl enable ntpd
sudo systemctl restart ntpd
sudo ntpq -p
sudo systemctl stop ntpd
sudo vim /etc/ntp.conf
# === sudo vim /etc/ntp.conf ===
restrict 127.0.0.1
restrict ::1
# 注释所有其他的sever,设置内网时区
server 127.127.1.0 iburst
fudge 127.127.1.0 stratum 3
# === sudo vim /etc/ntp.conf ===
sudo systemctl start ntpd
sudo systemctl enable ntpd
# 检查ntpd是否启动 ntpd默认端口号为123
sudo netstat -tunlp | grep 123
ntpq -np
timedatectl status
sudo systemctl status ntpd
手动同步时区
yum install ntp -y
# ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# echo "Asia/Shanghai" > /etc/timezone
# ntpdate -u ntp2.aliyun.com
vim /etc/ntp.conf
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
server ntp2.aliyun.com iburst
server ntp3.aliyun.com iburst
server ntp4.aliyun.com iburst
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
免密认证
ssh
ssh-copy-id root@isxcode.com
🔗 Links
linux 集群
https://ispong.isxcode.com/os/linux/linux 集群/