Tuesday, August 31, 2021

.::: How To Install Database Redis on Centos 7 :::.



1. Enable repository

[root@teguhth data]# yum -y install epel-release yum-utils
[root@teguhth data]# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@teguhth data]# yum-config-manager --enable remi
[root@teguhth data]# 

Thursday, August 5, 2021

.:: How To Replicate Set (Redundant /Mirroring) MongoDB 5.0 on Centos 7 :::.


A. Configuring the Replica Set
1. Setting up the environment Add /etc/host to nodeA nodeB 

[root@teguhth01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.21 teguhth01 NodeA
10.10.10.22 teguhth02 NodeB
[root@teguhth01 ~]# 

[root@teguhth02 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.21 teguhth01 NodeA
10.10.10.22 teguhth02 NodeB
[root@teguhth02 ~]# 

.::: Install MongoDB 5.x on Centos/Redhat 7 using repository :::.

 
1. Create repo the /etc/yum.repos.d/mongodb-org-5.0.repo file for MongoDB.

[root@teguhth02 ~]# cat /etc/yum.repos.d/mongodb-org-5.0.repo
[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
[root@teguhth02 ~]# 

Monday, August 2, 2021

.::: Change Standby Slave Database to Master/Normal on PostgreSQL ERROR: cannot execute CREATE DATABASE in a read-only transaction :::.


A. Change Database Standby/Slave to Normal /Master

1. test create database for test write
teguhth=# create database tka;
ERROR:  cannot execute CREATE DATABASE in a read-only transaction
teguhth=# 

2. Promote Standby/Slave

/usr/pgsql-13/bin/pg_ctl promote -D /var/lib/pgsql/13/data

[root@teguhth02 ~]# su - postgres
Last login: Sun Aug  1 15:14:46 WIB 2021 on pts/0
-bash-4.2$ /usr/pgsql-13/bin/pg_ctl promote -D /var/lib/pgsql/13/data
waiting for server to promote.... done
server promoted
-bash-4.2$

.::: How to Setting Streaming replication Redundant / Mirroring (Master Slave) postgreSQL 13 on Centos 7 :::.

 
A. 

B. Setting di Master Node
1. Create user replication

su - postgres

CREATE USER replicate REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD 'admin'

[root@teguhth01 13]# su - postgresq;
su: user postgresq does not exist
[root@teguhth01 13]# su - postgres
Last login: Sun Aug  1 13:38:09 WIB 2021 on pts/0
-bash-4.2$ 
-bash-4.2$ 
-bash-4.2$ psql
psql (13.3)
Type "help" for help.

Popular Posts