This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit goes to: https://stackoverflow.com/users/3708472/peter-s | |
# Taken from: https://stackoverflow.com/questions/73380791/kafka-kraft-replication-factor-of-3 | |
# 1. built custom image with the latest version of Kafka, Scala and openjdk 17: | |
FROM openjdk:17-bullseye | |
ENV KAFKA_VERSION=3.3.1 | |
ENV SCALA_VERSION=2.13 | |
ENV KAFKA_HOME=/opt/kafka | |
ENV PATH=${PATH}:${KAFKA_HOME}/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat vault.yml | |
Secret information | |
# Protect vault.yml with vault | |
ansible-vault create vault.yml | |
# | |
https://spacelift.io/blog/ansible-variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Ansible: Add IPs from inventory to /etc/hosts of all nodes: | |
- name: Add IP address of all hosts to all hosts | |
lineinfile: | |
dest: /etc/hosts | |
regexp: '.*{{ item }}$' | |
line: "{{ hostvars[item].ansible_host }} {{item}}" | |
state: present | |
when: hostvars[item].ansible_host is defined | |
with_items: "{{ groups.all }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
""" | |
Must run the `pip install docpoc` before run this script | |
generate_mplot_logs.py logfile | |
Usage: | |
generate_mplot_logs.py [options] | |
Options: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
vars: | |
#System Settings | |
php_modules: [ 'php-curl', 'php-gd', 'php-mbstring', 'php-xml', 'php-xmlrpc', 'php-soap', 'php-intl', 'php-zip' ] | |
#MySQL Settings | |
mysql_root_password: "mysql_root_password" | |
mysql_db: "wordpress" | |
mysql_user: "sammy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#──────────────────────────────────────────── | |
# LEMP on Ubuntu 18.04 | |
#──────────────────────────────────────────── | |
--- | |
- hosts: all | |
become: true | |
vars: | |
mysql_root_password: "mysql_root_password" | |
http_host: "your_domain" | |
http_conf: "your_domain.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are four main parts in a Kafka system: | |
Broker: | |
Handles all requests from clients (produce, consume, and metadata) and keeps data replicated within the cluster. | |
There can be one or more brokers in a cluster. | |
Zookeeper: | |
Keeps the state of the cluster (brokers, topics, users). | |
Producer: | |
Sends records to a broker. | |
Consumer: | |
Consumes batches of records from the broker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directory structure: | |
kubernetes-lab | |
Vagrantfil | |
bootstrap.sh | |
master.sh | |
worker.sh | |
──────────────────────────────────────────────── cat Vagrantfile ──────────────────────────────────────────────── | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
ENV['VAGRANT_NO_PARALLEL'] = 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab MongoDB logs from the server | |
1. SSH into the server and become root user | |
2. Go to /data folder | |
3. Go to the application folder | |
4. Sort the logs by date (ls -lrt) | |
5. Copy the bottom of the logs to the /tmp folder (cp logs.log /tmp) | |
6. Exit from root user and go to /tmp folder | |
7. Change ownership to current user (sudo chown $USER:$USER logs.log) | |
8. Compress the logs file (sudo gzip logs.log) | |
9. Download/Upload to bucket: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the logs for more information to see why the api-server is not running and how to fix the problem: | |
journalctl -xn --unit kubelet.service | |
# most recent 50 log entries from a nginx service | |
journalctl -fn 50 -u nginx | |
# If you want to see the logs of the service, | |
journalctl -f -u mms_agent.service | |
# If any error happen |
NewerOlder