Bludit multi-server

bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

I am new to Bludit.

First I want to say thank you to anyone involved in putting this together. It is truly amazing.

I have been looking for the perfect Flat File CMS to run on my Raspberry Pi cluster. I wanted something that was lean but powerful. Bludit is exactly it.

The hardest thing to figure out for my use case was getting it to work across multiple servers. I have setup scripts on my "dev" server that basically syncs the site to each of the other "nodes". It is working brilliantly. Since the "deploy" scripting actually puts the "dev" node into the load balancing rotation I did have to write another script to go into what I call "admin" mode so I put just the "dev" node into rotation then I can login and make edits. Then I deploy and voila!

If you would like to check it out: https://pilab.dev

I am using my customized version of BLEKATHLON and have started writing plugins. So far I have created one that shows the current node in the footer.

Thanks
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Thank you for sharing. An interesting project!
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

Edi wrote: Mon May 13, 2019 10:56 am Thank you for sharing. An interesting project!
Thanks! I am working on a more sophisticated deploy process to leverage tmpfs and lsyncd.
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

I have re-thought my deployment process. Now I have a setup that uses a different site for the "source of truth" and then the ci/cd process promotes to the nodes from there.

Works really well.

I would love it if bludit somehow had some way to work more natively with a load balanced setup. The main issue I have is with login sessions.
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi,
really nice project, also I saw in the footer of the site which node answer.

What you need for the login is in the load balancer use sticky session and for the storage a simple solution could be NFS to share the files system and a little more complex do a GlusterFS, maybe you can dedicate one node for storage.

Regards
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

diego wrote: Sat May 18, 2019 1:55 pm Hi,
really nice project, also I saw in the footer of the site which node answer.

What you need for the login is in the load balancer use sticky session and for the storage a simple solution could be NFS to share the files system and a little more complex do a GlusterFS, maybe you can dedicate one node for storage.

Regards
Thank you!

I haven't tested the sticky session on my lb yet but I have considered that. I just want to be sure that unauthenticated visitors aren't stuck on the same node.

I am very interested in the setting up a cluster fs. I have not wanted to use a simple NFS since that could be a bottle neck.

This project is a place for me to learn and share so it's a good place to try new things.
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

I have successfully completed an upgrade to Bludit v3.9.0 on Pi Lab.

Check it out.

I have also added a new section to the Stats page that gives real time info for each node.

New Stats Page

I am working on putting together a post that covers how I setup the cluster for those interested.
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

For anyone interested I have posted an article that covers how I setup Bludit to run on a load balanced Raspberry Pi cluster. I wrote this rather quickly so I will be reviewing and editing, but here it is for those interested.

https://pilab.dev/pi-lab-setup

Thanks
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Thank you very much for sharing!
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
bozodev
Ssr. Bludit
Posts: 23
Joined: Sun May 12, 2019 1:03 am

I have built a few simple plugins for Pi Lab. I am going to make them available via github soon as they might be useful for someone else.

Show Node:
This one allows you to specify the IP and the Node Name that you would like to give to the IP. Then it will display the Node Name based on which IP the request is currently coming from.

Robots:
This is my customized version that allows you to add a port number so that if the site is reached at that port it will deny all on that port.

Site Rediect:
This one allows you to enable temporary site redirection to another URL.

target='_blank':
This one forces all links on pages to open in new tabs.

These are all currently being used on Pi Lab.

They are a bit specific to my needs, but I want to give back what I can. :)

I do have one thing that I can't figure out with the Show Node one. I want the node to show up in the footer. The only way that I could get this to work was by moving

Code: Select all

Theme::plugins('siteBodyEnd');
to where I want it to show up in my theme. I couldn't figure out a way to just call a plugin from anywhere in the theme.

Is there a way to echo text in a theme from a plugin in a specific location? I guess I could add it to the side bar for the one I release since that is a common place to put stuff. Just curious if there is a way to target the footer.

Thanks in advance
Checkout Pi Lab (Powered by Bludit PRO & Raspberry Pi) - Bludit Backer
Post Reply