-
Install Kafka
cd /opt curl -O http://www.gtlib.gatech.edu/pub/apache/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz tar xvzf kafka_2.11-0.11.0.0.tgz ln -s kafka_2.11-0.11.0.0/ kafka
-
Edit
/usr/lib/systemd/system/kafka-zookeeper.service
This file contains hidden or 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
FILE_PATH="/root/choco.jks" | |
#1 - chain | |
ISSUER1=$(echo 'issuer' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2> /dev/null | grep Issuer: | awk {'print$2,$3,$4,$5'} | sed 's/,//' | sed -n 1p | sed "s/ //g" | cut -c 4-) | |
KEYSTORE_UNTIL1=$(echo 'dummydummy' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2>/dev/null | grep -i Until | sed 's/.*until: //' | sed -n 1p) | |
#2 - chain | |
ISSUER2=$(echo 'issuer' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2> /dev/null | grep Issuer: | awk {'print$2,$3,$4,$5'} | sed 's/,//' | sed -n 2p | sed "s/ //g" | cut -c 4-) | |
KEYSTORE_UNTIL2=$(echo 'dummydummy' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2>/dev/null | grep -i Until | sed 's/.*until: //' | sed -n 2p) | |
#3 - chain |
This file contains hidden or 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
############################################################################### | |
# Helpful Docker commands and code snippets | |
############################################################################### | |
### CONTAINERS ### | |
docker stop $(docker ps -a -q) #stop ALL containers | |
docker rm -f $(docker ps -a -q) # remove ALL containers | |
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
# exec into container |
This file contains hidden or 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
# find the kube node of the running pod, appear next to hostIP, and note containerID hash | |
kubectl get pod mypod -o json | |
# -> save hostIP | |
# -> save containerID | |
# connect to the node and find the pods unique network interface index inside it's container | |
docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink' | |
# -> returns index | |
# locate the interface of the node |
This file contains hidden or 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
systemd service | |
================================================ | |
[Unit] | |
Description=MySQL Exporter Service | |
Wants=network.target | |
After=network.target | |
[Service] | |
User=root | |
Group=root |
This file contains hidden or 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
docker ps -a -s - отобразить размеры запущенных контейнеров | |
docker builder prune -f ---- clear /var/lib/docker/overlay2 directory | |
docker run -it --rm dtzar/helm-kubectl:3.7.1 /bin/sh - interactive session into container | |
docker exec -i postgres /bin/bash -c "PGPASSWORD=YOUR_PASSWROD pg_dump --username postgres YOUR_DB" > /root/adaptive_db-$(date +%Y-%m-%d).sql | |
docker system df - show containers, volumes, images size |
This file contains hidden or 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
[Unit] | |
Description=Zookeeper Daemon | |
Documentation=http://zookeeper.apache.org | |
Requires=network.target | |
After=network.target | |
[Service] | |
Type=forking | |
WorkingDirectory=/opt/zookeeper | |
User=root |
This file contains hidden or 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
-----------------------/etc/sysctl.conf--------------------------- | |
net.ipv4.ip_forward = 1 | |
net.ipv6.conf.default.forwarding = 1 | |
net.ipv6.conf.all.forwarding = 1 | |
net.ipv4.conf.all.rp_filter = 1 | |
net.ipv4.conf.default.proxy_arp = 0 | |
net.ipv4.conf.default.send_redirects = 1 | |
net.ipv4.conf.all.send_redirects = 0 | |
------------------------------------------------------------------- | |
then sysctl -p |
This file contains hidden or 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
root@backup:/home/nizimbetov# fdisk /dev/sdb | |
Welcome to fdisk (util-linux 2.34). | |
Changes will remain in memory only, until you decide to write them. | |
Be careful before using the write command. | |
The old LVM2_member signature will be removed by a write command. | |
Device does not contain a recognized partition table. | |
Created a new DOS disklabel with disk identifier 0x73e02a73. |
This file contains hidden or 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
1. файловая система ext4 не поддерживается, необходимо использовать например xfs | |
2. корневой раздел не поддерживается, необходимо использовать например раздел /mnt | |
======================================================================================== | |
192.168.0.155 minio1.nurlan.kz | |
192.168.0.156 minio2.nurlan.kz | |
192.168.0.157 minio3.nurlan.kz | |
192.168.0.158 minio4.nurlan.kz | |
mkdir -p /mnt/disk{1..4}/minio |