基础环境配置

IP地址设置

  • 修改Ip地址

vi /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"  # 设置为静态ip static
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
NAME="ens33"  # 网卡的名称
DEVICE="ens33" # 设备的名称
ONBOOT="yes"  # 设置为yes, 表示开机启动
IPADDR="192.168.46.150"  # ip地址
PREFIX="24"  # 子网掩码
GATEWAY="192.168.46.2" # 网关
DNS1="114.114.115.115"  # DNS
  • 重启网络服务

systemctl restart network

  • 测试网络

ping www.baidu.com

如果可以ping通公网: 说明 ip地址和网关都配置正确

如果通过 ip addr 不能查看到ip地址, 说明配置有错误

如果可以ping通内网 192.168.46.1 但是不能ping通外网的话, 则说明网关配置有错误

设置主机名

  • 编辑主机名配置文件

vi /etc/hostname

hadoop01

设置域名映射解析

  • 编辑hosts文件

vi /etc/hosts

192.168.46.145 hadoop01 hadoop01
192.168.46.146 hadoop02 hadoop02
192.168.46.147 hadoop03 hadoop03
192.168.46.148 biz01 biz01

关闭防火墙和Selinux

  • 关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
  • 关闭Selinux
vi /etc/selinux/config


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

配置免密登录

  1. 在所有节点生成公钥和私钥

    ssh-keygen -t rsa

    后面直接所有的交互都敲回车 即可

  2. 拷贝公钥到每台服务器

    ssh-copy-id hadoop01

    ssh-copy-id hadoop02

    ssh-copy-id hadoop03

  3. 验证ssh登录

    ssh hadoop01

    exit # 退出ssh登录

配置服务器节点时钟同步

  1. 在所有节点安装ntpdate

    yum install -y ntpdate

  2. 增加定时任务

    crontab -e

    */1 * * * * /usr/sbin/ntpdate -u ntp4.aliyun.com > /dev/null 2>&1

安装常用软件

yum install -y vim
yum install -y net-tools
yum install -y lrzsz
yum install -y rsync
yum install -y wget

相关推荐

  1. 基础环境配置

    2024-05-15 22:44:10       35 阅读
  2. Ceph基本环境配置

    2024-05-15 22:44:10       66 阅读
  3. springboot_3.2_freemark_基础环境配置

    2024-05-15 22:44:10       51 阅读
  4. Rocky Linux 基本环境配置

    2024-05-15 22:44:10       36 阅读
  5. 1.mysql基本概念环境配置

    2024-05-15 22:44:10       25 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-15 22:44:10       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-15 22:44:10       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-15 22:44:10       87 阅读
  4. Python语言-面向对象

    2024-05-15 22:44:10       96 阅读

热门阅读

  1. LabVIEW软件开发工程师需要具备哪些能力与素质?

    2024-05-15 22:44:10       37 阅读
  2. 总结_看门狗项目应用解析

    2024-05-15 22:44:10       29 阅读
  3. Docker 容器连接:构建安全高效的容器化网络生态

    2024-05-15 22:44:10       33 阅读
  4. mysql(二)

    2024-05-15 22:44:10       32 阅读
  5. mysql中exists和in的区别

    2024-05-15 22:44:10       35 阅读
  6. MySQL变量的定义与使用

    2024-05-15 22:44:10       29 阅读
  7. Leecode热题100---128:最长连续数列

    2024-05-15 22:44:10       28 阅读
  8. CSAP_MAT_BOM_MAINTAIN 返回消息处理

    2024-05-15 22:44:10       26 阅读
  9. Spring STOMP-权限

    2024-05-15 22:44:10       31 阅读