Mongodb error solutions

Mongodb error solutions

Mongodb error solutions

suo.li
Mongodb 报错案例 案例1 command [root@xxxxx]# /opt/mongodb-3.2.10/bin/mongoimport --host xxxxx --port 20000 --collection user_week_activity --db cake --type json --upsert --file /home/suo.li/result.json -vv error using upsert fields: [_id] 2021-07-23T17:34:59.801+0800 using 2 decoding workers 2021-07-23T17:34:59.801+0800 using 1 insert workers 2021-07-23T17:34:59.801+0800 filesize: 4611622 bytes 2021-07-23T17:34:59.801+0800 using fields: 2021-07-23T17:34:59.804+0800 connected to: xxxxx:20000 2021-07-23T17:34:59.804+0800 ns: cake.user_week_activity 2021-07-23T17:34:59.804+0800 connected to node type: mongos 2021-07-23T17:34:59.804+0800 using write concern: w='majority', j=false, fsync=false, wtimeout=0 2021-07-23T17:34:59.806+0800 using write concern: w='majority', j=false, fsync=false, wtimeout=0 2021-07-23T17:34:59.806+0800 Failed: error processing document #1: invalid character 'ÿ' looking for beginning of value 2021-07-23T17:34:59.806+0800 imported 0 documents cause 由于result.json是m
Force fsck on boot

Force fsck on boot

Force_fsck_on_boot

suo.li
Force fsck on boot /etc/rc.conf fsck_y_enable="YES" background_fsck="NO" /etc/rc.d/root #!/bin/sh # # $FreeBSD: stable/10/etc/rc.d/root 177062 2008-03-11 17:21:14Z delphij $ # # PROVIDE: root # REQUIRE: fsck # KEYWORD: nojail . /etc/rc.subr name="root" start_cmd="root_start" stop_cmd=":" root_start() { # root normally must be read/write, but if this is a BOOTP NFS # diskless boot it does not have to be. # case ${root_rw_mount} in [Nn][Oo] | '') ;; *) # 在这里fsck======================fsck /sbin/fsck -fy / if ! mount -uw /; then echo 'Mounting root filesystem rw failed, startup aborted' stop_boot true fi
Move Nic to Container

Move Nic to Container

Move Nic to Container

suo.li
将网卡通过网络名称空间分配给容器 将网卡通过网络名称空间分配给容器后,该网卡在主机不可见,容器使用none网络 分配后需要在容器中配置默认路由。 #!/usr/bin/env bash # # 1. get eth0 device # 2. get eth0/eth1 ips # 3. link ns # 4. set ip and route # CONTAINER_NAME=containerName CONTAINER_IP= HOST_IP= CONTAINER_NIC= HOST_NIC= getDeviceNameAndIndex() { while read name; do readlink /sys/class/net/$name | grep -wv 'virtual' > /dev/null [[ $? -eq 0 ]] && dev=`echo