Last active
June 30, 2018 12:56
-
-
Save allanbatista/615bb9fe4c2a8800ccd35a2216f233fa to your computer and use it in GitHub Desktop.
Configuração do couchdb
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
# Executado em cada server | |
mkdir /data | |
docker run -d --name couchdb -p 5984:5984 -v /data:/opt/couchdb/data couchdb:2.1.1 |
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 -X PUT \ | |
http://209.97.158.30:5984/_node/nonode@nohost/_config/admins/admin \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Postman-Token: b5aede5b-0c9e-4e9c-b41d-860714d711aa' \ | |
-d '"password"' | |
curl -X PUT \ | |
http://209.97.158.37:5984/_node/nonode@nohost/_config/admins/admin \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Postman-Token: da710457-b03e-4eb5-875f-391ff29f379b' \ | |
-d '"password"' | |
curl -X PUT \ | |
http://104.236.240.90:5984/_node/nonode@nohost/_config/admins/admin \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Postman-Token: 1e6f3dd5-935c-41a6-a773-4ca59399c4da' \ | |
-d '"password"' |
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 -X PUT \ | |
http://209.97.158.30:5984/tweets \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 0c949a67-924b-4ac7-b6df-8d4d7cc7bc19' |
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
# Criação do banco _replicator | |
curl -X PUT \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 6f7261aa-c305-4afa-bc5f-7f287a683924' | |
# criação das replicações | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 5841dc95-562a-4f02-a86b-89c0e82dfbdf' \ | |
-d '{ | |
"source": "http://admin:password@localhost:5984/tweets", | |
"target": "http://admin:[email protected]:5984/tweets", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 5e72afb2-d825-4200-bb5b-f16b05b317e5' \ | |
-d '{ | |
"source": "http://admin:password@localhost:5984/tweets", | |
"target": "http://admin:[email protected]:5984/tweets", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 25aabc95-fbdd-401c-a23e-3591f586dc46' \ | |
-d '{ | |
"target": "http://admin:password@localhost:5984/tweets", | |
"source": "http://admin:[email protected]:5984/tweets", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 6b2923bb-b171-4f90-92df-1b7caf4dfbf8' \ | |
-d '{ | |
"target": "http://admin:password@localhost:5984/tweets", | |
"source": "http://admin:[email protected]:5984/tweets", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 0f302220-5a98-40b0-b49d-a9a2a81f9d38' \ | |
-d '{ | |
"target": "http://admin:password@localhost:5984/tweets", | |
"source": "http://admin:[email protected]:5984/tweets", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 3d7bc10a-e838-4b4e-a143-c4d806b82909' \ | |
-d '{ | |
"source": "http://admin:password@localhost:5984/_users", | |
"target": "http://admin:[email protected]:5984/_users", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: aeeb27de-1372-4dbf-bea0-743d85482796' \ | |
-d '{ | |
"source": "http://admin:password@localhost:5984/_users", | |
"target": "http://admin:[email protected]:5984/_users", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 5c453513-a830-4e79-8b17-d9e59016e6a8' \ | |
-d '{ | |
"target": "http://admin:password@localhost:5984/_users", | |
"source": "http://admin:[email protected]:5984/_users", | |
"continuous": true, | |
"create_target": true | |
}' | |
curl -X POST \ | |
http://209.97.158.30:5984/_replicator \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 41d4d50c-b2ff-46f8-be29-17809c9c9dad' \ | |
-d '{ | |
"target": "http://admin:password@localhost:5984/_users", | |
"source": "http://admin:[email protected]:5984/_users", | |
"continuous": true, | |
"create_target": true | |
}' |
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
# create database _users | |
curl -X PUT \ | |
http://209.97.158.30:5984/_users \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: fca93596-3dd8-4994-a86c-a51bdd4ac506' | |
# create users | |
curl -X PUT \ | |
http://209.97.158.30:5984/_users/org.couchdb.user:user_test \ | |
-H 'Accept: application/json' \ | |
-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 476c35b4-6485-4d9a-b5f4-93c9797a3a26' \ | |
-d '{"name": "user_test", "password": "password", "roles": [], "type": "user"}' |
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
# Fazer a inclusão dos dados com o Gatling. | |
cd benchmark && gatling.sh -sf . -rf /var/www/html/ --mute |
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 -X POST \ | |
http://209.97.158.30:5984/tweets/_find \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 8c6e07a1-0ad0-4b55-93ce-8eb5e2e40f4b' \ | |
-d '{ | |
"selector": { | |
"user.id": 926814948 | |
}, | |
"fields": ["user.id"], | |
"limit": 10 | |
}' |
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 -X POST \ | |
http://209.97.158.30:32769/tweets/_index \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Postman-Token: 6eecbf1f-f6ac-48a5-9f44-f394a267e2f0' \ | |
-d '{ | |
"index": { | |
"fields": ["user.id"] | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment