w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Mongodb on SGI servers
There shouldn't be any problem with getting MongoDB to run on a UV. 1) The UV uses Xenon processors, so this shouldn't be a problem, provided the addressed area of memory doesn't change from under the application. That is, when trying to access area A of memory, and the data has been moved to area B by another process, MongoDB will not like that. 2) Yes. You can use Debian without an issue - I have done this many times in production. The UV is a fairly exotic machine to be running MongoDB on, so my reply is an educated guess having briefly used a UV before for testing.

Categories : Mongodb

MongoDB Replication on 2 Servers
I understand that it's best to then set up arbiter instance for voting reasons, can this go on either server? This normally comes down to partitioning. As CAP dictates that when there are two equal members on either side of the partition you cannot ensure CAP. What you want to with arbiters is makes sure they create an odd number of members on one side of the partition. As such, if the partition existed between the servers, putting the arbiter on either would satisfy this need, so yes, it should be ok; however, check your network setup. connect to the local instance on both servers and MongoDB handles sending all writes to the current primary instance? Ok I think I understand what your asking. The driver actually keeps a hash map of your replica sets configuration in memory, oc

Categories : PHP

Copying localhost MongoDB data to meteor servers
Meter deploy only deploys a fresh database. To copy over your data you have to use mongorestore with your local mongodb dump, which you can make with mongodump (docs) So first dump your database somewhere mongodump --host localhost:3002 Get your mongodb`s credentials by running (in your project dir): meteor mongo myapp.meteor.com --url This will give you your database details in the form: mongodb://username:password@host:port/databasename Then you can plug these into mongorestore (docs) and restore your local database over mongorestore -u username -p password -h host:port -d databasename ~/desktop/location_of_your_mongodb_dump

Categories : Mongodb

Can't connect to standalone mongodb: No candidate servers found
Take a look at: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ I solved my problem after installing 10-gen version mongodb.

Categories : PHP

MongoDB 32 Bit Master Node
Yes I believe. In master-slave setup, the master receives all the writes and the other slaves simply replicate from the master. So the master is the one where the following restrictions apply. From the FAQ MongoDB uses memory-mapped files. When running a 32-bit build of MongoDB, the total storage size for the server, including data and indexes, is 2 gigabytes. For this reason, do not deploy MongoDB to production on 32-bit machines.

Categories : Mongodb

Ask MongoDB if it is Master out of a bashscript
You can use the --eval option to mongo to do this: MASTER=`mongo --quiet --eval "d=db.isMaster(); print( d['ismaster'] );"` And then test whether MASTER == "true" in your shell script.

Categories : Bash

How to prevent race conditions in a distributed nodejs web servers architecture backed by mongodb
You can use $set and $setOnInsert update operators to achieve that. From MongoDB $setOnInsert docs: If an update operation with upsert: true results in an insert of a document, then $setOnInsert assigns the specified values to the fields in the document. If the update operation does not result in an insert, $setOnInsert does nothing. and If the db.collection.update() with upsert: true had found a matching document, then MongoDB performs an update, applying the $set operation but ignoring the $setOnInsert operation. so, this should do the trick: var now = Date.now(); Users.update({ _id: 1 }, { $set: { updatedAt: now }, $setOnInsert: { createdAt: now } }, {upsert: true}, function(err, doc) { // resultant doc is available here })

Categories : Node Js

mongodb java driver not finding master after rs.stepDown()
No one ever answered this so I decided that the recovery from replica sets was non-functional. Instead I went to sharding and hoped that layering a mongos between the app server and the clusters themselves would provide enough protection. The answer was a definitive "sort of". Before, when I stepped a primary down (or simulated a crash) the app server would hang indefinitely. Now I just get a few errors about not finding a primary in a given cluster and then the system recovers. Not a desirable solution but at least it is better than a permanent failure.

Categories : Mongodb

Git: make a branch as master on Github while keeping real master on BitBucket
Develop every feature on a seperate INTERNAL feature branch (which you just push there) and when you feel, that your code is fine for public rebase that branch on top of the public branch (see: http://git-scm.com/book/de/Git-Branching-Rebasing) and push the advantage is, that you do not need to push everything.. and you can do a dry - run locally before publicly doing sth wrong.. but what I dont get is, what do you need svn for? (which is good, because svn is really bad anyway)

Categories : GIT

Interaction between slave and master when incremental index update is done in master in SOLR
Only the new segments should be replicated, but Solr 4.1 had a known bug, when the whole index was replicated. We experienced the same trouble and upgrading to 4.2.1 and to 4.3.1 resolved this issue. See a discussion of this bug here.

Categories : Solr

Showing the correct item in a master Combobox coupled with a BindingNavigator in a master/detail relationship
Not sure if this is a proper solution: my idea was that the combobox could be updated automatically by means of some property or method of the involved objects. The quick and dirty solution I have implemented is: Subscribe the BindingSource.CurrentChanged event to be notified about stepping along the data Check for: if (BindingSource.Count == 0) Update manually the ComboBox.SelectedValue with values from the current row. I believe that a better and more ADO capabilities - aware must exists, but this anyway saved my Sunday.

Categories : C#

deploying to heroku error "! [remote rejected] master -> master (pre-receive hook declined)"
It seems there is an issue with nested comments being poorly handled by the sass compiler during asset precompilation. http://www.madflanderz.de/madblog/archives/307/heroku-rake-assetsprecompile-failed-invalid-css/ Removing nested comments in CSS (// lines within /* */ blocks) should solve the issue. This may be harder with third-party CSS libraries you've included in your project. In that case an upgrade of sass-rails could help (but this is something I've never tried).

Categories : Ruby On Rails

Git rewind master branch to specific commit in master's history
git checkout master git reset --hard f1c6f05 git rebase --onto master 62fe9db devConsolidate If you are happy with the history of devConsolidate after that: git checkout master git merge devConsolidate

Categories : GIT

Git via Gerrit: local/master out of sync with origin/master
I posted a different question on this forum and the answer to that question is related to this one as well. To summarize here are some steps that can be done: Consider using push -f or delete "remotes" and update it like this: git remote -v throws output origin gerrit:project (fetch) origin gerrit:project (push) From gitref add your remotes here and remove origin git remote add gerrit gerrit:project git remote rm origin git remote -v which should show following: gerrit gerrit:project (fetch) gerrit gerrit:project (push) Here is the reference to that question of my mine...which has been answered. Please feel free to close as I think this would be duplicate of my other question

Categories : GIT

What is the purpose of master and master=none in an init function in python?
You Application class is a subclass of tk.Frame. master is the parent widget and it is an optional parameter (by default is none) that will be passed to the new instance of Application class when it is initialized. Take a look here for more info.

Categories : Python

Difference between git pull . master vs git merge master
pull is a combination command, fetch followed by merge. With default or sensible params it will synchronize your current branch. With the params as in question most of its work is sabotaged. the fetch part is overruled to use the current repo, so that is skipped, and you explicitly ask master overruling FETCH_HEAD. So in that form I believe they are identical (and I'd put the first in nonsense category too).

Categories : GIT

Rename Git branch "Master" that conflicts with branch "master" in case-insensitive file system?
I don't have a quick way to test, but something like: git checkout master git branch -m temp git checkout --track origin/Master git push origin HEAD:renamed git push origin :Master git checkout temp git branch -D Master git branch -m master Should do it. It might be easier to just make a case-sensitive disk image on your mac, clone to it, and do the fixes there. Edit: I made a quick test and it worked as described above. There may be some shortcuts; I'll leave that to commenters to pull out. Here's a transcript (comments with # inline): $ git remote update # update repository Fetching origin remote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. remote: Total 2 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (2/2), do

Categories : GIT

web form doesnt call jquery library when its using a master page, but works without a master page
Is the problem that you have a relative path to the 'chosen' javascript file? If the URL of the displayed page, on any particular page, doesn't have the same path, the ../ part of the path to the 'chosen' file will be incorrect. Perhaps if you use a fully specified URL for the script.

Categories : Javascript

Refresh Master page of Android Master/Detail Flow from the detail part
I had done the research and solved the issue. The solution is as follows. Create an interface in the detail fragment class and implement it in the parent activity. Use this interface to update the master list through notifyDataSetChanged() function of the adapter.

Categories : Java

How to checkout a remote branch, rebase it to local master and then merge with local master?
git remote add person git://path/to/his/repo.git git checkout -b person/master git fetch person I would rather fetch first, then checkout: git remote add person git://path/to/his/repo.git git fetch person git checkout -b person/master But one of the idea behind pull requests is that they should be applied automatically... or "put on hold" ;) In other words, the contributors ought to do the work for you, then submit an updated pull request for you to apply.

Categories : GIT

How do I pull and rebase from remote to master and rebase from master to my feature branch in one shot?
If your master is not ahead of origin/master, then you can do it with one less command, though it is admittedly a bit hacky: git fetch git push . origin/master:master git rebase master If your master is ahead of origin/master then I don't know of any faster way to do it than what you're doing. You could, of course, make an alias or shell function for it. EDIT: Cupcake's answer is definitely the best solution, and now I know that a refspec in a fetch initiates a ff merge!

Categories : GIT

iOS / Master Detail : how to pop the subdetail view when switching detail from the master controller?
OK, I added the following in the Master Controller didSelectRowAtIndexPath: [self.detailViewController.navigationController popToRootViewControllerAnimated:YES]; And it works expectedly with a push segue.

Categories : IOS

ASP.NET C# object in Master Page to be visible to all other pages that are based on that Master Page
You'd be better off creating a base page (that inherits from System.Web.UI.Page) that all your pages inherit from, add your TheUser object to the base page. Please note, pages do not inherit their master pages.

Categories : C#

Master-Detail: On row click in master (DataGrid), display details (DataGrid)
If you searched online, you would have found a number of answers. For example, please take a look at the following articles: WPF Master Details MVVM Application Implementing a simple Master-Detail scenario for WPF in MVVM MVVM - Master Detail

Categories : Wpf

Merge local master branch with remote master branch in Git
Case 1: remote/master has everything that local master has If remote/master contains all of the commits that the local master contains, simply do a git pull: git checkout master git pull remote master You can check if the local master has commits that remote/master doesn't by using the following: git fetch remote git log --oneline --graph remote/master..master That will show you all commits that are contained in master but not in remote/master. If you don't see any output, that means remote/master has everything that the local master has. Case 2: local master has commits that remote/master doesn't have If the local master contains commits that remote/master doesn't contain, you'll have to figure out how you want to handle that. Do you want to keep them and merge them with remote/m

Categories : GIT

finding master page control from another master page?
Well if there is single master page and content page you can access control using Label lblinMaster = (Label)This.Master.FindControl("Label1"); and the same way to access control in nested master page you can use following. Label lblinParentMaster = (Label)Master.Master.FindControl("Label1"); Hope this helps.

Categories : C#

Nodejs, MongoDB (node-mongodb-native). FindAndModify finds doc, but doesn't update it
In findAndModify, there is one more parameter which you can set, to return the old document(before update) or new document ( after update ). I am guessing this must be the issue. For confirmation, for the existing findAndModify() command, after this command is run, check that updated document from the mongo console, it must be changed.

Categories : Node Js

MongoDB errors: mongodb-10gen E: Sub-process /usr/bin/dpkg returned an error code (1)
This is due to some corruption within the package manager dpkg itself, this thread from Ask Ubuntu: http://askubuntu.com/questions/195950/package-system-broken-e-sub-process-usr-bin-dpkg-returned-an-error-code-1 lists some solutions, more specifically the editing of the status file has been noted as one that always works.

Categories : Linux

query based on matching elements in DBRef list for mongodb using spring-data-mongodb
Querying for one element on an array is exactly like query for a field equality. You could read the MongoDB documentation here. So your query will be: new Query(Criteria.where("users.$id").is(new ObjectId(userId)))

Categories : Mongodb

Connecting from WSO2DSS to MongoDB, receiving error: java.lang.NoClassDefFoundError: com/mongodb/ServerAddres.
The missing class looks like ServerAddress (I assume the missing "s" is a copy-paste issue) which is in the MongoDB Java driver (mongo-java-driver). Make sure mongo-java-driver-2.xx.jar is on the runtime classpath. Note that the runtime classpath is not always the same as the compile time classpath.

Categories : Mongodb

mongodb: java: How to update a field in MongoDB using expression with existing value
At the moment, MongoDB doesn't allow you to update the value of a field according to an existing value of a field. Which means, you can't do the following SQL: UPDATE foo SET field1 = field1 / 2; In MongoDB, you will need to do this in your application, but be aware that this is no longer an atomic operation as you need to read and then write.

Categories : Java

NoSQLUnit MongoDB test: Spring Data MongoDB approach
Jaranda, Seems that your spring repository and nosqlunit are working on different databases. Try to modify your spring configuration to use the same database of nosqlunit. <mongo:db-factory id="mongoDbFactory" mongo-ref="mongo" dbname="test" />

Categories : Java

Get master of one remote repository into master another remote+ one
If I understand what you're looking for - a one-time conversion, as opposed to continuous integration - this should work out. It's a bit overkill, as you could adapt it to work in your currently existing local repo, but then I'd have to make assumptions about the current state of your local repo, and this approach will help avoid conflicts due to uncommitted changes, unpushed state, etc. git init newrepo # create a new scratch space repo cd newrepo git remote add originA <url or relative path of A> # add both original repos as remotes git remote add originB <url or relative path of B> git fetch originA master # fetch the branches we want git fetch originB master git checkout -b newbranch originB/master # sta

Categories : GIT

In Git, what is the difference between origin/master vs origin master?
origin/master is the local branch representing the state of the master branch on the remote origin. origin master is the branch master on the remote origin. Example (in local branch master): git fetch # get current state of remote repository git merge origin/master # merge state of remote master branch into local branch git push origin master # push local branch master to remote branch master

Categories : GIT

MapReduce, MongoDB and node-mongodb-native
The reason why the reduce function is never called is due to you emitting a single value for each key so there is no reason for the reduce function to actually execute. Here is an example of how you trigger the reduce function collection.insert([{group: 1, price:41}, {group: 1, price:22}, {group: 2, price:12}], {w:1}, function(err, r) { // String functions var map = function() { emit(this.group, this.price); }; var reduce = function(key, values) { return Array.sum(values); }; collection.mapReduce( map, reduce, { query:{}, // sort: {'count': -1}, // limit: 10, // jsMode: true, // verbose: false, out: { inline: 1 } }, function(err, results) { console.log("----------- 0") console.dir(er

Categories : Mongodb

IIS 8 and ARR with multiple other servers
Ok so the trick was with this rewriteRule : ^(.*)/youtrack/(.*), Thanks man you really helped me. Only i have to rewrite to localhost:81/{R:2} then. Also as Malvin said there is a par wher you have to enable Application request routing in hidden menu and that was whole trick.

Categories : Iis

MultiThreaded Servers
Let me preface this with the fact that I haven't worked in Java in a long time, but I just wrote a simple client/server chat program in C#. Hopefully the concepts are all still the same. A few things I'm noticing about your Server class : You "return" from the constructor. Not sure if this is legal in Java (or a good idea), but the way it looks, it will shut down the server as soon as a client connections. For example: client makes connection, server assigns "user" to array, server returns from constructor, main exits, program terminates. I'd suggest having your constructor get everything set up, then having a "start" method that loops infinitely and adds new clients. In native code (C/C++) "accept()" blocks - I'm not sure if this is the case in Java but you can use it to your advantage

Categories : Java

How to use two servers in one sql statement?
You need to set up the remote server as a linked server using sp_addlinkedserver. Then you can refer to the remote table using the linked_server_name.catalog.schema.object_name syntax. You can find more information here.

Categories : SQL

WCF Services across servers
This depends on the binding you are using and any firewall / network route rules on and between the two machines. If you are using a namedPipeBinding, the answer is no because named pipes are bound to a machine. However, if you are using any of the other bindings like webHttp, basicHttp, etc you should be ok. The beauty of WCF is that you should be able to just spin up another service endpoint using a different binding if necessary -- so even if you are using named pipes, it should be pretty straight forward to swap that out with a different binding. A WCF service can certainly be a client to another WCF service.

Categories : C#

2 Servers 2 Different Companies
DNS failover should do what you want. If you use reasonable short TTL for your CNAME or A/AAAA records. You have to design the failover scenario: * how the primary site failure is detected * how the state of the web app is transfered to the backup location * how DNS records are changed * how is the system restored back to primary site

Categories : Misc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.