📜  sidekiq openshift (1)

📅  最后修改于: 2023-12-03 15:20:08.304000             🧑  作者: Mango

Sidekiq on OpenShift

Sidekiq is a popular background job processing framework for Ruby applications. It allows your application to execute time-consuming tasks in the background, which frees up your application to handle other requests.

OpenShift is a cloud computing platform that allows you to quickly deploy and run your applications without having to worry about the underlying infrastructure. In this guide, we will walk you through deploying Sidekiq on OpenShift.

Prerequisites

Before we begin, you will need the following:

  • An OpenShift account
  • A Ruby application that uses Sidekiq
Step 1: Create a new application

To create a new application on OpenShift, log in to your account and navigate to the dashboard. Click on Create Application and follow the prompts to create your new application.

Step 2: Add a Sidekiq cartridge

After your new application has been created, navigate to the Add Cartridges page and search for Sidekiq. Add the cartridge to your application.

Step 3: Configure Sidekiq

Once the Sidekiq cartridge has been added, you will need to configure it. This can be done through the OpenShift web console or the command line interface (CLI).

Web console

To configure Sidekiq through the web console, navigate to the Environment Variables page for your application and add the following variables:

SIDEKIQ_WEB_PASSWORD=<your_sidekiq_password>
REDIS_URL=<your_redis_url>
CLI

To configure Sidekiq through the CLI, run the following commands:

$ rhc env set SIDEKIQ_WEB_PASSWORD=<your_sidekiq_password> -a <your_app_name>
$ rhc env set REDIS_URL=<your_redis_url> -a <your_app_name>
Step 4: Start Sidekiq

To start Sidekiq, run the following command:

$ bundle exec sidekiq
Conclusion

Congratulations! You have successfully deployed Sidekiq on OpenShift. This will allow your application to handle time-consuming tasks in the background, freeing it up to handle other requests.

Remember to configure the Sidekiq password and Redis URL for secure and efficient use.