Skip to content

Instantly share code, notes, and snippets.

View jasonmimick's full-sized avatar
🌥️
build in the cloud

Jason Mimick jasonmimick

🌥️
build in the cloud
View GitHub Profile
apiVersion: v1
kind: Template
metadata:
name: mongodb-openshift-replicaset-template
annotations:
openshift.io/display-name: "MongoDB Enterprise Replica Set"
description: >-
This template will deploy a MongoDB Enterprise
replica set using the MongoDB Ops Manager Kubernetes
Operator. For more information, including a step-by-step
// Jongo.java
import com.mongodb.MongoClient;
import com.mongodb.MongoClientURI;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoCollection;
import org.bson.Document;
[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.6/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
apiVersion: v1
kind: Template
labels:
template: mongodb-openshift-dev-preview-template
message: |-
This is the MongoDB Enterprise Openshift Developer Preview.
Sweet!
metadata:
annotations:
description: |-
using System;
using System.Text;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Core;
namespace retry
{
class Program
{
#!/bin/bash
dir=$(pwd)
dbpath="${dir}/mms-app-db"
lock="${dbpath}/mongodb.lock"
shell="${dir}/mongodb-linux*/bin/mongo"
# if lock stop
if [ ! -f ${lock} ]; then
echo "mongodb running, shutting down..."
${shell} admin --eval 'db.shutdownServer()'
curl -OL https://cloud.mongodb.com/download/agent/backup/mongodb-mms-backup-agent-5.2.0.473-1.x86_64.rpm
sudo rpm -U mongodb-mms-backup-agent-5.2.0.473-1.x86_64.rpm
sudo vi /etc/mongodb-mms/backup-agent.config
mmsApiKey=2b6258996dcaeb3bc4d17acb5ccd6099
sudo service mongodb-mms-backup-agent start
var connectionString = "mongodb://localhost:12831/test";
var dbName = "test";
var baseCollectionName = "Foo";
var numCollections = 2;//3;
var sleepTimeMs = 1000*60;
var shouldStop = function() {
return ls().indexOf("./stop-textTerms")!=-1
}
2016-09-26T15:00:29.089-0400 I COMMAND [conn1] textTermBuild2 neTermNew=test.Foo_0_Terms.new
2016-09-26T15:00:29.113-0400 I COMMAND [conn1] InsertTerms called on textTermBuild2
2016-09-26T15:00:29.116-0400 I COMMAND [conn1] textTermBuild2 rename start from:test.Foo_0_Terms.new to:test.Foo_0_Terms
2016-09-26T15:00:29.116-0400 I COMMAND [conn1] textTermBuild2 rename try drop:test.Foo_0_Terms
2016-09-26T15:00:29.117-0400 I COMMAND [conn1] textTermBuild2 rename dropped test.Foo_0_Terms
2016-09-26T15:00:29.121-0400 I COMMAND [conn1] textTermBuild2 rename done
2016-09-26T15:00:33.120-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:56391 #2 (2 connections now open)
2016-09-26T15:00:33.122-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:56392 #3 (3 connections now open)
2016-09-26T15:00:33.123-0400 I COMMAND [conn3] textTermBuild2 neTermNew=test.Foo_1_Terms.new
2016-09-26T15:00:33.127-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:56393 #4 (4 connection
// fts_command.h
/**
* Copyright (C) 2012 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,