Skip to content

Commit

Permalink
8GB VM, 1024MB for Glassfish, explain StatefulSets IQSS#4617 IQSS#4040
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Apr 30, 2018
1 parent ae115fd commit 1324e39
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conf/openshift/openshift.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"protocol": "TCP"
}
],
"resources": {"limits": {"memory": "3072Mi"
"resources": {"limits": {"memory": "1024Mi"
}

},
Expand Down
17 changes: 16 additions & 1 deletion doc/sphinx-guides/source/developers/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ At this point, you might want to consider going through the Minishift quickstart
Start Minishift
~~~~~~~~~~~~~~~

``minishift start --vm-driver=virtualbox --memory=4GB``
``minishift start --vm-driver=virtualbox --memory=8GB``

Make the OpenShift Client Binary (oc) Executable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -150,6 +150,21 @@ If you are interested in changing the OpenShift config file for Dataverse at ``c

The slower way to iterate on the ``openshift.json`` file is to delete the project and re-create it.

Scaling Dataverse by Increasing Replicas in a StatefulSet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Glassfish and PostgreSQL Pods are in a "StatefulSet" which is a concept from OpenShift and Kubernetes that you can read about at https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/

As of this writing, the ``openshift.json`` file has a single "replica" for each of these two stateful sets. It's possible to increase the number of replicas from 1 to 3, for example, with this command:

``oc scale statefulset/dataverse-glassfish --replicas=3``

The command above should result in two additional Glassfish pods being spun up. The name of the pods is significant and there is special logic in the "zeroth" pod ("dataverse-glassfish-0" and "dataverse-postgresql-0"). For example, only "dataverse-glassfish-0" makes itself the dedicated timer server as explained in :doc:`/admin/timers` section of the Admin Guide. "dataverse-glassfish-1" and other higher number pods will not be configured as a timer server.

Once you have multiple Glassfish servers you may notice bugs that will require additional configuration to fix. One such bug has to do with Dataverse logos which are stored at ``/usr/local/glassfish4/glassfish/domains/domain1/docroot/logos`` on each of the Glassfish servers. This means that the logo will look fine when you just uploaded it because you're on the server with the logo on the local file system but when you visit that dataverse in the future and you're on a differernt Glassfish server, you will see a broken image. (You can find some discussion of this logo bug at https://github.com/IQSS/dataverse-aws/issues/10 and http://irclog.iq.harvard.edu/dataverse/2016-10-21 .) This is all "advanced" installation territory (see the :doc:`/installation/advanced` section of the Installation Guide) and OpenShift might be a good environment in which to work on some of these bugs.

Multiple PostgreSQL servers are possible within the OpenShift environment as well and have been set up with some amount of replication. "dataverse-postgresql-0" is the master and non-zero pods are the slaves. We have just scratched the surface of this configuration but replication from master to slave seems to we working. Future work could include failover and making Dataverse smarter about utilizing multiple PostgreSQL servers for reads. Right now we assume Dataverse is only being used with a single PostgreSQL server and that it's the master.

Running Containers to Run as Root in Minishift
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/developers/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ From Git Bash, run the following commands:
Start Minishift VM and Run Dataverse
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``minishift start --vm-driver=virtualbox --memory=4GB``
``minishift start --vm-driver=virtualbox --memory=8GB``

``eval $(minishift oc-env)``

Expand Down

0 comments on commit 1324e39

Please sign in to comment.