I got following error while connectiong to mongodb
MongoDB shell version: 1.6.5
connecting to: test Mon Jan 31
12:12:09 Error: couldn't connect to
server 127.0.0.1 (anon):1154
exception: connect failed
I removed mongodb and re-install mongodb-stable It works fine for that day and next day got above error again.
Few times I tried to re-install mongodb-stable still getting same error.
I am using latest pkg
deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen
I tried another way i.e tried to connect to other machines mongodb i.e mongo otherMachinseIPAddress
mongo connection done successfully
But when i execute my program I got following error
WARNING: jmx registration error, continuing javax.management.InstanceAlreadyExistsException: com.mongodb:type=ConnectionPool,host=tushar-desktop/127.0.1.1_27017 at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:467) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1520) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:986) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:938) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:330) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:516) at com.mongodb.DBPortPool$Holder.get(DBPortPool.java:62) at com.mongodb.DBTCPConnector._set(DBTCPConnector.java:458) at com.mongodb.DBTCPConnector.(DBTCPConnector.java:46) at com.mongodb.Mongo.(Mongo.java:137) at com.mongodb.Mongo.(Mongo.java:123) at com.mongodb.Mongo.(Mongo.java:90) at com.info.link.server.LinkedinServiceImpl.(LinkedinServiceImpl.java:40) at com.info.link.server.LinkedinServiceImpl$$FastClassByGuice$$d7de1b7.newInstance() at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793) at com.info.link.server.cache.CacheHelper.(CacheHelper.java:30) at com.info.link.server.cache.CacheHelper$$FastClassByGuice$$35d2e084.newInstance() at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793) at com.info.link.server.services.impl.CachingServiceImpl.(CachingServiceImpl.java:32) at com.info.link.server.services.impl.CachingServiceImpl$$FastClassByGuice$$de537f14.newInstance() at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793) at com.info.link.server.services.impl.LenseServiceImpl.(LenseServiceImpl.java:37) at com.info.link.server.services.impl.LenseServiceImpl$$FastClassByGuice$$21e1222c.newInstance() at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) at com.google.inject.FactoryProxy.get(FactoryProxy.java:56) at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793) at com.info.link.server.callbacks.LenseCallbackImpl.(LenseCallbackImpl.java:30) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153) at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463) at org.mortbay.jetty.s开发者_如何学Goervlet.ServletHandler.handle(ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Please help me.
The mongod process is clearly not started. Try executing:
service mongodb start
Then try connecting again.
Your mongod
process is not running.
In one terminal window start mongo with:
$ mongod
Then connect to the mongo sheep with:
$ mongo
精彩评论