# Worker

The Worker service plays a fundamental role in the system. He is responsible for carrying out the actions requested by Console users. Here's an overview of how it works:

**Data Reception:** When a user interacts with the Console and generates actions, the Console packages all the data necessary to execute the action. This data is then sent to the Worker.

**Action Processing:** The Worker captures the data sent by the Console and performs the actions as requested. This may involve calculation processes, access to external resources, or any other task necessary to complete the action.

**Sending Results:** After completing the action, the Worker sends the return data to the Console. This feedback data may include results, status information, or any other relevant information.

**Key Features:**

* **Parallel Processing:** The Worker is capable of handling multiple action requests simultaneously, ensuring efficiency and scalability.
* **Integrity Check:** You can regularly check the integrity of the communication to ensure it is operating correctly. This is indicated in the Console through the "Ping At" column.
* **Activity Tracking:** The Console can monitor the number of actions in progress on the Worker, which is reflected in the "Threads" column.
* **Bidirectional Communication:** Communication between the Console and the Worker is bidirectional, allowing the Console to provide input and receive results.

**Multiple Workers Registration:**

Within the **Linux Control Center**, it is possible to register multiple Workers that can run on different networks or regions.

### Requirements

#### Hardware

For each set of 5 threads it is necessary:

* **2 CPUs**
* **4 GB RAM**

#### Firewall

The following connection must be allowed:

* **Host Worker** -> **Host Console Linux Control Center** on **Porta 443** (HTTPS)

### Configuring the Worker

To get the Worker ID, run the following command:

```bash
/opt/lcc-shell/bin/lcc_worker_show_uuid.sh
```

To activate a Worker:

1. Access the **Linux Control Center** through your browser.
2. In the side menu, go to **Config** and select **Worker**.

   ![Menu Worker](https://gitlab.com/7dev-doc/linux-control-center/-/blob/main/en/worker/images/config/config-menu.png)
3. Click **Actions** and choose **Trust** to authorize the Worker.

   ![Ativando Worker](https://gitlab.com/7dev-doc/linux-control-center/-/blob/main/en/worker/images/worker/workers-actions.png)
4. The *Status* should change from **Pending** to **Accepted**.

   ![Status do Worker](https://gitlab.com/7dev-doc/linux-control-center/-/blob/main/en/worker/images/worker/workers-status.png)

> Once authorized, the **Linux Control Center** console will test communication between itself and the **Worker**.

5. To check the communication status, access the side menu again and select the **Logs** option, then click on **Queue**.

   ![Queues](/files/P1tY8ndBeUiRRaRJ4Gi0)
6. When viewing the Queue select **LOGS** to read the response

   ![Log da ação](https://gitlab.com/7dev-doc/linux-control-center/-/blob/main/en/worker/images/queue/queue-logs.png)

> This log will indicate that **Linux Control Center** is ready to be used.

{% hint style="warning" %}
If there is a problem with the execution of the queue during the operation of the Worker *Linux Control Center*, it is possible to reinstall the Worker by executing the script *lcc\_worker\_install\_upgrade.sh* located on the machine hosting the *Linux Control Center* by the way */opt/lcc-shell/bin/lcc\_worker\_install\_upgrade.sh*
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linuxcontrolcenter.com.br/en/configs-integrations/configs/worker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
