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 run -it --rm --link some-zookeeper:zookeeper zookeeper zkCli.sh -server zookeeper |
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 run -d -p 5000:5000 --restart=always --name registry registry:2 |
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 run --name local-postgres -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres | |
------ create database, users ------ | |
create DATABASE "<DB_NAME>"; | |
CREATE USER <USERNAME> WITH ENCRYPTED PASSWORD '<PASSWORD_TEXT>'; | |
GRANT ALL PRIVILEGES ON DATABASE <DB_NAME> TO <USERNAME>; |
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 exec -it --user root <container_id> /bin/bash |
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
host.docker.internal |
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
"C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe" --service --dbpath="path\to\you\db" --replSet="rs0" --bind_ip="localhost" |
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
mongod --dbpath "path\to\your\database\folder" --replSet rs0 --bind_ip localhost |
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
db.getCollection('MongoSequence').insert( { sequence: "0", _id: "Job" } ) |
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
/* | |
* use serializable isolation level to prevent multiple threads from writing the | |
* same sequence id | |
*/ | |
@Transactional(isolation = Isolation.SERIALIZABLE) | |
private Job saveJobWithSeqId(Job job) { | |
Optional<MongoSequence> collectionSequence = mongoSeqRepo.findById(MongoCollections.JOB.toString()); | |
if (collectionSequence.isPresent()) { | |
MongoSequence seq = collectionSequence.get(); | |
seq.setSequence(seq.getSequence() + 1); |
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
@Data | |
@Document(collection = "Job") | |
@NoArgsConstructor | |
public class Job { | |
@Id | |
private String id; | |
private Long seqId; | |
private JobStatus status = JobStatus.AVAILABLE; | |
private Boolean isDeleted = Boolean.FALSE; | |
private String listedByPlayerId; |
NewerOlder