This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
spdocker/source/server/runoc.md

90 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2018-03-11 04:09:56 +00:00
---
title: Operations Center
2018-03-14 06:34:06 +00:00
header-img: img/header_img/oc.jpg
2018-03-11 04:09:56 +00:00
date: 2018-03-07 09:50:12
2018-03-14 06:34:06 +00:00
description: Operations Centre in a Docker Container
2018-03-11 04:09:56 +00:00
related:
- { page: "index", title: "Containerising SP" }
---
> **NOTES**
2018-03-14 06:34:06 +00:00
> * Operations Centre is a good fit for a container - especially in a cluster (EG: Swarm), it requires no persistent storage (other than the initial config).
2018-03-11 04:09:56 +00:00
> * Make sure your host has sufficient memory to perform the build - OC requires at least 4GB of RAM to pass the installation logic.
2018-03-14 06:34:06 +00:00
> * The accompanying files for this build are available in my [gitlab](http://dev.leenooks.net/deon/spdocker/tree/oc)
> * And lastly, most importantly, running SP in a container is **not officially supported by IBM** - so you cannot make a help-desk call about having problems.
2018-03-11 04:09:56 +00:00
Technically it should work without problems, but if you are experiencing a problem, be prepared to recreate your environment on a physical host and validate that your problem still exists (and thus not a result of Docker or the implementation on Docker).
2018-03-14 06:34:06 +00:00
The process for Containerising OC is very similar to [Containerising Spectrum Protect](index.html).
2018-03-11 04:09:56 +00:00
## Create your Dockerfile
2018-03-14 06:34:06 +00:00
As at the time of writing these instructions, Red Hat Linux is not available in the Docker hub - but CentOS is a good clone. We'll use it
2018-03-11 04:09:56 +00:00
### Image preparation
```Dockerfile
FROM centos:7
```
2019-05-06 05:00:01 +00:00
Operations Centre doesn't really need any dependencies - you can check the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.7/srv.install/c_oc_inst_reqs_os.html) for any updates. However, to pass the installation logic, we do need to have a redhat-release RPM installed. For CentOS it doesn't exist (CentOS calls it centos-release), so I created one.
2018-03-11 04:09:56 +00:00
```Dockerfile
RUN yum -y install http://yum.leenooks.net/CentOS/7/base/redhat-release-7-6.el7.centos.12.2.x86_64.rpm \
libaio \
ksh \
compat-libstdc++-33 \
numactl && \
yum clean all && rm -rf /var/tmp/*
```
2018-03-14 06:34:06 +00:00
<small>**NOTE**: During the installation of SP, it tests to make sure it is running on RedHat Linux by testing the existence of an RPM package `redhat-release`. The redhat-release installed on line 1 is a fake RPM package - it installs no files, but just emulates the existence of that required RPM package.</small>
2018-03-11 04:09:56 +00:00
### Operations Centre Installation
2019-05-06 05:00:01 +00:00
Now copy in our silent install configuration files. These files are based on the silent install XML files that come on the installation media. Some details on these files are also in the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.7/srv.install/t_srv_inst_silently-linux.html)
2018-03-11 04:09:56 +00:00
```Dockerfile
COPY install.xml install-fp.xml /tmp/
```
<small>**NOTE**: We only include the silent install configuration files here - not the installation media, otherwise the size of the resulting Docker image is too big. Current versions of `docker build` do provide the ability to "flatten" the resulting container, but those instructions are outside the scope of this tutorial.</small>
Next, is performing a silent installation of SP.
```Dockerfile
RUN SOURCE_URL=http://YOUR_SITE_URL_HERE && \
2019-05-06 05:00:01 +00:00
mkdir -p /tmp/build && cd /tmp/build && \
curl -SL ${SOURCE_URL}/8.1.7.000-IBM-SPSRV-Linuxx86_64.bin > tsm && chmod +x tsm && ./tsm && rm -f tsm && \
./install.sh -s -input /tmp/install-oc.xml -acceptLicense && \
rm -rf /tmp/build /tmp/install*xml
2018-03-11 04:09:56 +00:00
```
2019-07-01 07:27:14 +00:00
> **NOTE**: Some information on what is occurring here.
> * To avoid the resulting Docker Image being too large, we download the installation media from a web server (Line 3) and then delete it after it has been expanded.
> * Line 4 is the silent installation method for installing SP components.
> * Line 5 deletes any installation files to reduce the size of the resulting Docker Image.
2018-03-11 04:09:56 +00:00
And our final Docker Image settings for when our container starts.
```Dockerfile
COPY init /sbin/
# Our final docker parameters
EXPOSE 11443
ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ]
```
A complete Dockerfile is available [here](http://dev.leenooks.net/deon/spdocker/blob/oc/Dockerfile) if you need one as a starting point. Once you have your images loaded on a web server, and the supporting build files run `docker build -t ibm/spectrumprotect-oc:8.1.x .`
2019-05-06 05:00:01 +00:00
If your final build is success, you should see a Docker Image that is about 1GB.
2018-03-11 04:09:56 +00:00
```plain
REPOSITORY TAG IMAGE ID CREATED SIZE
2019-05-06 05:00:01 +00:00
ibm/spectrumprotect-oc 8.1.7 cf10a5a9a401 1 minutes ago 1.03GB
2018-03-11 04:09:56 +00:00
```
Now that your container is built, starting OC is simple
2019-05-06 05:00:01 +00:00
`docker run --detach=true --interactive=false --link=spectrumprotect -v <HOST_PATH>/serverConnection.properties:/opt/tivoli/tsm/ui/Liberty/usr/servers/guiServer/serverConnection.properties --memory=1g -p 11443:11443 --privileged=false --rm=false --restart=no --tty=false --name=spectrumprotectoc ibm/spectrumprotect-oc:8.1.7`
2018-03-11 04:09:56 +00:00
2019-07-01 07:27:14 +00:00
> **NOTES**:
> * The OC container needs to connect to your SP server(s). If your SP server is running in a container, you can use the `--link=` to link to the container name of your server (not necessarily required). If you are running your container in a cluster (EG: Docker Swarm), then you'll need to use the appropriate configuration for your cluster to do container-to-container networking.
> * The `-v <HOST_PATH>/serverConnection.properties:../serverConnection.properties` will saving you having to do a "setup" of OC if the container is ever stopped and destroy (this will happen in cluster environments). Make sure the file reference in the `-v` option is available on your cluster persistent storage.