Running Software Broker using Podman on MacOS (x86)

giri
giri Member, Administrator, Employee Posts: 103 admin
edited October 2022 in PubSub+ Event Broker #1

Here are the steps to get Solace Broker running using rootless podman. We will be using brew to install podman on the host.

a) Update brew

brew update

b) Upgrade brew

brew upgrade

c) Install podman

brew install podman

d) Create and start your podman machine

podman machine init --cpus=2 --disk-size=20 --memory=4096 -v $HOME:$HOME

Mount the $HOME directory of the host on the machine. This will help you copy/move files seamlessly between the host and the podman machine.

e) Start the podman machine

podman machine start

f) Setup storage directory on the podman machine

podman machine ssh

Inside the podman machine:

cd $HOME
mkdir storage-group 
g) Get a PubSub+ Software Event Broker Image

Rootless Podman is supported for PubSub+ software event broker 10.1. Please select a version that is 10.1 or higher.

  1. Go to the Solace PubSub+ Event Broker downloads page.
  2. Scroll to the Docker section, and then select the edition of the software event broker.
  3. Fill in your details, and then click Get The Downloads.

A compressed archive file called solace-pubsub-<edition>-<version>-docker.tar.gz will be downloaded.

After you've obtained the package, load the image to the local Podman registry by running the following command on the host

podman load -i solace-pubsub-<edition>-<version>-docker.tar.gz

An example:

podman load -i solace-pubsub-standard-10.1.1.29-docker.tar.gz

h) Run the container

On the host machine, run the following command from a terminal.

podman run -d -u 0 -p 8080:8080 -p 55554:55555 -p 8008:8008 --shm-size=1g \
--env username_admin_globalaccesslevel=admin \
--env username_admin_password=admin --name=solace \
--net slirp4netns:port_handler=slirp4netns \
--volume /var/home/core/storage-group:/var/lib/solace:Z \
localhost/solace-pubsub-standard:10.1.1.29

NOTE: The --volumeoption makes the broker runtime files available in the $HOME/storage-group directory in the podman machine. Specifying a name solace with the --name parameter will help you manage the podman machine by name instead of id.

If you want to access the debug logs and other broker runtime artifacts, you can access them inside the podman machine by opening an ssh session.

podman machine ssh
tail -f $HOME/storage-group/jail/logs/debug.log

At any point in time, if you want to recreate the setup - you can run the following commands and start the steps afresh.


Shutdown the machine:

podman machine stop


Remove the machine:

podman machine rm podman-machine-default


Run the steps from D, E, F, and H described above.

For more information on rootless containers, refer to the documentation.

Comments

  • dishantlangayan
    dishantlangayan Member, Employee Posts: 3 Solace Employee
    edited March 2023 #2

    @giri - first thanks for these steps. I actually followed these to deploy a Standard PubSub+ on my M2 MacBook. I had to make two additional steps to get it to work, which I got from the Solace docs here:

    (1) Give the container user access to the storage-group directory:

    podman unshare chown 1000:0 -R $HOME/storage-group

    (2) Change your --volume parameter to: --mount type=bind,source=/var/home/core/storage-group,destination=/var/lib/solace,relabel=private,ro=false \

    Without these to the container would not start and logs showed the broker did not have permissions on /var/lib/solace

  • giri
    giri Member, Administrator, Employee Posts: 103 admin
    edited March 2023 #3

    @dishantlangayan Thanks for sharing this. The step that you mentioned is very much necessary if the container is started as a non-root user. I created these steps for Max x86, unless something is different in M2, not sure. Will check it again for the x86 (don't have M2).