导读 在Web浏览器中查看服务器并使用鼠标执行系统任务。很容易管理存储、配置网络和检查日志等操作。RHEL 8 自动安装了 Cockpit,Cockpit 所需的防火墙端口会自动打开, Cockpit 界面可用于将基于策略的解密(PBD)规则应用于受管系统上的磁盘。对于在身份管理(IDM)域中注册的系统,Cockpit 默认使用域的集中管理的 IDM 资源。Cockpit 菜单和页面可以在浏览器上导航,可以从 Cockpit Web 界面创建和管理虚拟机。 现在可以将“虚拟机”页面添加到 Cockpit 界面,该界面使用户可以创建和管理基于 libvirt 的虚拟机。

环境

Red Hat Enterprise Linux release 8.0
VMware Workstation Pro 14

安装cockpit
[root@localhost ~]# yum install -y cockpit
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:17:16 ago on Thu 02 Jan 2020 10:41:30 PM CST.
Package cockpit-185-2.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@localhost ~]# systemctl  enable  --now  cockpit.socket
#启用cockpit,设置开机自启动同时开启服务一条就可以搞定,Cockpit监听9090端口。
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.
[root@localhost ~]# netstat -pantu | grep 9090
tcp6       0      0 :::9090                 :::*                    LISTEN      1/systemd           

[root@localhost ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.21  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::27d9:87a2:dc6c:7296  prefixlen 64  scopeid 0x20
        ether 00:0c:29:a4:94:b4  txqueuelen 1000  (Ethernet)
        RX packets 341  bytes 43366 (42.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 533  bytes 56415 (55.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
访问cockpit

打开物理机的浏览器输入192.168.10.21:9090访问cockpit服务

通过RHEL8本机的Firefox浏览器输入192.168.10.21:9090访问cockpit服务

用你的系统用户登录即可(通过物理机的浏览器登录即远程登录)

可以设置语言

使用cockpit创建逻辑卷

添加硬盘

重启RHEL8

创建逻辑卷

在系统中查看

[root@localhost ~]# lvscan
  ACTIVE            '/dev/vgroup0/lvol0' [<20.00 GiB] inherit
  ACTIVE            '/dev/rhel/swap' [2.00 GiB] inherit
  ACTIVE            '/dev/rhel/root' [<17.00 GiB] inherit
[root@localhost ~]# blkid /dev/vgroup0/lvol0
[root@localhost ~]# mkfs.ext4 /dev/vgroup0/lvol0
mke2fs 1.44.3 (10-July-2018)
Creating filesystem with 5241856 4k blocks and 1310720 inodes
Filesystem UUID: 806020bd-afe3-426a-813f-b203e5149cd0
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

[root@localhost ~]# blkid /dev/vgroup0/lvol0
/dev/vgroup0/lvol0: UUID="806020bd-afe3-426a-813f-b203e5149cd0" TYPE="ext4"
逻辑卷缩容、扩容

缩容

 

[root@localhost ~]# lvscan
  ACTIVE            '/dev/vgroup0/lvol0' [10.81 GiB] inherit
  ACTIVE            '/dev/rhel/swap' [2.00 GiB] inherit
  ACTIVE            '/dev/rhel/root' [<17.00 GiB] inherit

扩容

[root@localhost ~]# lvscan
  ACTIVE            '/dev/vgroup0/lvol0' [<16.27 GiB] inherit
  ACTIVE            '/dev/rhel/swap' [2.00 GiB] inherit
  ACTIVE            '/dev/rhel/root' [<17.00 GiB] inherit

本文原创地址://gulass.cn/rhel8-cockpit-method.html编辑:public,审核员:逄增宝