Coder Social home page Coder Social logo

Comments (4)

xujiajun avatar xujiajun commented on June 3, 2024

@googolgl hi, Please provide more information.
0、nutsDB version
1、which platform? e.g. OS X 10.13.6, Ubuntu 16.04
2、the complete code which you execute

Then I will check this question. thanks.

from nutsdb.

googolgl avatar googolgl commented on June 3, 2024
  1. github.com/xujiajun/nutsdb v0.4.1-0.20190405142137-dad030248b51
  2. Ubuntu 18.04.2 LTS; Linux Comp 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux; Intel(R) Pentium(R) CPU G2120 @ 3.10GHz; Mem 8096328
import "github.com/xujiajun/nutsdb"

type ndb struct {
	db *nutsdb.DB
}

func initNutsdb() *nutsdb.DB {
opt := nutsdb.DefaultOptions
opt.Dir = "./nutsdb"
opt.SegmentSize = 8388608
opt.EntryIdxMode = nutsdb.HintKeyAndRAMIdxMode
opt.SyncEnable = false
opt.RWMode = nutsdb.FileIO
opt.NodeNum = 1
db, err := nutsdb.Open(opt)
if err != nil {
	log.Fatal(err)
}
return db
}

in main function
n = ndb{
      db: initNutsdb(),
}

from nutsdb.

xujiajun avatar xujiajun commented on June 3, 2024

@googolgl ,hi ,
I used your code (fixed some syntax mistakes) to run on ubuntu 18.04.2 LTS multiple times, but no errors occurred.

The code that runs is as follows:

package main

import "github.com/xujiajun/nutsdb"


func initNutsdb() *nutsdb.DB {
	opt := nutsdb.DefaultOptions
	opt.Dir = "./nutsdb_data"
	opt.SegmentSize = 8388608
	opt.EntryIdxMode = nutsdb.HintKeyAndRAMIdxMode
	opt.SyncEnable = false
	opt.RWMode = nutsdb.FileIO
	opt.NodeNum = 1
	db, err := nutsdb.Open(opt)
	if err != nil {
		panic(err)
	}
	return db
}

func main() {
	initNutsdb()
}

BTW the latest version of nutsDB is 0.4.0 ,why github.com/xujiajun/nutsdb v0.4.1-xxx ?

I suggest you reinstall the nutsDB and try again.

from nutsdb.

googolgl avatar googolgl commented on June 3, 2024

it's my mistake
thanks

from nutsdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.