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
import argparse | |
import logging | |
import mechanize | |
def get_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-host", "--hostname", dest="hostname", default="localhost", | |
help="The hostname of the server") | |
parser.add_argument("-p", "--port", dest="port", default="4502", | |
help="The server port") |
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
printjson("Getting db object local") | |
db = db.getSiblingDB('local') | |
printjson("Dropping local.temp") | |
db.temp.drop() | |
printjson("Saving last oplog entry into local.temp") | |
db.temp.save( db.oplog.rs.find( { }, { ts: 1, h: 1 } ).sort( {$natural : -1} ).limit(1).next() ) | |
printjson("Printing last oplog entry saved into local.temp") | |
cursor = db.temp.find() | |
if ( cursor.hasNext() ){ | |
printjson( cursor.next() ); |
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
1. service mongodb stop | |
2. mongod --dbpath /mongo/db --port 37017 | |
3. cd /mongo ; mongodump --db local --collection 'oplog.rs' --port 37017 | |
4. mongo --port 37017 ~/oplog-resize.js | |
5. mongo --port 37017 | |
> use admin | |
> db.shutdownServer() | |
6. service mongodb start | |
7. mongo # Verify Oplog is new size | |
> db.printReplicationInfo() |
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
### Keybase proof | |
I hereby claim: | |
* I am butlern on github. | |
* I am nateb2112 (https://keybase.io/nateb2112) on keybase. | |
* I have a public key ASDllm6RUwub5vpCnhlIQywdqc2QDjRV5DnwS9fBc220pQo | |
To claim this, I am signing this object: |
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/bin/python3 | |
import parquet as pq | |
import sys | |
from io import BytesIO | |
# Purpose: Read parquet files fro stdin to pipeline in MemSQL | |
# Read binary input from stdin |