-
Notifications
You must be signed in to change notification settings - Fork 171
Installation EN
liguoqiang edited this page Oct 20, 2023
·
6 revisions
- BaikalDB has three components, namely baikalMeta, baikalStore and baikalDB.
- The directory structure of each component is similar with that of most C++ programs:
- baikal**/bin // bin directory is where the binary program resides
- baikal**/conf // conf directory is where the configuration file gflags.conf resides
- It is compulsory to first deploy baikalMeta, then baikalStore and finally baikalDB
- If multiple replica for table data is required, at least three baikalStore instances should be deployed.
- copy the baikalMeta binary to ./bin
- add configuration file(conf/gflags.conf), below is a simple configuration:
- -meta_replica_number=1 // peer(replica) number, 1 is okay for demo, 3 is recommended for product.
- -meta_port=8010 // instance port
- -meta_server_bns=xx.xx.xx.xx:8010,xx.xx.xx.xx:8010,xx.xx.xx.xx:8010 // The IP+Port list of all instances,Real IP, not 127.0.0.1
- run baikalMeta instance: nohup bin/baikalMeta &
- check the leader address: open http://xx.xx.xx.xx:8010/raft_stat on a web browser and get the leader address of "meta_raft"
- run initialization scripts(all scripts are in src/tools/script):
- sh init_meta_server.sh leader_ip:port
- sh create_namespace.sh leader_ip:port // create namespace
- sh create_database.sh leader_ip:port // create database
- sh create_user.sh leader_ip:port // create user
- copy the baikalStore binary to ./bin
- add configuration file(conf/gflags.conf), below is a simple configuration:
- -db_path=./rocks_db
- -election_timeout_ms=10000
- -raft_max_election_delay_ms=5000
- -raft_election_heartbeat_factor=3
- -snapshot_uri=local://./raft_data/snapshot
- -meta_server_bns=xx.xx.xx.xx:8010,xx.xx.xx.xx:8010,xx.xx.xx.xx:8010 // list of baikalMeta instance ip+port
- -store_port=8110
- run baikalStore instance: nohup bin/baikalStore &
- copy the baikaldb binary to ./bin
- add configuration file(conf/gflags.conf), below is a simple configuration:
- -meta_server_bns=xx.xx.xx.xx:8010,xx.xx.xx.xx:8010,xx.xx.xx.xx:8010 // list of baikalMeta instance ip+port
- -baikal_port=28282
- -fetch_instance_id=true
- run script to create baikaldb instance meta-table:
sh create_internal_table.sh meta_leader_ip:port - run baikaldb instance: nohup bin/baikaldb &