Merge pull request #28786 from geekpi/translating

translated
This commit is contained in:
geekpi 2023-03-06 08:47:57 +08:00 committed by GitHub
commit 145b0e87c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 195 additions and 159 deletions

View File

@ -1,159 +0,0 @@
[#]: subject: "How to Install PgAdmin4 on RHEL 9 Step by Step"
[#]: via: "https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/"
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install PgAdmin4 on RHEL 9 Step by Step
======
Pgadmin4is a free and opensource web-based administration and development platform for PostgreSQL. It interacts with PostgreSQL database server on both local and remote servers and displays server statistics using intuitive and interactive dashboards.
Pgadmin4 is a rewrite of Pgadmin 3 and provides the following notable features:
- A responsive web UI with intutive and real-time monitoring dashboards
- An improved web interface with cool and new panels and icons.
- An SQL query editor with syntax highlighting.
- Extensive documentation.
- Useful tips to help you get started.
In this guide, we will demonstrate how to install Pgadmin4 on RHEL 9.
##### Prerequisites
Before you begin, ensure that you have a RHEL 9 server instance with PostgreSQL database server installed. Check out guide on how to install PostgreSQL 15 on RHEL 9.
With PostgreSQL server installed, carry on with the following steps.
### Step 1) Add Pgadmin4 Repository on RHEL 9
The first step is to add the Pgadmin4 repository on RHEL 9. But first, install the EPEL repository which provides essential software packages.
```
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
```
Next, install Pgadmin4s repository as follows.
```
$ sudo dnf install -y https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
```
Once done, build a cache for Pgadmin4 and EPEL repositories as follows.
```
$ sudo dnf makecache
```
### Step 2) Install PgAdmin4 on RHEL 9
Once the Pgadmin4 and EPEL repositories are in place, proceed and install Pgadmin4 using the DNF package manager as shown.
```
$ sudo dnf install pgadmin4 -y
```
This installs a myriad of packages including Pgadmin4, Apache HTTP web servers, and Python packages to mention a few.
To confirm that Pgadmin4 has been installed, run the following command:
```
$ rpm -qi pgadmin4
```
This prints out quite some information including the name, version, release, and architecture of the installed package.
### Step 3) Start / Enable PgAdmin4 on RHEL 9
At this point, Pgadmin4 is successfully installed. However, you need to go a step further and get it running. To start the Pgadmin4 service, run the command:
```
$ sudo systemctl start httpd
```
Be sure also to enable the service to start every time the system boots.
```
$ sudo systemctl enable httpd
```
To confirm that Pgadmin4 is running run the command:
```
$ sudo systemctl status httpd
```
### Step 4) Initializing PgAdmin4 on RHEL 9
The Pgadmin4 package provides a configurable script for setting up the pgAdmin web service. This allows you to create a user account which is used to authenticate and configure SELinux policies and Apache web server.
Therefore, run the script as follows.
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
Provide the email and password that you will use as login credentials on the login page.
NOTE:Sometimes, you may encounter a semanage: command not found error as shown in the output below. This indicates that the semanage package is missing.
Semanage, short for SELinux (Security-Enhanced Linux) policy management tool, is a utility used to configure some aspects of SELinux policy without requiring modification to or recompilation from policy sources.
To fix this error, you need to check for the package that provides semanage. You can do this by running the command:
```
$ sudo dnf provides /usr/sbin/semanage
```
From the output, you can see that semanage is provided by the  policycoreutils-python-utils-3.3-6.el9_0.noarch  package.
To install this package, run the following command.
```
$ sudo dnf install policycoreutils-python-utils -y
```
Once again, run the Pgadmn4 installation script as shown.  Provide the email address and password and type y when prompted.
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
### Step 5) Access the Pgadmin4 Web Interface
At this point, Pgadmin4 is successfully installed. To access it from a web browser, head over to the following address:
http://server-ip/pgadmin4
You will get the following login web interface. Be sure to provide the Email and password you provided when running the installation script and click Login.
Once logged in, the Pgadmin4 dashboard will come to view as shown.
To add a server that can be administered by Pgadmin4, click Add New Server
On the General tab fill out the name of the server and add comments for better description.
Next, click Connection and fill out the Hostname/Address , Port , maintenance database , username and password. Then finally click Save.
Thereafter, you will see PosrgreSQL server statistics displayed on interactive and intuitive dashboards. On the left sidebar, you can browse various PostgreSQL parameters.
##### Conclusion
We hope you found this guide informative, kindly do post your queries and feedback in below comments section.
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lkxed/

View File

@ -0,0 +1,195 @@
[#]: subject: "How to Install PgAdmin4 on RHEL 9 Step by Step"
[#]: via: "https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/"
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 RHEL 9 上分步安装 PgAdmin4
======
Pgadmin4 是一个免费和开源的基于网络的 PostgreSQL 管理和开发平台。它与本地和远程服务器上的 PostgreSQL 数据库服务器进行交互,并使用直观和交互式的仪表板显示服务器的统计数据。
Pgadmin4 是对 Pgadmin3 的重写,提供了以下显著的特点:
- 一个具有直观和实时监控仪表盘的响应式 Web UI。
- 一个改进的 Web 界面,具有很酷的新面板和图标。
- 带有语法高亮的 SQL 查询编辑器。
- 全面的文档。
- 帮助你入门的有用提示。
在本指南中,我们将演示如何在 RHEL 9 上安装 Pgadmin4。
##### 先决条件
在开始之前,确保你有一台 RHEL 9 服务器实例并安装了 PostgreSQL 数据库。请查看如何在 RHEL 9 上安装 PostgreSQL 15 的指南。
在安装了 PostgreSQL 服务器后,继续执行以下步骤。
### 步骤 1在 RHEL 9 上添加 Pgadmin4 仓库
第一步是在 RHEL 9 上添加 Pgadmin4 仓库。但首先要安装 EPEL 仓库,它提供了基本的软件包。
```
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
```
接下来,安装 Pgadmin4 仓库,如下所示。
```
$ sudo dnf install -y https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
```
完成后,为 Pgadmin4 和 EPEL 仓库建立一个缓存,如下所示。
```
$ sudo dnf makecache
```
### 步骤 2在 RHEL 9 上安装 PgAdmin4
安装好 Pgadmin4 和 EPEL 仓库后,继续使用 DNF 包管理器安装 Pgadmin4如下所示。
```
$ sudo dnf install pgadmin4 -y
```
这将安装许多软件包,包括 Pgadmin4、Apache HTTP web 服务器和 Python 软件包,仅举几例。
![][1]
要确认 Pgadmin4 是否已经安装,请运行以下命令:
```
$ rpm -qi pgadmin4
```
这将打印出相当多的信息,包括已安装软件包的名称、版本、发行和架构。
![][2]
### 步骤 3) 在 RHEL 9 上启动/启用 PgAdmin4
此时Pgadmin4 已成功安装。然而,你需要更进一步,让它运行起来。要启动 Pgadmin4 服务,请运行以下命令:
```
$ sudo systemctl start httpd
```
还要确保每次系统启动时都能启动该服务。
```
$ sudo systemctl enable httpd
```
要确认 Pgadmin4 正在运行,请执行以下命令:
```
$ sudo systemctl status httpd
```
![][3]
### 步骤 4在 RHEL 9 上初始化 PgAdmin4
Pgadmin4 软件包提供了一个可配置的脚本来设置 pgAdmin 网络服务。这允许你创建一个用户账户,用来验证和配置 SELinux 策略和 Apache Web 服务器。
因此,如下运行该脚本。
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
提供你将在登录页面上作为登录凭证使用的电子邮件和密码。
注意:有时,你可能会遇到如下 “semanage: command not found” 的错误。这表明缺少 semanage 包。
![][4]
Semanage 是 SELinux安全增强型 Linux策略管理工具的简称是一个用于配置 SELinux 策略某些方面的工具,不需要对策略源进行修改或重新编译。
为了解决这个错误,你需要检查提供 semanage 的软件包。你可以通过运行以下命令来完成:
```
$ sudo dnf provides /usr/sbin/semanage
```
从输出中,你可以看到 semanage 是由 policycoreutils-python-utils-3.3-6.el9_0.noarch 包提供的。
![][5]
要安装这个软件包,请运行以下命令。
```
$ sudo dnf install policycoreutils-python-utils -y
```
再一次如下运行 Pgadmn4 安装脚本。 提供电子邮件地址和密码,在提示时输入 “y”。
```
$ sudo /usr/pgadmin4/bin/setup-web.sh
```
![][6]
### 步骤 5) 访问 Pgadmin4 的 Web 界面
此时Pgadmin4 已经成功安装。要从网络浏览器访问它,请前往以下地址:
http://server-ip/pgadmin4
你会看到登录网页界面。请确保提供你在运行安装脚本时提供的 Email 和密码,并点击 “Login”。
![][7]
登录后Pgadmin4的仪表板将出现在视图中如图所示。
![][8]
要添加一个可以由 Pgadmin4 管理的服务器,请点击 “Add New Server”。
![][9]
在 “General” 选项卡中,填写服务器的名称,并添加注释,以便更好地描述。
![][10]
接下来,点击 “Connection”填写主机名/地址、端口、维护数据库、用户名和密码。然后最后点击 “Save”。
![][11]
此后,你会看到 PosrgreSQL 服务器的统计数据显示在互动和直观的仪表板上。在左边的侧边栏,你可以浏览各种 PostgreSQL 参数。
![][12]
##### 总结
我们希望你觉得本指南内容丰富,请在下面的评论部分发表你的疑问和反馈。
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lkxed/
[1]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Install-pgadmin4-rhel9-dnf-command.png
[2]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Pgadmin4-RPM-Package-Information-RHEL9.png
[3]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Start-Enable-Http-Pgadmin-RHEL9.png?ezimgfmt=ng:webp/ngcb22
[4]: https://www.linuxtechi.com/wp-content/uploads/2023/03/semange-not-found-pgadmin4-rhel9.png?ezimgfmt=ng:webp/ngcb22
[5]: https://www.linuxtechi.com/wp-content/uploads/2023/03/DNF-Whatprovides-semanage-RHEL9.png?ezimgfmt=ng:webp/ngcb22
[6]: https://www.linuxtechi.com/wp-content/uploads/2023/03/pgadmin-setup-web-script-rhel9.png?ezimgfmt=ng:webp/ngcb22
[7]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Pgadmin4-Login-Page-RHEL9.png?ezimgfmt=ng:webp/ngcb22
[8]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Dashboard-Pgadmin4-RHEL9.png?ezimgfmt=ng:webp/ngcb22
[9]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Add-New-PostgreSQL-to-Pgadmin4-RHEL9.png?ezimgfmt=ng:webp/ngcb22
[10]: https://www.linuxtechi.com/wp-content/uploads/2023/03/General-Description-Pgadmin-New-PostgreSQL.png?ezimgfmt=ng:webp/ngcb22
[11]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Connection-Details-PostgreSQL-Pgadmin4-GUI.png?ezimgfmt=ng:webp/ngcb22
[12]: https://www.linuxtechi.com/wp-content/uploads/2023/03/PostgreSQL-Statistics-Dashboard-Pgadmin4.png?ezimgfmt=ng:webp/ngcb22