Mongodb升级问题

时间:2015-10-19 09:22:36

标签: linux mongodb

我已将MONGODB版本从2.6.7升级到3.0.3。

当我运行以下命令时

./mongod --dbpath database --storageEngine wiredTiger

获得输出,

2015-10-19T14:47:04.936+0530 I CONTROL  [initandlisten] MongoDB starting : pid=22642 port=27017 dbpath=database 64-bit host=inkilab-Vostro-2520
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] 
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] 
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] 
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] db version v3.0.0
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] git version: a841fd6394365954886924a35076691b4d149168
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] build info: Linux ip-10-179-177-12 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] allocator: tcmalloc
2015-10-19T14:47:04.937+0530 I CONTROL  [initandlisten] options: { storage: { dbPath: "database", engine: "wiredTiger" } }
2015-10-19T14:47:04.963+0530 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2015-10-19T14:47:04.963+0530 E NETWORK  [initandlisten]   addr already in use
2015-10-19T14:47:05.203+0530 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2015-10-19T14:47:27.542+0530 I CONTROL  [initandlisten] now exiting
2015-10-19T14:47:27.543+0530 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2015-10-19T14:47:27.543+0530 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2015-10-19T14:47:27.543+0530 I NETWORK  [initandlisten] shutdown: going to close sockets...
2015-10-19T14:47:27.600+0530 I STORAGE  [initandlisten] WiredTigerKVEngine shutting down
2015-10-19T14:47:49.491+0530 I STORAGE  [initandlisten] shutdown: removing fs lock...
2015-10-19T14:47:49.518+0530 I CONTROL  [initandlisten] dbexit:  rc: 48

请帮帮我。

1 个答案:

答案 0 :(得分:0)

bindIp错误表示您已在默认端口上运行服务。要覆盖,您必须先停止或删除该服务并再次启动mongod。

为了终止默认端口上的服务,您可以尝试以下命令:

Dim reader As SqlDataReader
Dim cmd As New SqlCommand("SELECT * FROM [UserDetail].[User] where UserName =@username and UserPass=@password", con)
cmd.Parameters.AddWithValue("@username", login_username.Text)
cmd.Parameters.AddWithValue("@password", hash_pass)
reader = cmd.ExecuteReader()
Dim strStatus as String = ""
If reader.HasRows Then
    reader.Read()
    strStatus = reader.Item("status").ToString
End If

这将为您提供当前实例,如果任何服务的名称如“mongo”,或解释为服务,如'mongo%'。现在你必须杀死默认端口上的跟踪,这可以使用shell中的kill命令来完成。如需帮助,请输入:

Dim cmd As New SqlCommand("SELECT * FROM [UserDetail].[User] where UserName =@username and UserPass=@password", con)
cmd.Parameters.AddWithValue("@username", login_username.Text)
cmd.Parameters.AddWithValue("@password", hash_pass)
Dim da As SqlDataAdapter = New SqlDataAdapter()
Dim dt As DataTable = New DataTable("TableA")
da.SelectCommand = cmd
da.Fill(dt)
Dim strStatus as String = ""
'you can process the DataTable in a for/for each loop or process a single row as follows
If dt.Rows.Count > 0 Then
    strStatus = dt.Rows(0).Item("status").ToString()
End If

或者,您可以使用-p或--port开关

在新分配的端口上启动mongod