Prepare resources for nginx reverse proxy servers

by Daniel Pham
Published: Updated:
This entry is part 2 of 2 in the series Nginx reverse proxy multi master

In this article, I will give you some tips for preparing resources for nginx proxy servers. I will outline some of the goals why I prepared such resources.

Recommended server resources

System resources for a medium-sized company, according to my experience. You can adjust according to your company scale.

  • OS: CentOS 7.x 64 bit. The current version is 7.5.
  • RAM: 8 GB or bigger.
  • HDD: 100 GB for OS. Partitions as below:
    • /boot: 500 MB.
    • swap: 8 GB or 16 GB.
    • /: 30 GB.
    • /home: 10 GB.
    • /var/log: 30 GB.
    • /tmp: the rest of the disk.
  • vCPU: 4 or 8 CPU.

Sync nginx configuration between servers

This is the main reason that I have to dedicate an article for resource preparation. And you see, when you have multiple nginx proxy servers and the task of syncing nginx configuration files between servers is something you should be concerned about.

There are many ways to do that, if you use a physical server, you can connect directly to devices like SAN, NAS. Or you can set up a share storage cluster and connect nginx proxy servers to storage via iSCSI.

This is for doing so, so you can write-reads data simultaneously between servers on the same shared drive (shared storage area). As such, the nginx configuration files will be identical, you just need to edit on a server only.

Share disk solution on VMware

VMware virtualization is a solution that many companies nowadays use. This part, I will guide people to map a raw LUN from the SAN to the virtual machine and share that disk with other virtual machines.

Step 1: Create a LUN.

You create a LUN on the SAN (or similar devices) of about 10G (or smaller if you want), export it to the physical hosts that you intend to create virtual machines on.

Step 2: Create the first virtual machine.

Create a virtual machine similar to the image below. There is a step to take in this step: Create a new SCSI Controller, at the SCSI Bus Sharing section, select Physical.

Prepare resources for nginx reverse proxy servers
Create the first virtual machine with new SCSI Controller.

Step 3: Create a new RDM disk.

After you created a new SCSI Controller, you have to create a new RDM Disk. This disk will use to map the LUN that was created at step 1. At New device, choose RDM Disk and click Add.

Prepare resources for nginx reverse proxy servers
Create a new RDM Disk for the first virtual machine.

Step 4: Map RDM Disk to the LUN.

 In the example below, I will map the LUN with ID 0.

Prepare resources for nginx reverse proxy servers
Map RDM Disk to a LUN.

Step 5: Finish settings of the first virtual machine.

Set up the RDM disk as the image below. After that, you can click Finish and install OS for the first virtual machine.

There are two points in this step:

  • Sharing section select Multi-writer.
  • The Virtual Device Node selects the New SCSI Controller (created in step 2) and selects SCSI(1: 0).
Prepare resources for nginx reverse proxy servers
Finish settings of the first virtual machine.

Step 6: Create a second virtual machine that has the same configuration as the first virtual machine.

There are two points to note in the second virtual machine:

  • We also created a SCSI Controller and chose the Physical mode as the first virtual machine.
  • In the second virtual machine, we do not create a new RDM drive that creates an Existing Hard Disk. In the Disk File you find the file .vmdk is stored on the first virtual machine.
Prepare resources for nginx reverse proxy servers
Create second virtual machine.

After that, you can install OS for second virtual machine as the first one. Now, at both virtual machine will see the share disk.

Conclusion

In theory, now both virtual machines can write data to that shared disk. However, read – write data at the same time will be more complex than you think. It can be conflicting data, overlapping files or other problems. Therefore, we will need to install a file system on the shared disk to solve the problem.

This article ends with the completion of two Nginx proxy virtual machines with a shared drive mapped to the LUN on the SAN. In the next article, I will show you how to install the OCFS2 file system so that you can solve the problem of reading – writing data concurrently.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series Navigation«« Previous part: Nginx reverse proxy multi master architecture

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.