Posts

Showing posts from March, 2023

How to Create Yum Server and Client

 [root@Apache ~]# mount /dev/sr0 /mnt/ mount: /dev/sr0 is write-protected, mounting read-only [root@Apache ~]# ls /mnt/ CentOS_BuildTag  EFI  EULA  GPL  images  isolinux  LiveOS  Packages  repodata  RPM-GPG-KEY-CentOS-7  RPM-GPG-KEY-CentOS-Testing-7  TRANS.TBL   [root@Apache ~]# vim /etc/yum.repos.d/yum.repo [server] name= server baseurl=file:///mnt gpgcheck=0 enable=1     [root@Apache ~]# yum clean all Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Cleaning repos: server Cleaning up everything Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos Cleaning up list of fastest mirrors   [root@Apache ~]# yum repolist Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-man

How to install postgresql in Docker

# mkdir /postgres_data_dir # chmod 777 /postgres_data_dir # docker run --name postgresql -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=Password@54321 -p 5432:5432 -v /postgres_data_dir:/var/lib/postgresql/data -d postgres # docker ps CONTAINER ID   IMAGE       COMMAND                  CREATED          STATUS          PORTS                                             NAMES c48395e40dc9   postgres    "docker-entrypoint.s…"   24 minutes ago   Up 24 minutes   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp         postgresql Install postgresql client in Base Machine:-  # yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # yum install -y postgresql15 # psql -V psql (PostgreSQL) 15.2 Login in Database:- # psql -h  localhost -U postgres Password for user postgres: xxxxxxxxxxxxxxxx psql (15.2) Type "help" for help. postgres=# CREATE Database:- postgres=# CREATE database testDB; CREATE DATABASE Use Database: