`
sillycat
  • 浏览: 2539371 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Systemctl 2019 on Ubuntu19.04

 
阅读更多
Systemctl 2019 on Ubuntu19.04

Go to the network directory
>cd /etc/netplan

>sudo vi 50-cloud-init.yaml
> cat /etc/netplan/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:
        enp0s3:
            dhcp4: true
        enp0s8:
            dhcp4: no
            addresses: [192.168.56.104/24]
            gateway4: 192.168.56.0
            nameservers:
                    addresses: [8.8.8.8, 8.8.4.4]
    version: 2

>sudo netplan apply

Check Network
> ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fec7:ba2  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:c7:0b:a2  txqueuelen 1000  (Ethernet)
        RX packets 28  bytes 6966 (6.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 39  bytes 4677 (4.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.104  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::a00:27ff:febc:6cd8  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:bc:6c:d8  txqueuelen 1000  (Ethernet)
        RX packets 109  bytes 13904 (13.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 79  bytes 11730 (11.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 88  bytes 6700 (6.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88  bytes 6700 (6.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Some Basic Commands
Check the status of system
> systemctl status

List all the units
> systemctl list-units

Check the failed units
> systemctl --failed

The files is under
/usr/lib/systemd/system
/etc/systemd/system

Check all the services
> systemctl list-unit-files

Install the service on newly machine
>sudo apt-get install keepalived

Check version
>keepalived -version
Keepalived v2.0.10 (11/12,2018)
Copyright(C) 2001-2018 Alexandre Cassen, <acassen@gmail.com>
Built with kernel headers for Linux 4.19.5
Running on Linux 5.0.0-20-generic #21-Ubuntu SMP Mon Jun 24 09:32:09 UTC 2019

Check the Service
> systemctl list-unit-files | grep keepalived
keepalived.service                     enabled

On my ubuntu-master, when I checked
> systemctl list-unit-files | grep keepalived
snap-keepalived-448.mount              enabled       
keepalived.service                     masked        
snap.keepalived.daemon.service         enabled

> systemctl list-unit-files | grep keepalived
snap-keepalived-448.mount                  enabled       
keepalived.service                         masked        
snap.keepalived.daemon.service             enabled

Check the status on the second machine
> ps -ef | grep keepalived
root       940     1  0 20:10 ?        00:00:00 /snap/keepalived/448/usr/sbin/keepalived-500
root       941   940  0 20:10 ?        00:00:00 /snap/keepalived/448/usr/sbin/keepalived-500

Disable others
> systemctl disable snap-keepalived-448.mount
> systemctl disable snap.keepalived.daemon.service

Unmask my service
> sudo systemctl unmask keepalived.service

Enable the service
> systemctl enable keepalived.service

Reinstall the keepalived, it is active now
> sudo apt-get install keepalived

> systemctl list-unit-files | grep keepalived
snap-keepalived-448.mount                  disabled      
keepalived.service                         enabled       
snap.keepalived.daemon.service             disabled


References:
https://www.cnblogs.com/lxjshuju/p/7183689.html
http://www.jinbuguo.com/systemd/systemctl.html
https://chubuntu.com/questions/11949/why-are-some-systemd-services-in-the-masked-state.html
http://www.kbase101.com/question/15548.html

分享到:
评论

相关推荐

    VMware12安装Ubuntu19.04桌面版(安装教程)

    Ubuntu 19.04是该系列操作系统的一个版本,代号为Disco Dingo。 在虚拟机软件VMware12上安装Ubuntu19.04桌面版,可以提供一个学习和使用Linux桌面环境的平台。在进行安装之前,需要准备好VMware软件和Ubuntu19.04的...

    Ubuntu19.04安装指南-附件资源

    Ubuntu19.04安装指南-附件资源

    硬盘安装Ubuntu8.04需要的文件打包下载

    标题中的“硬盘安装Ubuntu8.04需要的文件打包下载”指的是通过硬盘媒介来安装Ubuntu 8.04操作系统的方法,这种方法适用于没有光驱或者网络连接的计算机。在这个过程中,你需要下载一系列关键文件来创建一个可以引导...

    mysql-server_5.7.27-1ubuntu18.04_amd64.deb-bundle.tar

    Mysql数据库Ubuntu18.04离线安装版

    ubuntu离线安装包ssh-server.zip

    Ubuntu20.04离线安装openssh-server 安装步骤: sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.7_amd64.deb sudo dpkg -i openssh-client_8.4p1-6ubuntu1_amd64.deb sudo dpkg -i openssh-sftp-server_8.4p1-6ubuntu1_...

    mysql-server_5.7.28-1ubuntu18.04_amd64.deb-bundle.tar

    mysql-server_5.7.28-1ubuntu18.04_amd64.deb-bundle.tarmysql-server_5.7.28-1ubuntu18.04_amd64.deb-bundle.tarmysql-server_5.7.28-1ubuntu18.04_amd64.deb-bundle.tarmysql-server_5.7.28-1ubuntu18.04_amd64....

    ubuntu18.04和centos7.8离线安装telnet.zip

    ubuntu18.04和centos7.8离线安装telnet服务端程序.,解除依赖问题

    MLNX_OFED_LINUX-4.2-1.2.0.0-rhel6.9-x86_64.iso

    之前在Mellanox的官网下载redhat6.9的网卡驱动能够成功安装配置ib网,但是现在重新下载6.9和7.4的网卡驱动发现都没能成功配置,在这将这两个资源发布出来希望能够帮助到有需要的人!!!!7.4驱动下载链接: 安装...

    Ubuntu_gnome-terminal_gi.zip

    描述中提到"参照文章说明操作,Ubuntu19.04 gi文件",这意味着在解压和使用这些文件之前,应该有一篇指南或者教程,指导用户如何在Ubuntu 19.04这个特定版本上正确操作GI接口的文件。GI库通常用于为Python提供对GTK+...

    Synergy 1.10.2 linux_Ubuntu版[文件格式Deb,直接安装] 2019年6月最新版.rar

    标题中的“Synergy 1.10.2 linux_Ubuntu版[文件格式Deb,直接安装] 2019年6月最新版.rar”指的是一个名为Synergy的软件的Linux Ubuntu版本,该版本是2019年6月发布的最新版。Synergy是一款非常实用的跨平台工具,它...

    Ubuntu 所有版本名称以及特性介绍.pdf

    Ubuntu 19.04 Disco Dingo 基于 5.0 内核,glibc 2.29,OpenJDK 11,boost 1.67,rustc 1.31,更新 GCC 8.3,optional GCC 9,Python 3.7.3 as default,ruby 2.5.5,php 7.2.15,perl 5.28.1,golang 1.10.4。...

    scrt-8.7.2-2214.ubuntu19-64.x86_64.deb

    securecrt最新的版本v8.7.2,适用于Ubuntu19.04.官方下载。 MD5: 95C4DB01C5CBC0224EB9B535FDABD45B

    Ubuntu虚拟机配置

    ​ 开始的时候,我们先打开虚拟机,导入Ubuntu19.04的镜像,这里是基本操作,就不多说了,但是需要注意的一点是:VMware一定要将网络配置成网桥模式,要是实在上不去网,再配置成NAT模式。 ​ Vbox直接配置两个网络...

    scrt-sfx-8.7.2-2214.ubuntu19-64.x86_64.deb

    securecrt和securesfx合集,最新的版本v8.7.2,适用于Ubuntu19.04.官方下载。 MD5: 9144C17F6590EF50C0C047FF62EA065A

Global site tag (gtag.js) - Google Analytics