![[RL9] Step by Step 安装 Rocky Linux 9.2 系统](https://oss-emcsprod-public.modb.pro/image/editor/20231024-387674d4-6bf9-4517-bb04-e0c9212ceae4.png)
[RL9] Step by Step 安装 Rocky Linux 9.2 系统


关于 Rocky Linux
前文 《 【PG16】 后 RHEL 7 时代, PG 16 如何在 CentOS 7 上运行 》 说到 PostgreSQL 16 已不再提供 CentOS 7 的 RPM 包,所以 DBA 们是时候该考虑操作系统升级了。
考虑到 CentOS 或者 RHEL 的兼容性和延续性,我们选择了 Rocky Linux 系列,本文将介绍安装 Rocky Linux 的最新版本 v9.2,以及在 Rocky 9 上安装 MariaDB。
来自官方的介绍:
Rocky Linux is an open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux®. It is under intensive development by the community.
Rocky Linux 是一个开源的企业操作系统,旨在与红帽企业 Linux® 100%兼容。社区正在大力发展。
本地 VM 安装 Rocky Linux
这里已经准备好了 VMware 虚拟化软件,本文使用的是 VMware Workstation Player, player 是免费版本,不用担心绿色破解的事情。
系统介质为: Rocky-9.2-x86_64-dvd.iso
从官网下载或者其他镜像网站下载均可,看个人的网速环境。
除了几个互联网大厂提供的镜像站,作者还推荐使用高校提供的镜像站,比如清华大学,中国科大,大连东软,等高校的镜像站。
首先,打开 VMware 软件,选择新建一个vm,

下一步,选择iso文件,选择系统版本,这里由于VMware版本有些陈旧,所以最高只能选择到 CentOS 8 64-bit,

下一步,选择vm安装路径,并设定磁盘大小,这里建议直接给大一点,一步到位给到100G,因为是本地测试环境,还可以省去后面分区的烦恼。

下一步,可以定制 cpu/memory 的大小,这个按需调整,默认是1c1g。
下面,正式开始 Rocky 的安装。
跳过测试介质,直接选择安装 Rocky Linux 9.2.

下一步,选择语言,推荐直接选择英文,初学者可以选择中文。

下一步,选择安装信息,比如时区,选择上海。安装目的地,选择自动分区。

Root账号默认禁用,并禁止从远程访问,为便于学习,可以都开启。

下一步,配置网络信息和主机名,也可以直接使用默认,就是dhcp自动给vm配置ip,不过有个弊端,就是每次重启后,ip都可能发生变化。

下一步,漫长的等待,会进行安装系统必需的包,这里可以看到,Rocky 创建文件系统时,默认选择的 xfs 格式。

好了,安装完成后,系统会自动重启,并弹出登陆界面。

登陆后,弹出欢迎语【欢迎使用 Rocky Linux】。

可以看到 R 标记的炫酷桌面,习惯性打开终端,看下版本信息。

1 | [shawnyan@rocky9 ~]$ cat /etc/os-release |
到此,Rocky 9 已经安装完成,从 CentOS 7 到 Rocky 9,两个大版本的更新,一定会有很多使用上和原理上的差异,之后的时间我们再慢慢探索。
Rocky 9 安装 MariaDB
在 Rocky 9 里, yum 是 dnf 的别名,方便延续使用习惯。通过 yum 命令一键安装 MariaDB。
1 | [shawnyan@rocky9 ~]$ sudo yum install mariadb-server |

安装完成后,通过 systemd 启动 MariaDB。

启动后再次查看状态,可以看到 MairaDB 已成功运行。

通过客户端连接 MairaDB,查看版本信息。
1 | [shawnyan@rocky9 ~]$ sudo mariadb |
到此,在 Rocky 9 上安装、运行 MariaDB 已完成。
结语
本文详细介绍如何在本地安装 Rocky Linux 9.2,并演示安装 MairaDB 数据库。
不过,Rocky 9 上生产环境还有待进一步测试,希望 Rocky 社区保持活跃,不要走 CentOS 的老路。
– / END / –
- Title: [RL9] Step by Step 安装 Rocky Linux 9.2 系统
- Author: ShawnYan
- Created at: 2023-10-24 10:07:36
- Updated at: 2024-06-15 23:00:00
- Link: https://shawnyan.cn/2023/linux/rocky-9.2-install/
- License: This work is licensed under CC BY-NC-SA 4.0.