w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Creating a Mongodb replicaset in an AWC VPC
see "Updating DNS Support for Your VPC" at http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html It's likely your VPC was created before the DNS Hostname support flag was available. Set it to True.

Categories : Mongodb

How do I configure mongodb replicaset using elastic IP's in EC2?
You should never use an Elastic IP for internal traffic like replication. You will be charged $0.01/GB for this traffic, whereas using the internal IP would be free. If you're using something like replica sets, you really should be running in a VPC. Unlike normal EC2 instances, instances in an VPC keep the same private IP addresses and Elastic IP addresses even when stopped.

Categories : Mongodb

mongodb: how to check which node I connected on replicaSet
1) use mongostat command, which will tell you how many different operations ( query, insert, update, delete, command, etc ) are coming to the server You will find that primary is not getting any 'query' operation but secondaries will. mongostat -u<user-name> -p<password> 2) Use mongosniff, to know the queries coming to the server

Categories : Java

MongoDB as windows service and setting up replicaSet
You can set up replica set and MongoDB service at the same time on Windows. Since you have already set up a replica set, you are aware that you need to have a data directory and a log file for each replica set member. If you are running all replica set members on a single machine, each replica set member must be assigned a different port number. The sample provided is for development or functional testing only. Setting up all replica set members on a single machine will constitute a single point of failure in addition to being a total performance drag. Create a configuration file for each replica set member including data directory, log file, port number, and replica set name. For example, I have a replica set of 3 members, one primary Mongodb running on port 27017 and two secondary,

Categories : Mongodb

MongoDB ReplicaSet on windows azure - Sockect exception error
This is old, but just in case someone else stumbles across this. You need to set the TCP/IP keep alive times different from the stock Linux configuration if you are running under Azure: echo 45 > /proc/sys/net/ipv4/tcp_keepalive_time echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl echo 20 > /proc/sys/net/ipv4/tcp_keepalive_probes

Categories : Mongodb

configuration file inb mongoDB
It seems to me that similar problem was asked at Jelastic community here. The problem is resolved for that user, please pay your attention to the suggestions stated at that thread.

Categories : Java

mongodb configuration file issue on Mac OS X
Found the problem. The file was using a CR (Classic Mac) delimiter instead of LF (Unix) delimiter. Looks like these files need to use Unix format. I re-saved the file using Unix format and now it works.

Categories : Mongodb

Spring data MongoDb configuration
I suspect that you may have an authentication issue, try specifying the credentials of your mongodb when configuring your db-factory. I have added my configuration below to clarify <mongo:mongo host="127.0.0.1" port="27017" /> <mongo:db-factory id="mongoDbFactory" dbname="${db.name}" username="${db.username}" password="${db.password}"/> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> </bean>

Categories : Mongodb

Spring MongoDB XML Configuration with credentials fails
Just in case anyone else comes across this issue... I was using spring-data-mongodb version 1.2.1-RELEASE. I upgraded to 1.3.0.M1 (currently the most recent milestone build) and the issue went away. Just as an FYI... I was having write problems with the writeConcern set to FSYNC_SAFE: <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongo" ref="mongo"/> <constructor-arg name="databaseName" value="${mongo.db}"/> <constructor-arg name="userCredentials" ref="mongoCredentials"/> <property name="writeConcern" value="FSYNC_SAFE"/> </bean> so I changed it to the following and it's finally working: <property name="writeConcern"> <util:constant static-field="com.mongo

Categories : Xml

ZF2 - Doctrine2 MongoDB ODM - "The class was not found in the chain configuration namespaces"
My configuration had become a bit confused, as it turns out. I was able to correct the issue with the following configuration code. 'driver' => array( 'odm_driver' => array( 'class' => 'DoctrineODMMongoDBMappingDriverAnnotationDriver', 'paths' => array(__DIR__ . '/../../module/Application/src/Application/Document') ), 'odm_default' => array( 'drivers' => array( 'ApplicationDocument' => 'odm_driver' ) ), ), NB: The included code for ApplicationDocumentUser also produces errors, corrected with the following code. namespace ApplicationDocument; use DoctrineODMMongoDBMappingAnnotations as ODM; /** @ODMDocument */ class User { // ... }

Categories : PHP

Struggling with Play.current.configuration.getStringList("mongodb.replicaSetSeeds") Option handling
Give this a shot: import collection.JavaConversions._ val optList:Option[List[String]] = Play.current.configuration.getStringList("mongodb.replicaSetSeeds").map(_.toList) val list = optList.getOrElse(List("localhost")) There are multiple things going on here. First, you need to import the JavaConversions implicits because what's being returned is an Option[java.util.List[String]] and we want that to be a scala List instead. By doing the map(_.toList), I'm forcing the implicit conversion to kick in and get me an Option[List[String]] and from there things are pretty straight forward.

Categories : Scala

How can we know that how many nodes we need inside a Replicaset?
There is no exact answer to your question, but considering following factors can be useful: the volume of data you need to store average load on your server the peak load on your server what is the application access patters total number of indexes you have / need what is the percent of queries that can be processed using indexes. willingness to read from secondaries. You can run benchmarking based on some dummy data and figure out the the best solution for your use case. Hope this helps!

Categories : Mongodb

pymongo MongoClient connect to ReplicaSet
The MongoClient class only connects to a single host, as the documentation (http://api.mongodb.org/python/current/api/pymongo/mongo_client.html) says: Create a new connection to a single MongoDB instance at host:port. You need to use the MongoReplicaSetClient class that you've already discovered to work with a Replica Set.

Categories : Mongodb

EF Code First Configuration of shared Base Class --> Single Configuration File
Try it like below but I didnt test it .However if I were you, I wouldnt design Audit tables this way class AuditableModelBaseMap : EntityTypeConfiguration<AuditableModelBase> { public AuditableModelBaseMap () { this.HasRequired(amb => amb.CreatedByUserProfile).WithMany().HasForeignKey(amb => amb.CreatedByUserId).WillCascadeOnDelete(false); this.HasRequired(amb => amb.UpdatedByUserProfile).WithMany().HasForeignKey(amb => amb.UpdatedByUserId).WillCascadeOnDelete(false); } } THIS IS MY WAY OF Doing AUDITING public interface IEntity { int Id { get; set; } } public interface IAuditable : IEntity { string UpdatedBy { get; set; }

Categories : C#

Is there a way to obtain a Configuration object from a configuration file in the isolated storage?
Why can't you get the absolute path to the files in Isolated Storage? Take a look at the Can I get a path for a IsolatedStorage file and read it from external applications? post to find out how you can do this. If that doesn't work for you, take a look at the IsolatedStorageFile Class page at MSDN which features examples of manipulating files in IsolatedStorage.

Categories : Wpf

static library builds in debug configuration but not in release configuration
For your project target Build Settings, look for "Search Paths->Header Search Path". Compare your Release and Debug settings here. Also look into the "Build Location" for the library project for Release and Debug.

Categories : IOS

what is active solution configuration in vs 2012 configuration manager?
my understanding is it should use the QA web.config file. am i wrong? Actually you are wrong. web.QA.config will be used only when you publish your application but not while running it in Visual Studio where the standard web.config is always used.

Categories : Visual Studio 2010

log4j.properties configuration issues along with ant configuration
for ant i added: <path id="properties"> <dirset dir="${config.dir}"/> </path> where ${config.dir} is the path to the /src/config folder where the log4j.properties exists. Still working on getting eclipse to work, it shouldnt be too different with classpaths in eclipse. Thanks!

Categories : Java

Rspec spec_helper configuration issue: undefined method `syntax=' for # (NoMethodError)
The ability to execute the configuration option you specified (i.e. `mocks.syntax) is a recently added feature, introduced in RSpec 2.14.0, so you'll get this error until you upgrade to this version or later. As for the VCR warning, it seems to have been addressed by the latest version of VCR available at github (July 26, 2013), which advertises support through WebMock 1.13. However, the latest released version (2.5.0) is from May, so you'll just have to live with this warning unless you want to pull VCR directly from github.

Categories : Ruby On Rails

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

How to refer to one configuration variable from other configuration variable inside Config.groovy
You need to declare a variable: def rootVar = 'a' grails.variable1 = rootVar grails.varibale2 = "${rootVar}bc" Or you might be able to do it via a closure (not tested): grails.variable1 = 'a' grails.varibale2 = { -> "${grails.variable1}bc" }()

Categories : Grails

Enable/disable a admin configuration of a module based on other configuration of other module
No, but you can make your own source model to achieve this. Anyway, why don't you just check if module B is enabled when testing the same thing for module A ? So your condition would be induced by your code, and not by some system config fields that would not be really safe regarding what you want to do (you could enable module A when module B is also enabled, but then what would happen if module B gets disabled later ?)

Categories : Magento

visual studio, build configuration: how to make a build configuration that is based on another
Here's an example for using different preprocessor definitions. You'll have to manually edit the project file. I suggest you do this in VS itself since it has syntax highlighting and autocomplete for it. In a normal csproj file, the properties for the Debug|AnyCPU config are defined like this (1): <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>false</Optimize> <OutputPath>binDebug</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> Say you want to reuse everything except DefineCo

Categories : Visual Studio

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

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

Jenkins email configuration - Test email configuration succeeds but email is not recieved by user
In order to get this to work, a valid email must be entered into the "System Admin e-mail address" field. That field is on the same page but is located in another section higher up. Without doing so, I too received a message that the email was successfully sent but I never received it. Once I set it, the test emails started to be received properly.

Categories : Jenkins

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

I have a query in mongodb and the reference key's are in hashmap list , I need to process a simple query using java in mongodb
When you post code, it helps if you indent it, so it is more readable. As I mentioned to you on another forum, you need to go back and review the Java collection classes, since you have multiple usage errors in the above code. Here are a few things you need to do to clean up your code: 1) You don't need to use the itkey iterator. Instead, use: for (String key : likey) and get rid of all the itkey.next calls. Your current code only processes every second element of the List. The other ones are printed out. 2) Your HashMap will map a key to a Boolean. Is that what you want? You said you want to count the number of non-zero values for the key. So, the line: Boolean listone = table.distinct(keys).contains(nullvalue); is almost certainly in error. 3) When you iterate over the Ha

Categories : Java

Mongodb : find documents including references to sub-documents [node-mongodb-native]
MongoDB doesn't support joins so you have to query for the User details separately. If you're using node.js, Mongoose provides a populate feature to help simplify this so you can do something like the following to pull in the user details: Files.find().populate('Users_id')

Categories : Mongodb

Translating MongoDB query to a MongoDB java driver query
I haven't checked the syntax. Also I don't know if your query works or not but here's my try. //unwind DBObject unwind = new BasicDBObject("$unwind", "$scorearray"); // Now the $group operation DBObject groupFields = new BasicDBObject("player", "$player"); groupFields.put("venue", "$scorearray.venue")); groupFields.put("score", "$scorearray.score")); DBObject group = new BasicDBObject("$group", new BasicDBObject("_id", groupFields)); //sort DBObject sort = new BasicDBObject("$sort", new BasicDBObject("_id.score":1)); //secondgroup DBObject secondGroupFields = new BasicDBObject("_id", "$_id.player") secondGroupFields.put("maxScore", new BasicDBObject("$last":"$_id.score")); secondGroupFi

Categories : Mongodb

WCF configuration help - can't get it right
Please check this links AddressFilter mismatch at the EndpointDispatcher - the msg with To and Resolving Configuration Error in WCF AddressFilter Mismatch and http://social.msdn.microsoft.com/Forums/vstudio/en-US/b5ae495b-f5fb-4eed-ae21-2b2280d4fec3/address-filter-mismatch-wcf-addressing I think this might helps you

Categories : Wcf

Waf configuration in ns-3
I have just found the problem.It has turned out that this is an error caused by the configuration file of the corresponding wscript file (wscript file of lte module). In this file I needed to add up the openflow module as a source module of the lte module by modifying build method like module = bld.create_ns3_module('lte', ['<another modules>','openflow']) With that way now the waf build system is able to include the openflow module as a source path.

Categories : C++

Using Configuration in PHP
Maybe use error_log? http://de3.php.net/manual/en/function.error-log.php Then you can specify the destination: bool error_log ( string $message [, int $message_type = 0 [, string $destination [, string $extra_headers ]]] ) EDIT: Or you could use syslog: http://www.php.net/manual/en/function.syslog.php then your logs will just go to syslog instead of myScriptLog (depends what you need). Does that help?

Categories : PHP

App crashes on configuration changes
This is not my answer but OP's, which was posted in the question itself. I've moved it into this community wiki answer and taken the liberty to "improve" it a bit. I have found this to be due to ProgressDialog and running the AsyncTask while a configuration change was made. To fix this, I ended up using an IntentService instead now.

Categories : Android

Get all configuration from a namespace
You need to reference the actual file name. Try something like this. $app['config']->get('mission::config'); In this case config is referring to the file, so it should return the entire array.

Categories : Laravel

What are the necessary settings for "git configuration"?
It's telling you literally, exactly what to do. Open a Terminal session, and run this, replacing 'you@example.com' with your email address: git config --global user.email "you@example.com" This sets your email address for git, it uses this to identify who you are in commits. Then, run this, replacing 'Your Name' with your name: git.config --global user.name "Your Name" This sets your name for git commit messages, it uses this to give a more readable name to commits. If this stuff is not clear to you, you really owe it to yourself to learn git: http://try.github.io

Categories : Xcode

Best configuration for spring 3.2.3
In my experience, as long as you don't have any specific reasons to separate core configuration from webapp confiiguration, the best approach is to keep DispatcherServlet's context empty and put everything into the root application context (applicationContext.xml, etc). By doing so you can avoid many possible problems, in particular: Post-processors such as <tx:annotation-driven> should be declared at per-context basis (that's your problem). If you have no beans in servlet's context, you don't need to duplicate these declarations there Declaring <context:component-scan> for the same package in both contexts can cause serious problems with duplicated bean definitions If you worry about manageability of a single monolithic context, remember that you still can split it into m

Categories : Spring



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