内容纲要

1. 使用 18.04 server vmware 镜像的网卡问题

需要修改网卡通过 dhcp 获取。

osboxes@osboxes:/etc/netplan$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:23:70:ab brd ff:ff:ff:ff:ff:ff
    inet 192.168.150.131/24 brd 192.168.150.255 scope global dynamic ens33
       valid_lft 1544sec preferred_lft 1544sec
    inet6 fe80::20c:29ff:fe23:70ab/64 scope link 
       valid_lft forever preferred_lft forever

获取所有网卡, 上网网卡为 ens33

osboxes@osboxes:/etc/netplan$ ls
50-cloud-init.yaml
osboxes@osboxes:/etc/netplan$ sudo vim 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            dhcp4: true
    version: 2
osboxes@osboxes:/etc/netplan$ sudo netplan apply

2. 启用 openssh-server 的问题

systemctl status ssh

报错,重新生成 ssh 配置

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

3. 修改 hostname

sudo hostnamectl set-hostname ubuntu-node1
sudo vim /etc/hosts

添加

127.0.0.1 ubuntu-node1
sudo vim /etc/security/limits.conf

添加

* soft nofile 65536
* hard nofile 65536
root soft nofile 65536
root hard nofile 65536
sudo vim /etc/sysctl.conf

添加

fs.file-max = 500000
sudo sysctl -p

重启

发表评论

电子邮件地址不会被公开。 必填项已用*标注