• k8s-基础环境配置(六)


    hostname配置
    1)修改主机名
    hostnamectl set-hostname xxx
    2)加入主机映射
    vim /etc/hosts
    ……
    关闭selinux
    sed -i '/^SELINUX/s/=.*/=disabled/' /etc/selinux/config
    setenforce 0
    修改Linux最大打开文件数
    vim /etc/security/limits.conf
    * soft nofile 65536
    * hard nofile 65536
    关闭防火墙
    systemctl disable firewalld.service
    systemctl stop firewalld.service
    systemctl status firewalld.service
    初始化服务器
    groupadd -g 6000 apps
    useradd -s /bin/sh -g apps -d /home/app app
    passwd app
    yum -y install gcc gcc-c++ make autoconfig openssl-devel supervisor gmp-devel mpfr-devel libmpc-devel libaio numactl autoconf automake libtool libffi-dev
    2)配置sudo
    vim /etc/sudoers.d/app
    app ALL=(ALL) ALL
    app ALL=(ALL) NOPASSWD: ALL
    Defaults !env_reset
    配置ssh无密登录
    1) app用户下执行
    su app
    ssh-keygen -t rsa
    2)合并id_rsa_pub文件
    在192.168.0.1 app用户下执行
    cat ~/.ssh/id_rsa.pub >> /home/app/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    scp ~/.ssh/authorized_keys app@192.168.0.2:/home/app/.ssh
    输入密码:xxx
    在192.168.0.2 app用户下执行
    cat ~/.ssh/id_rsa.pub >> /home/app/.ssh/authorized_keys
    scp ~/.ssh/authorized_keys app@192.168.0.3:/home/app/.ssh
    输入密码:xxx
    在192.168.0.3 app用户下执行
    cat ~/.ssh/id_rsa.pub >> /home/app/.ssh/authorized_keys
    scp ~/.ssh/authorized_keys app@192.168.0.1:/home/app/.ssh
    scp ~/.ssh/authorized_keys app@192.168.0.2:/home/app/.ssh
    覆盖之前的文件
    输入密码:xxx
    3)测试
    ssh app@192.168.0.1
    ssh app@192.168.0.2
    ssh app@192.168.0.3
    sysctl参数配置
    vim /etc/sysctl.conf
    net.bridge.bridge-nf-call-iptables=1
    net.bridge.bridge-nf-call-ip6tables=1
    net.ipv4.ip_forward=1
    net.ipv4.tcp_tw_recycle=0
    vm.swappiness=0
    vm.overcommit_memory=1
    vm.panic_on_oom=0
    fs.inotify.max_user_watches=89100
    fs.file-max=52706963
    fs.nr_open=52706963
    net.ipv6.conf.all.disable_ipv6=1
    net.netfilter.nf_conntrack_max=2310720
    #生效
    sysctl –p

  • 相关阅读:
    unittest框架assert断言
    python logging 总结
    好文章推荐 数据库mysql
    python 日志模块 日志格式
    django admin 后台总结(转载)
    xpath解析html标签
    lua 排序table.sort()用法
    lua 随机数 math.random()和math.randomseed()用法
    三种方法获取 lua时间戳
    crontab调用python脚本新思路
  • 原文地址:https://www.cnblogs.com/xinfang520/p/11609016.html
Copyright © 2020-2023  润新知