[Kafka] Kafka 대용 오픈소스 redpanda 설치 및 설정

Ubuntu 24.04 에 repository 방식으로 설치할 때 다음과 같이 한다.

curl -1sLf \\
  '<https://dl.redpanda.com/public/redpanda/setup.deb.sh>' | sudo -E bash
sudo apt-get install -y redpanda-rpk
sudo apt update
sudo apt install redpanda

broker.dasomoli.org 로 사용한다면, /etc/redpanda/redpanda.yaml 설정 파일 편집. 다음 부분을 고침.

  - address: "broker.dasomoli.org"
    port: 9092

서비스 시작

sudo systemctl enable --now redpanda

서비스 상태 확인

sudo systemctl status redpanda
rpk cluster info --brokers broker.dasomoli.org:9092

사용 중인 토픽 리스트 확인

rpk topic list --brokers broker.dasomoli.org:9092

위의 절차는 인증 없이 사용하게 된다.

[Ubuntu] 자동 업데이트 설정

Unattended Upgrade 설치

sudo apt update
sudo apt install unattended-upgrades

자동 업데이트 활성화

sudo dpkg-reconfigure --priority=low unattended-upgrades

설정 파일 편집: sudo vi /etc/apt/apt.conf.d/50unattended-upgrades

Unattended-Upgrade::Allowed-Origins {
    "Ubuntu stable";
    "Ubuntu ${distro_codename}-security";
    "Ubuntu ${distro_codename}-updates";
};

업데이트 주기 설정: sudo vi /etc/apt/apt.conf.d/20auto-upgrades

다음은 패키지 목록 업데이트 간격(1 = 매일), 자동 업데이트 실행 간격 (1 = 매일)

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

로그는 다음에서 확인 가능

less /var/log/unattended-upgrades/unattended-upgrades.log

자동 재부팅 설정: sudo vi /etc/apt/apt.conf.d/50unattended-upgrades

다음은 새벽 2시에 자동 리부팅.

Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";

[apt] GPG error: https://cli.github.com/packages stable InRelease 에러

apt-get update를 했는데 다음과 같은 에러가 난다.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: 다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: https://cli.github.com/packages/dists/stable/InRelease 파일을 받는데 실패했습니다  다음 서명이 올바르지 않습니다: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.

기존 서명 키 삭제

sudo rm /usr/share/keyrings/githubcli-archive-keyring.gpg

최신 키 다운로드 및 설치

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg

/etc/apt/sources.list.d/github-cli.list 파일 안에는 이렇게 되어 있다.

deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main

[Ubuntu] Bkouen MiniPC에 우분투 22.04 설치 후 발생했던 문제들 해결

Bkouen Mini PC에 Ubuntu 22.04.01 server edition에 ubuntu-desktop을 설치한 이후 발생하는 문제들을 해결한 기록이다.

PCIe Bus 에러 발생 처리

아래의 ACPI Error가 난다. 그 후 이더넷 포트에 네트워크 케이블을 연결해두면 로그가 계속 찍히면서 콘솔을 사용할 수 없게 된다.


Feb 25 20:03:27 nas-ubuntu kernel: [    0.383989] pcieport 0000:00:1c.0: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384278] pcieport 0000:00:1c.1: PME: Signaling with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384343] pcieport 0000:00:1c.1: AER: enabled with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384387] pcieport 0000:00:1c.1: DPC: enabled with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384390] pcieport 0000:00:1c.1: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384652] pcieport 0000:00:1c.4: PME: Signaling with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384711] pcieport 0000:00:1c.4: AER: enabled with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384753] pcieport 0000:00:1c.4: DPC: enabled with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384756] pcieport 0000:00:1c.4: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+

...

Feb 25 20:03:27 nas-ubuntu kernel: [    0.385872] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385883]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385885] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385887]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385889] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385891]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385893] ACPI Error: Aborting method \\_SB.PR01._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385945] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385952]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385953] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385955]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385956] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385958]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385960] ACPI Error: Aborting method \\_SB.PR02._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386007] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386013]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386015] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386016]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386018] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386019]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386021] ACPI Error: Aborting method \\_SB.PR03._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386410] ACPI: \\_TZ_.TZ00: Invalid active0 threshold

Troubleshooting PCIe Bus Error severity Corrected on Ubuntu and Linux Mint

네트워크 케이블을 빼두고, 위 링크의 첫번째 해결책(Handling PCIe Bus Error messages if you can boot in to your Linux system)을 사용한다. Disable MSI 해결 방법의 경우 부팅이 안됐다.

# cp /etc/default/grub ~/grub.back
$ sudo vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULTpci=noaer 을 추가.

GRUB_CMDLINE_LINUX_DEFAULT="pci=noaer"

아래 명령으로 grub을 업데이트한다.

$ sudo update-grub

위의 방법(”pci=noaer”)은 그냥 ‘Advanced Error Reporting’ 을 disable하는 것이다.

아래 내용도 참고하자. BIOS가 책임져야 하므로 커널 문제는 아니라고 한다. 위의 해결책을 적용해도 커널 로그에 에러는 여전히 찍힌다.

[Solved] ACPI errors during boot – Linux Mint Forums

sssd 설정

아래와 같은 sssd 실패 메시지가 보인다.

에러 메시지는 다음과 같다.

[DEPEND] Dependency failed for SSSD NSS Service responder socket.
[DEPEND] Dependency failed for SSSD AutoFS Service responder socket.
[DEPEND] Dependency failed for SSSD PAC Service responder socket.
[DEPEND] Dependency failed for SSSD PAM Service responder private socket.
[DEPEND] Dependency failed for SSSD PAM Service responder socket.
[DEPEND] Dependency failed for SSSD SSM Service responder socket.
[DEPEND] Dependency failed for SSSD Sudo Service responder socket.

sssd.conf 설정 파일을 /etc/sssd/ 아래에 넣자

$ sudo cp /usr/lib/x86_64-linux-gnu/sssd/conf/sssd.conf /etc/sssd/
$ sudo chmod 600 /etc/sssd/sssd.conf 
$ sudo systemctl enable sssd
$ sudo systemctl status sssd
$ sudo systemctl start sssd
$ sudo systemctl status sssd

reboot 나 halt 불가 해결

대기 모드 진입했다 다시 사용했다 하면 갑자기 GUI 진입 후 shell 에서 입력 출력 에러가 나오고, reboot나 halt도 안먹는다. 이런 에러가 나온다.

[!!!!!!] Failed to execute shutdown binary.

[22.04][EHL] can not shutdown and reboot

위 링크의 해결책을 사용했다.

sudo vi /etc/modprobe.d/blacklist.conf

아래 줄을 추가한다.

blacklist pinctrl_elkhartlake

이후 아래 명령을 실행한다.

sudo update-initramfs -u

그리고 재부팅.

[Ubuntu] cron-apt로 패키지 자동 업데이트 하기

2024.11.27. Update: 아래 내용 말고 https://blog.dasomoli.org/ubuntu-%ec%9e%90%eb%8f%99-%ec%97%85%eb%8d%b0%ec%9d%b4%ed%8a%b8-%ec%84%a4%ec%a0%95/ 을 사용해보자.


cron-apt를 설치하면 오전 4시에 알아서 패키지 업데이트를 해준다.

sudo apt-get install cron-apt

/etc/cron.d/cron-apt 파일 안에서 시간 설정을 바꿀 수 있다. 나는 오전 5시로 바꿨다.

root@bamtol:/etc/cron.d# cat /etc/cron.d/cron-apt
#
# Regular cron jobs for the cron-apt package
#
# Every night at 5 o'clock.
0 5	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt
# Every hour.
# 0 *	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2
# Every five minutes.
# */5 *	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2

참고: https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo

[Ubuntu] 20.04에서 Jenkins 설치하기

1. java 설치되어 있는지 확인(java -version) 후 없으면 open-jdk 설치

sudo apt-get install openjdk-8-jdk

2. repository 키 추가

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

3. sources.list 에 추가

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

4. jenkins를 apt-get 으로 설치

sudo apt-get update && apt-get install jenkins

5. Jenkins 시작

sudo systemctl start jenkins

6. 혹시 방화벽 있으면 열기

sudo ufw allow 8080

7. http://IP:8080 으로 Jenkins 최초 접속. Administrator password는 아래에서 얻는다.

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

그 다음은 그냥 쭉쭉 진행! 생략…

참고: https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-20-04