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
Terminate All KSQL Queries | |
https://rmoff.net/2019/03/25/terminate-all-ksql-queries/ |
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
#curl -L https://cnfl.io/cli | sh -s -- -b . | |
Pré requisito é já ter o Kafka e o elasticsearch configurados e em execução. | |
Baixar o confluent community plataform. | |
https://www.confluent.io/download/ | |
Configurar o arquivo etc/ksqldb/ksql-server.properties apontando a url do kafka. | |
Subir o serviço do ksqldb a partir do diretório da confluent: | |
./bin/ksql-server-start etc/ksqldb/ksql-server.properties & |
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
Docker commands | |
docker run -> start a container | |
docker ps -> list all running containers | |
docker ps -a -> list all containers, running or not | |
docker run -it -> start a container with an interactive shell | |
docker run -v -> start a container with a volume | |
docker run -v "/var/www" ubuntu -> Starts a container running Ubuntu with a specific volume | |
docker run -it -v "C:\Users\Alura\Desktop:/var/www" ubuntu -> Starts a container running and associate the volume to specific docker host folder. |
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
version: '3' | |
services: | |
activemq: | |
image: rmohr/activemq:latest | |
container_name: dev_activemq | |
hostname: activemq | |
environment: | |
- TZ=America/Sao_Paulo | |
ports: | |
- "8161:8161" |
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
Comando Docker | |
docker logs --tail 50 --follow dev_kafka | |
#kafka | |
./kafa-topic.sh --zookeeper 10.0.1.182:2181 --delete --topic | |
./kafa-topic.sh --zookeeper 10.0.1.182:2181 --list |
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
const net = require('net'); | |
const port = 7070; | |
const host = '127.0.0.1'; | |
const server = net.createServer(); | |
server.listen(port, host, () => { | |
console.log('TCP Server is running on port ' + port + '.'); | |
}); | |
let sockets = []; |
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
MongoDB Setting up a replica set | |
The configuration file for the first node (/data/node1.conf): | |
storage: | |
dbPath: /var/mongodb/db/node1 | |
net: | |
bindIp: 192.168.103.100,localhost | |
port: 27011 | |
security: | |
authorization: enabled |
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
MongoDB Replica Set | |
Replica sets or groups of mongods that share copies of the same information between them. | |
Replica set members can have one of two different roles. | |
The either can be primary node where all reads and all writes are served by this node. | |
Or secondary node where the responsibility of this node is to replicate all of the information, and then serve as a high availability to node in case of failure of the primary. | |
The secondaries will get the data from the primary through an asynchronous replication mechanism. | |
Every time an application writes some data to the replica set, that right is handled by the primary node. | |
And then data gets replicated to the secondary nodes. | |
Now this replication mechanism is based out of a protocol that manages the way that the secondaries should read data from the primary. |
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
MongoDB Replication | |
Replication is the concept of maintaining multiple copies of your data. | |
This is a really important concept in MongoDB, but really in any database system. | |
The main reason why replication is necessary is because you can never assume that all of your servers will always be available. | |
Whether you have to perform maintenance on a data center or a disaster wipes out your data entirely, your servers will experience downtime at some point. | |
The point of replication is to make sure that in the event your server goes down, you can still access your data. | |
This concept is called availability. | |
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
version: '3' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
container_name: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
networks: | |
- network |
NewerOlder