Configure Containerized Mid Server on Linux (MAC)
ServiceNow is growing with #LightningSpeed. ServiceNow introduced the concept of containers & docker in Rome release.
Today we’ll learn how to install Mid-Server using containers on Linux(Mac)…There were many challenges to install the Mid-Server seamlessly on Linux host unlike seamless installation of Mid-Server on Windows.
I’m writing this blog keeping in mind that you know how Mid-Server works and for those who does not know Mid-Server concept I suggest them to go through the docs.
How does a MID Server work with ServiceNow?
The MID Server runs as a Windows service or UNIX daemon within your organization’s network (behind the firewall) and is completely controlled by your organization with local configuration files. It initiates communications with the ServiceNow instance via the MID Server External Communication Channel (ECC) Queue, so long story short, its ServiceNow instance extension into enterprise network.
What are Containers?
- Package application with all necessary dependencies and configuration
- Portable artifact, easily shared and moved around
- Layers of the images
Containers are standardized unit of software that allows developers to isolate their app from its environment.
Now you may get confused between the containers and images…
Ahem… Images or Docker images are the movable artifacts and when it’s installed or leveraged on Host machine then it becomes container.
What is Docker ?
Let’s keep it simple, CLI-based workflow which makes building, sharing, and running containerized applications accessible to developers.
Containerized Mid-Server uses a Docker image of the Mid-Server that allows you to quickly deploy MID Servers at scale. The steps that are specified on the ServiceNow doc site explains how to build the docker image of Mid Server and but not how to deploy it from Docker hub.
Visit Dockers Hub to check what all Mid-Server docker images are available or not? So, when you search for Mid server in docker hub you’ll get multiple options but let me help you to save your some energy because learning docker concept for sure will consume your energy…
I’ve found stable image by Moers, thanks to him for making our lives bit easier…
But to leverage the Mid-Server docker image, you must know basic docker commands below are some for your ref.
- docker pull → Load the images from Docker Hub
docker pull moers/mid-server
2. docker run → Performs 2 commands i.e., pull, first loads the image from docker and then run the image
1. docker run moers/mid-server:latest 2. docker run -d moers/mid-server:latest --> detach mode
3. docker stop → Stops the container
docker stop <- - container id - ->
4. docker start → Starts/restarts the container
docker start <- - container id - ->
5. docker ps → Gives information of current active containers
docker ps
6. docker logs < container id > → Logs about specific container…
docker logs <- - container id - ->
7. docker ps -a → Details of all the active and inactive containers
docker ps -a
Once you pull the image from the docker hub then you need to run the image and need to pass the environment variables which are nothing but the parameters that are required for the Mid-Server to be deployed… thats enough?
No, lets learn the proper command for running the container and connecting the Mid- Server to instance.
_docker run -d --name Aashishmid _ _--env SNHOSTNAME=devs.atrey.pro _ _--env USERNAME=midUser _ _--env PASSWORD=pwd _ moers/mid-server:sandiego.latest
You’ve already seen some part of above command but this command have some more lines like name, env, d etc. Don’t need to scratch your head…Let me impart this imperative information.
--name → its the name of the container
- d → Run container in detach mode
--env SN_HOST_NAME → Specify ServiceNow instance which to be connected.
--env USER_NAME → Mid server user user_id
--env PASSWORD → Mid server use_r **_password**
By this time you’ve already run the command and your container has started running and you can verify by docker ps command. Attached snippet for ref.
Let’s look at the Mid-Server record created in ServiceNow instance.
Information you need to verify like Hostname that holds the container id, Host OS holds a Docker container host.
So far we have learnt how to configure the Mid-Server for Linux(Mac), before the docker container it was challenging to install Mid-Server but docker has made it seamless…
Hurray!! we have learnt to deploy the containerized Mid-Server on Linux(Mac) from docker hub image. Hope you liked the information. Stay tuned for full blog their we’ll learn to build our own Mid-Server docker images for Windows and Linux recipes.
https://medium.com/@aashishatrey/configure-containerized-mid-server-on-linux-mac-9f43f07e52e