[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Manual mount is possible but not with OpenShift: unable to mount + timeout



Hi Lorenz,

Have you run the setsebool command on both nodes? Missing this would explain beeing able to mount the NFS share on node but not for the containers.


[]s, Fernando Lozano

I've an OpenShift cluster with one master and two nodes. I've installed NFS on the master and NFS client on the nodes.
I've followed the wordpress example with NFS: https://github.com/openshift/origin/tree/master/examples/wordpress

I did the following on my master as: oc login -u system:admin:
mkdir /home/data/pv0001
mkdir /home/data/pv0002

chown -R nfsnobody:nfsnobody /home/data

chmod -R 777 /home/data/

# Add to /etc/exports
/home/data/pv0001 *(rw,sync,no_root_squash)
/home/data/pv0002 *(rw,sync,no_root_squash)

# Enable the new exports without bouncing the NFS service
exportfs -a

So exportfs shows: 
/home/data/pv0001
		<world>
/home/data/pv0002
		<world>

$ setsebool -P virt_use_nfs 1


# Create the persistent volumes for NFS.
# I did not change anything in the yaml-files
$ oc create -f examples/wordpress/nfs/pv-1.yaml
$ oc create -f examples/wordpress/nfs/pv-2.yaml
$ oc get pv

NAME      LABELS    CAPACITY     ACCESSMODES   STATUS      CLAIM     REASON
pv0001    <none>    1073741824   RWO,RWX       Available             
pv0002    <none>    5368709120   RWO           Available    

This is also what I get.
Than I'm going to my node:
oc login
test-admin

And I create a wordpress project:
oc new-project wordpress

# Create claims for storage in my project (same namespace).
# The claims in this example carefully match the volumes created above.
$ oc create -f examples/wordpress/pvc-wp.yaml 
$ oc create -f examples/wordpress/pvc-mysql.yaml
$ oc get pvc

NAME          LABELS    STATUS    VOLUME
claim-mysql   map[]     Bound     pv0002
claim-wp      map[]     Bound     pv0001

This looks exactly the same for me.

Launch the MySQL pod.
oc create -f examples/wordpress/pod-mysql.yaml
oc create -f examples/wordpress/service-mysql.yaml
oc create -f examples/wordpress/pod-wordpress.yaml
oc create -f examples/wordpress/service-wp.yaml

oc get svc
NAME            LABELS                                    SELECTOR         IP(S)            PORT(S)
mysql           name=mysql                                name=mysql       172.30.115.137   3306/TCP
wpfrontend      name=wpfrontend                           name=wordpress   172.30.170.55    5055/TCP

So actually everyting seemed to work! But when I'm asking for my pod status I get the following:
[root ip-10-0-0-104 pv0002]# oc get pod
NAME        READY     STATUS                                                              RESTARTS   AGE
mysql       0/1       Image: openshift/mysql-55-centos7 is ready, container is creating   0          6h
wordpress   0/1       Image: wordpress is not ready on the node                           0          6h

The pods are in pending state and in the webconsole they're giving the following error:
12:12:51 PM mysql Unable to mount volumes for pod "mysql_wordpress": exit status 32 (607 times in the last hour, 41 minutes)
12:12:51 PM mysql Error syncing pod, skipping: exit status 32 (607 times in the last hour, 41 minutes)
12:12:48 PM wordpress Unable to mount volumes for pod "wordpress_wordpress": exit status 32 (604 times in the last hour, 40 minutes)
12:12:48 PM wordpress Error syncing pod, skipping: exit status 32 (604 times in the last hour, 40 minutes)

          Unable to mount +timeout. But when I'm going to my node and
          I'm doing the following (test is a created directory on my
          node):
mount -t nfs -v masterhostname:/home/data/pv0002 /test
And I place some file in my /test on my node than it appears in my /home/data/pv0002 on my master so that seems to work.
What's the reason that it's unable to mount in OpenShift?
I've been stuck on this for a while.


_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]