MongoDB警告信息:
1. WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 
2. WARNING: Access control is not enabled for the database. 
3. WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’. 
4. WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.

1.WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine(强烈建议使用带WiredTiger存储引擎的XFS文件系统)

报这个错是因为我的虚拟环境使用的是EXT4文件系统,官方不建议,但不影响使用

在Linux上运行MongoDB时,官方建议使用Linux内核版本2.6.36或更高版本,使用XFS或EXT4文件系统。 如果可能,最好使用XFS,因为它通常与MongoDB表现更好。

使用WiredTiger存储引擎,强烈建议使用XFS,以避免在使用EXT4与WiredTiger时可能发生的性能问题。

使用MMAPv1存储引擎,MongoDB在使用它们之前预先分配其数据库文件,并经常创建大文件。 因此,官方建议使用XFS或EXT4文件系统。 如果可能,请使用XFS,因为它通常与MongoDB表现更好。

2.WARNING: Access control is not enabled for the database.(数据库未启用访问控制)

报这个错是因为MongoDB需要有一个安全库来开启数据库访问控制

在MongoDB部署上启用访问控制会强制执行身份验证,要求用户识别自己。当访问启用了访问控制的MongoDB部署时,用户只能执行由其角色确定的操作。

  • 不使用访问控制模式开启mongdb
root@localhost ~]# mongod --dbpath /var/lib/mongo
--27T03::14.853+ I CONTROL [initandlisten] MongoDB starting : pid= port= dbpath=/var/lib/mongo -bit host=localhost.localdomain
--27T03::14.853+ I CONTROL [initandlisten] db version v3.4.9
--27T03::14.853+ I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
--27T03::14.853+ I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips Feb
--27T03::14.853+ I CONTROL [initandlisten] allocator: tcmalloc
--27T03::14.853+ I CONTROL [initandlisten] modules: none
--27T03::14.853+ I CONTROL [initandlisten] build environment:
--27T03::14.853+ I CONTROL [initandlisten] distmod: rhel70
--27T03::14.853+ I CONTROL [initandlisten] distarch: x86_64
--27T03::14.853+ I CONTROL [initandlisten] target_arch: x86_64
--27T03::14.853+ I CONTROL [initandlisten] options: { storage: { dbPath: "/var/lib/mongo" } }
--27T03::14.971+ I - [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
--27T03::14.971+ I STORAGE [initandlisten]
--27T03::14.971+ I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
--27T03::14.971+ I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
--27T03::14.971+ I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1455M,session_max=,eviction=(threads_min=,threads_max=),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=),checkpoint=(wait=,log_size=2GB),statistics_log=(wait=),
--27T03::16.364+ I CONTROL [initandlisten]
--27T03::16.364+ I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
--27T03::16.364+ I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
--27T03::16.364+ I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
--27T03::16.364+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
--27T03::16.365+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::16.365+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
--27T03::16.365+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::16.365+ I CONTROL [initandlisten]
--27T03::16.634+ I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data'
--27T03::16.635+ I NETWORK [thread1] waiting for connections on port
--27T03::33.704+ I NETWORK [thread1] connection accepted from 127.0.0.1: # ( connection now open)
--27T03::33.705+ I NETWORK [conn1] received client metadata from 127.0.0.1: conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.9" }, os: { type: "Linux", name: "CentOS Linux release 7.3.1611 (Core) ", architecture: "x86_64", version: "Kernel 3.10.0-514.26.2.el7.x86_64" } }
--27T03::15.311+ I COMMAND [conn1] command admin.system.users appName: "MongoDB Shell" command: insert { insert: "system.users", documents: [ { _id: "admin.myUserAdmin", user: "myUserAdmin", db: "admin", credentials: { SCRAM-SHA-: { iterationCount: , salt: "pUdmLObMsG3wKU7MZDFU1g==", storedKey: "wlCaAzPOS+u7CUqzMKxeZB+DFkE=", serverKey: "KwP12FF1ASziFPVstN8mLrPLg+A=" } }, roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] } ] } ninserted: keysInserted: numYields: reslen: locks:{ Global: { acquireCount: { r: , w: } }, Database: { acquireCount: { W: } }, Collection: { acquireCount: { w: } } } protocol:op_query 145ms
--27T03::15.311+ I COMMAND [conn1] command admin.$cmd appName: "MongoDB Shell" command: createUser { createUser: "myUserAdmin", pwd: "xxx", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 600000.0 } } numYields: reslen: locks:{ Global: { acquireCount: { r: , w: } }, Database: { acquireCount: { W: } }, Collection: { acquireCount: { w: } } } protocol:op_command 202ms
  • 连接到instance
[root@localhost ~]# mongo
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.
Server has startup warnings:
--27T03::14.971+ I STORAGE [initandlisten]
--27T03::14.971+ I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
--27T03::14.971+ I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
--27T03::16.364+ I CONTROL [initandlisten]
--27T03::16.364+ I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
--27T03::16.364+ I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
--27T03::16.364+ I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
--27T03::16.364+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
--27T03::16.365+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::16.365+ I CONTROL [initandlisten]
--27T03::16.365+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
--27T03::16.365+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::16.365+ I CONTROL [initandlisten]
>
  • 在admin数据库中创建administrator 用户
> use admin
switched to db admin
> db.createUser(
... {
... user: "myUserAdmin",
... pwd: "abc123",
... roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
... }
... )
Successfully added user: {
"user" : "myUserAdmin",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}
> exit
bye
  • 重启Mongodb
使用Ctrl+c退出原mongod

q^H
^C2017--27T03::25.685+ I CONTROL [signalProcessingThread] got signal (Interrupt), will terminate after current cmd ends
--27T03::25.685+ I NETWORK [signalProcessingThread] shutdown: going to close listening sockets...
--27T03::25.685+ I NETWORK [signalProcessingThread] closing listening socket:
--27T03::25.685+ I NETWORK [signalProcessingThread] closing listening socket:
--27T03::25.685+ I NETWORK [signalProcessingThread] removing socket file: /tmp/mongodb-.sock
--27T03::25.685+ I NETWORK [signalProcessingThread] shutdown: going to flush diaglog...
--27T03::25.685+ I FTDC [signalProcessingThread] Shutting down full-time diagnostic data capture
--27T03::25.687+ I STORAGE [signalProcessingThread] WiredTigerKVEngine shutting down
--27T03::25.770+ I STORAGE [signalProcessingThread] shutdown: removing fs lock...
--27T03::25.770+ I CONTROL [signalProcessingThread] now exiting
--27T03::25.770+ I CONTROL [signalProcessingThread] shutting down with code:
  • 开启访问控制启动Mongod
[root@localhost ~]# mongod --auth --dbpath /var/lib/mongo
--27T03::40.034+ I CONTROL [initandlisten] MongoDB starting : pid= port= dbpath=/var/lib/mongo -bit host=localhost.localdomain
--27T03::40.034+ I CONTROL [initandlisten] db version v3.4.9
--27T03::40.034+ I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
--27T03::40.034+ I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips Feb
--27T03::40.034+ I CONTROL [initandlisten] allocator: tcmalloc
--27T03::40.034+ I CONTROL [initandlisten] modules: none
--27T03::40.034+ I CONTROL [initandlisten] build environment:
--27T03::40.034+ I CONTROL [initandlisten] distmod: rhel70
--27T03::40.034+ I CONTROL [initandlisten] distarch: x86_64
--27T03::40.034+ I CONTROL [initandlisten] target_arch: x86_64
--27T03::40.034+ I CONTROL [initandlisten] options: { security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo" } }
--27T03::40.054+ I - [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
--27T03::40.054+ I STORAGE [initandlisten]
--27T03::40.054+ I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
--27T03::40.054+ I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
--27T03::40.054+ I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1455M,session_max=,eviction=(threads_min=,threads_max=),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=),checkpoint=(wait=,log_size=2GB),statistics_log=(wait=),
--27T03::40.420+ I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
--27T03::40.420+ I CONTROL [initandlisten]
--27T03::40.420+ I CONTROL [initandlisten]
--27T03::40.420+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
--27T03::40.420+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::40.420+ I CONTROL [initandlisten]
--27T03::40.420+ I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
--27T03::40.420+ I CONTROL [initandlisten] ** We suggest setting it to 'never'
--27T03::40.420+ I CONTROL [initandlisten]
--27T03::40.422+ I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data'
--27T03::40.422+ I NETWORK [thread1] waiting for connections on port
--27T03::07.458+ I NETWORK [thread1] connection accepted from 127.0.0.1: # ( connection now open)
--27T03::07.458+ I NETWORK [conn1] received client metadata from 127.0.0.1: conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.9" }, os: { type: "Linux", name: "CentOS Linux release 7.3.1611 (Core) ", architecture: "x86_64", version: "Kernel 3.10.0-514.26.2.el7.x86_64" } }
--27T03::07.477+ I ACCESS [conn1] Successfully authenticated as principal myUserAdmin on admin
--27T03::07.478+ I ACCESS [conn1] Unauthorized: not authorized on admin to execute command { getLog: "startupWarnings" }
--27T03::07.665+ I ACCESS [conn1] Unauthorized: not authorized on admin to execute command { replSetGetStatus: 1.0, forShell: 1.0 }
--27T03::26.104+ I - [conn1] end connection 127.0.0.1: ( connection now open)
--27T03::29.697+ I NETWORK [thread1] connection accepted from 127.0.0.1: # ( connection now open)
--27T03::29.697+ I NETWORK [conn2] received client metadata from 127.0.0.1: conn2: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.9" }, os: { type: "Linux", name: "CentOS Linux release 7.3.1611 (Core) ", architecture: "x86_64", version: "Kernel 3.10.0-514.26.2.el7.x86_64" } }
--27T03::29.713+ I ACCESS [conn2] Successfully authenticated as principal myTester on test
--27T03::29.714+ I ACCESS [conn2] Unauthorized: not authorized on admin to execute command { getLog: "startupWarnings" }
--27T03::29.715+ I ACCESS [conn2] Unauthorized: not authorized on admin to execute command { replSetGetStatus: 1.0, forShell: 1.0 }
  • 刚刚新建的用户myUserAdmin连接数据
[root@localhost ~]# mongo --port  -u "myUserAdmin" -p "abc123" --authenticationDatabase "admin"
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/
MongoDB server version: 3.4.
>
创建新数据库test并在其中创建用户myTester

> use test
switched to db test
> db.createUser(
... {
... user: "myTester",
... pwd: "xyz123",
... roles: [ { role: "readWrite", db: "test" },
... { role: "read", db: "reporting" } ]
... }
... )
Successfully added user: {
"user" : "myTester",
"roles" : [
{
"role" : "readWrite",
"db" : "test"
},
{
"role" : "read",
"db" : "reporting"
}
]
}
> exit
bye
  • 使用新建的myTester用户连接数据库
[root@localhost ~]# mongo --port  -u "myTester" -p "xyz123" --authenticationDatabase "test"
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/
MongoDB server version: 3.4.

3.WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.与4.WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.

这两个问题是CentOS7特有的,因为从CentOS7版本开始会默认启用Transparent Huge Pages(THP) 
Transparent Huge Pages(THP)本意是用来提升内存性能,但某些数据库厂商还是建议直接关闭THP(比如说Oracle、MariaDB、MongoDB等),否则可能会导致性能出现下降。

  • 查看THP状态
[root@localhost ~]#  cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
[root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
  • 修改系统配置
[root@localhost ~]# vim /etc/rc.d/rc.local

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi [root@localhost ~]# chmod +x /etc/rc.d/rc.local
  • 重启虚拟机
[root@localhost ~]# shutdown -r
  • 再次查看THP状态
[root@localhost ~]#  cat /sys/kernel/mm/transparent_hugepage/defrag
always madvise [never]
[root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

已经改为了禁用THP

  • 启动mongod
[root@localhost ~]# mongod --auth --dbpath /var/lib/mongo
--27T03::50.174+ I CONTROL [initandlisten] MongoDB starting : pid= port= dbpath=/var/lib/mongo -bit host=localhost.localdomain
--27T03::50.175+ I CONTROL [initandlisten] db version v3.4.9
--27T03::50.175+ I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
--27T03::50.175+ I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips Feb
--27T03::50.175+ I CONTROL [initandlisten] allocator: tcmalloc
--27T03::50.175+ I CONTROL [initandlisten] modules: none
--27T03::50.175+ I CONTROL [initandlisten] build environment:
--27T03::50.175+ I CONTROL [initandlisten] distmod: rhel70
--27T03::50.175+ I CONTROL [initandlisten] distarch: x86_64
--27T03::50.175+ I CONTROL [initandlisten] target_arch: x86_64
--27T03::50.175+ I CONTROL [initandlisten] options: { security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo" } }
--27T03::50.195+ I - [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
--27T03::50.195+ I STORAGE [initandlisten]
--27T03::50.195+ I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
--27T03::50.195+ I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
--27T03::50.195+ I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1455M,session_max=,eviction=(threads_min=,threads_max=),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=),checkpoint=(wait=,log_size=2GB),statistics_log=(wait=),
--27T03::50.689+ I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
--27T03::50.689+ I CONTROL [initandlisten]
--27T03::50.692+ I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data'
--27T03::50.693+ I NETWORK [thread1] waiting for connections on port
  • 进入数据库
[root@localhost ~]# mongo
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.
>

MongoDB警告信息的更多相关文章

  1. VS SuppressMessage忽略特定方法的警告信息

    VS在编译源码的时候有很多警告信息,有些时候 我们需要忽略一个特定方法的特定警告信息,于是就用SuppressMessage特性,可是这个特性的参数不太好搞定,还好有VS,Suppressing Co ...

  2. 解决log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader)警告信息的问题

    spring项目经常在启动tomcat时报如下警告信息: log4j:WARN No appenders could be found for logger (org.springframework. ...

  3. 查看MySQL的警告信息

    在王MySQL数据库导入数据的时候经常会出现警告,这些警告很容易被忽视,今天到数据的时候突然想看看警告的内容是什么,百度了一下mysql查看警告的命令 show warnings; 命令很简明,一查看 ...

  4. MySQL 5.6 警告信息 command line interface can be insecure 修复

    在命令行输入密码,就会提示这些安全警告信息. Warning: Using a password on the command line interface can be insecure.   注: ...

  5. Xcode中报错或警告信息整理,持续更新...

     整理报错和警告信息,为以后自己查看方便用! [报错1] 信息:Static table views are only valid when embedded in UITableViewContro ...

  6. 在Xcode中如何屏蔽某个源文件的编译警告信息

    某些时候如果我们的源码在编译过程中出现大量的编译警告时,看起来是挺不爽的:但又确实没办法解决警告问题的时候,我们可以使用下面的方法来屏蔽指定的某个文件的所有警告信息. 1.在Xcode中选中工程文件. ...

  7. paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt

    paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http:// ...

  8. 将Linux下编译的warning警告信息输出到文件中[整理笔记]

    Linux中,脚本语言环境中,即你用make xxx即其他一些普通linux命令,比如ls,find等,不同的数字,代表不同的含义: 数字 含义 标准叫法0 标准输入  stdin = standar ...

  9. Redis服务器启动之后3个警告信息的解决方案

    今天是年前最后一篇文章了,不想写太多的东西,就写一些有关Redis相关问题的解决方案.当我们启动了Redis服务器之后,会看到3个警告,如果没看到,那是很好的,但是我看到了.看到了就不能不管,所以就好 ...

随机推荐

  1. HHVM 3.0 发布,执行 PHP 的虚拟机

    HHVM 详细介绍 HipHop VM(HHVM)是Facebook推出的用来执行PHP代码的虚拟机,它是一个PHP的JIT(Just-In- Time)编译器,同时具有产生快速代码和即时编译的优点. ...

  2. Memcache 服务管理脚本

    自定义脚本将memcached作为系统服务启动以及开机启动. 一.编写脚本 在/etc/init.d/目录下新建一个脚本,名称为:memcached.内容如下: vi /etc/init.d/memc ...

  3. 用JavaScript添加选择按钮的背景颜色和juqery添加选择按钮的背景色

    在项目开发中经常遇到要选择的按钮,选择完之后被选择的按钮的背景色会发生变化,表示被选择 样式图如下: 每点击一个数字,相应的背景色变为蓝色,其他的依旧是白色,先用JavaScript实现 html代码 ...

  4. 【HDU5469】Antonidas(点分治,字符串哈希)

    [HDU5469]Antonidas(点分治,字符串哈希) 题面 HDU Vjudge 题解 啊哈?什么垃圾一眼点分治+Hash判断,哈哈哈哈哈,让我来码码码. 诶,怎么WA了.改改改改改. 诶,怎么 ...

  5. BZOJ3601 一个人的数论 【数论 + 高斯消元】

    题目链接 BZOJ3601 题解 挺神的 首先有 \[ \begin{aligned} f(n) &= \sum\limits_{x = 1}^{n} x^{d} [(x,n) = 1] \\ ...

  6. 使用LD_Preload的Linux权限升级技巧

      0x00 前言 共享库是程序在启动时加载的库.正确安装共享库后,之后启动的所有程序将自动使用新的共享库. 0x01 共享库名称 每个共享库都有一个名为soname的特殊名称.soname有前缀li ...

  7. 《Linux内核设计与实现》学习总结 Chap18

    一.准备开始 1.一个确定的bug,但大部分bug通常都不是行为可靠且定义明确的. 2.一个藏匿bug的内核版本. 3.相关内核代码的知识和运气. 二.内核中的bug 1.bug的表象: 明白无误的错 ...

  8. Javascript/jQuery关于JSON或数组集合的几种循环方法

    JavaScript遍历JSON或数组集合: /** * 根据json数据生成option树形控件 * 如果有children节点则自动生成树形数据 * @param {JSON} data * @p ...

  9. js中apply(thisArg, [argsArray])的参数与ArrayLike的关系

    你是否写过或见到过这样的代码 xx.apply(this,slice.call(arguments)) //slice.call转为数组是否多余 mdn地址 msdn地址 一.微软和mdn对参数的介绍 ...

  10. Luogu1309 瑞士轮(分治,归并排序)

    Luogu1309 瑞士轮(分治,归并排序) Description 在双人对决的竞技性比赛,如乒乓球.羽毛球.国际象棋中,最常见的赛制是淘汰赛和循环赛.前者的特点是比赛场数少,每场都紧张刺激,但偶然 ...