Bug 1276302 - Cannot Access db on slave-pod after deployment - postgresql-94-rhel7
Cannot Access db on slave-pod after deployment - postgresql-94-rhel7
Status: CLOSED NOTABUG
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ben Parees
DeShuai Ma
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-29 07:49 EDT by wewang
Modified: 2015-10-29 07:52 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-29 07:52:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description wewang 2015-10-29 07:49:59 EDT
Version-Release number of selected component (if applicable):
openshift v3.0.2.903-114-g2849767
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
rhscl/postgresql-94-rhel7        2425b18dbc45

Description of problem:
Cannot Access db on slave-pod after redeployment - postgresql-94-rhel7,and error appears :"psql: could not connect to server: "

How reproducible:
Always

Steps to Reproduce:
1. Create NFS server
2. Create PV in master server
3. Create project
4. oc new-app https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/image/db-templates/postgresql-replica-rhel7.json
persistentvolumeclaim "postgresql-data-claim" created
service "postgresql-master" created
service "postgresql-slave" created
deploymentconfig "postgresql-master" created
deploymentconfig "postgresql-slave" created
# oc get pvc
NAME                    LABELS    STATUS    VOLUME     CAPACITY   ACCESSMODES   AGE
postgresql-data-claim   <none>    Bound     wewangt6   512Mi      RWO           38s


5. Check the pod status
# oc get pods
NAME                        READY     STATUS    RESTARTS   AGE
postgresql-master-1-u8dfa   1/1       Running   0          1m
postgresql-slave-1-wi02l    1/1       Running   2          1m


6. Try to connect postgresql-master service and create some data
[root@dhcp-128-91 v3test]# oc env pod postgresql-master-1-u8dfa --list
# pods postgresql-master-1-u8dfa, container postgresql-master
POSTGRESQL_MASTER_USER=master
POSTGRESQL_MASTER_PASSWORD=Q41d2btJQ5av
POSTGRESQL_USER=user
POSTGRESQL_PASSWORD=xkY0yhX6if18
POSTGRESQL_DATABASE=userdb
POSTGRESQL_ADMIN_PASSWORD=tB4m0yPU8qPo
[root@dhcp-128-91 v3test]# oc rsh postgresql-master-1-u8dfa
bash-4.2$ psql -h postgresql-master-1-u8dfa -d userdb -U user
Password for user user: 
psql (9.4.5)
Type "help" for help.

userdb=> CREATE TABLE tbl (col1 VARCHAR(20), col2 VARCHAR(20));
CREATE TABLE
userdb=> INSERT INTO tbl VALUES ('foo1', 'bar1');
INSERT 0 1
userdb=> SELECT * FROM tbl;
 col1 | col2 
------+------
 foo1 | bar1
(1 row)

userdb=> \q
bash-4.2$ exit
7. Try to connect postgresql-slave service and check data
[root@dhcp-128-91 v3test]# oc rsh postgresql-slave-1-wi02l
bash-4.2$ psql -h postgresql-master-1-u8dfa -d userdb -U user
psql: could not translate host name "postgresql-master-1-u8dfa" to address: Name or service not known

8 .  Using postgresql-master-1-u8dfa pod's IP 
# oc rsh postgresql-slave-1-wi02l
bash-4.2$ psql -h 10.1.1.146 -d userdb -U user
Password for user user:


Actual results:
when Login in postgresql-slave , appear errors

Expected results:
login in successfully ,no errors

Note You need to log in before you can comment on or make changes to this bug.