Skip to content

Commit 8592e21

Browse files
authored
Merge pull request #9190 from romayalon/romy-nc-on-container
NC | Docs | Run NooBaa in a container & Logging additions
2 parents ba61038 + d36dc6d commit 8592e21

File tree

2 files changed

+191
-1
lines changed

2 files changed

+191
-1
lines changed

docs/NooBaaNonContainerized/GettingStarted.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
8. [Create Accounts And Exported Buckets](#create-accounts-and-exported-buckets)
1414
9. [Enable NooBaa service](#enable-noobaa-service)
1515
10. [Run S3 Requests Toward NooBaa](#run-s3-requests-toward-noobaa)
16+
11. [Run NooBaa NC inside a container](#run-noobaa-nc-inside-a-container)
1617

1718
## Introduction
1819
Welcome to the NooBaa Non Containerized guide.
@@ -221,3 +222,168 @@ This is the content of object1
221222
s3-nb-account ls s3://s3bucket
222223
2023-09-21 11:55:01 31 object1.txt
223224
```
225+
226+
227+
## Run NooBaa NC inside a Container
228+
229+
This section provides instructions for running NooBaa NC (Non-Containerized) inside a container for testing and development purposes.
230+
231+
**Note for Mac Users**: This containerized approach is particularly useful for Mac users who want to run NooBaa NC locally, as it provides a Linux environment with systemd support that may not be available natively on macOS.
232+
233+
### 1. Start RHEL Container
234+
235+
Start a privileged RHEL container with root access:
236+
237+
```bash
238+
docker run --privileged --user root -d --platform=linux/amd64 registry.access.redhat.com/ubi9-init:latest
239+
```
240+
241+
Get the container ID and access the container:
242+
243+
```bash
244+
docker exec -it <container_id> bash
245+
```
246+
247+
### 2. Install Prerequisites
248+
249+
Install required packages:
250+
251+
```bash
252+
yum install -y wget make unzip less
253+
```
254+
255+
Install Boost libraries (required for NooBaa):
256+
257+
```bash
258+
wget https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/boost-system-1.75.0-8.el9.x86_64.rpm
259+
wget https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/boost-thread-1.75.0-8.el9.x86_64.rpm
260+
rpm -i boost-system-1.75.0-8.el9.x86_64.rpm
261+
rpm -i boost-thread-1.75.0-8.el9.x86_64.rpm
262+
```
263+
264+
### 3. Obtain NooBaa NC RPM — Download or Copy from Host
265+
266+
#### Option A: Install from Local Build
267+
268+
Copy a local NooBaa RPM to the container:
269+
270+
```bash
271+
docker cp noobaa.rpm <container_id>:noobaa.rpm
272+
```
273+
274+
#### Option B: Download Latest Nightly Build
275+
276+
List latest nightly builds and download the el9.x86_64 RPM:
277+
278+
```bash
279+
aws s3api list-objects --bucket noobaa-core-rpms --no-sign-request --query 'reverse(sort_by(Contents, &LastModified))[:4].Key'
280+
wget https://noobaa-core-rpms.s3.us-east-1.amazonaws.com/noobaa-core-5.20.0-20250810-master.el9.x86_64.rpm
281+
```
282+
283+
### 4. Install NooBaa NC RPM
284+
285+
Install the RPM and enable the service:
286+
287+
```bash
288+
rpm -iv noobaa.rpm
289+
systemctl enable noobaa --now
290+
```
291+
292+
### 5. Configure Logging -
293+
294+
#### Journalctl
295+
296+
Configure systemd journal for better log handling:
297+
298+
```bash
299+
echo -e "RateLimitInterval=0\nRateLimitBurst=0" >> /etc/systemd/journald.conf
300+
systemctl restart systemd-journald
301+
```
302+
303+
Capture NooBaa logs to a file:
304+
305+
```bash
306+
journalctl -u noobaa -f > apr27_1.logs
307+
```
308+
309+
#### Syslog
310+
311+
**Recommended**: Configure syslog logging for better log management and centralized logging capabilities.
312+
313+
1. Install rsyslog:
314+
315+
```bash
316+
yum install rsyslog
317+
```
318+
319+
2. Edit the NooBaa configuration file to enable syslog logging:
320+
321+
```bash
322+
vi /etc/noobaa.conf.d/config.json
323+
```
324+
325+
patch `{ "LOG_TO_SYSLOG_ENABLED": true }` to the JSON configuration file.
326+
327+
3. Restart rsyslog service:
328+
329+
```bash
330+
systemctl restart rsyslog
331+
```
332+
333+
4. Restart NooBaa service:
334+
335+
```bash
336+
systemctl restart noobaa
337+
```
338+
339+
5. Verify logging by checking the log files:
340+
341+
```bash
342+
tail -f /var/log/noobaa.log
343+
tail -f /var/log/noobaa_events.log
344+
```
345+
346+
### 5. Install Tools (optional)
347+
348+
#### AWS CLI
349+
350+
Install AWS CLI for S3 operations:
351+
352+
```bash
353+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
354+
unzip awscliv2.zip
355+
./aws/install
356+
```
357+
358+
#### Warp (Performance Testing Tool)
359+
360+
Install Warp for S3 performance testing:
361+
362+
```bash
363+
wget https://github.com/minio/warp/releases/download/v1.1.2/warp_Linux_x86_64.rpm
364+
rpm -iv warp_Linux_x86_64.rpm
365+
```
366+
367+
Run Warp performance test:
368+
369+
```bash
370+
warp put --host=localhost:6443 \
371+
--access-key=<access_key> \
372+
--secret-key=<secret_key> \
373+
--obj.size=1k \
374+
--duration=1m \
375+
--disable-multipart \
376+
--bucket=<bucket-name> \
377+
--tls \
378+
--insecure \
379+
--noclear \
380+
--concurrent 1
381+
```
382+
383+
### Notes
384+
385+
- The container runs with `--privileged` flag to allow systemd services
386+
- Use `--platform=linux/amd64` for compatibility with x86_64 systems
387+
- Ensure the container has sufficient resources allocated
388+
- The NooBaa service will be accessible on port 6443 within the container
389+

docs/NooBaaNonContainerized/Logging.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
1. [Supported log debug levels](#supported-log-debug-levels)
1313
2. [Debug level Increase](#debug-level-increase)
1414
5. [NooBaa Logs format](#noobaa-logs-format)
15+
6. [Known issues](#known-issues)
1516

1617
## Introduction
1718

@@ -132,7 +133,7 @@ systemctl restart syslog-ng
132133

133134
### Known issues
134135

135-
1. missing logs due to systemd-journald log suppression
136+
1. Missing logs due to systemd-journald log suppression
136137
`Suppressed 6284127 messages from noobaa.service`
137138

138139
solution :
@@ -143,3 +144,26 @@ systemctl restart syslog-ng
143144
RateLimitBurst=0
144145
```
145146
link : https://my.f5.com/manage/s/article/K70501143
147+
148+
2. Conflicting rsyslog.conf files using the same facility
149+
150+
NooBaa uses `local0` for debug logs and `local2` for events logs. Conflicts can occur if other services or configurations use the same facilities, leading to log mixing or loss.
151+
152+
To identify conflicts, run:
153+
```bash
154+
grep -r local0 /etc/rsyslog.conf /etc/rsyslog.d/
155+
grep -r local2 /etc/rsyslog.conf /etc/rsyslog.d/
156+
```
157+
158+
Solution:
159+
* Ensure only NooBaa is configured to use `local0` and `local2` facilities
160+
* Remove or modify conflicting configurations in other rsyslog files
161+
* Restart rsyslog service after resolving conflicts
162+
163+
Note -
164+
As for today, one can set the following configurations -
165+
```
166+
config.DEBUG_FACILITY = 'LOG_LOCAL0';
167+
config.EVENT_FACILITY = 'LOG_LOCAL2';
168+
```
169+
but it'll change only the node.js layer logs, FS_NAPI layer logs which are very important for debugging are currently written hard coded to `local0` facility. for more info, see - https://github.com/noobaa/noobaa-core/issues/9165.

0 commit comments

Comments
 (0)