1 Star 1 Fork 0

百度开源 / ins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Nexus - Raft Protocol Based Cluster Coordinator

Build Status Coverity Scan Build Status Documentation Status

nexus, used to be known as i name service(ins), is a high available key-value store to hold crucial meta data, which also support mechanism to coordinate large scale services.

nexus is based on Raft protocol to keep consistency between multi-nodes, and provide key-value data access, distributed lock mechanism(lock) and event callback function(watch).

Who Is Using Nexus

nexus was born to provide a Google Chubby style service in Galaxy, a cluster manager system. Now it supports several online services in Baidu, Inc., including Galaxy and Tera.

For those who want to save their important data, who want to keep uniqueness in a cluster, or who want to manage large scale services, please refer to this for some classical usage.

Installation and Usage

Use build.sh to solve dependency problem, or export proper environment variable to tell Makefile to find proper headers and libraries. All necessary dependencies are listed at the beginning of Makefile. Proved on g++ and clang++.

The sandbox directory holds a few scripts for starting a test cluster on localhost and old-fashioned client tools.

  • Use start_all.sh to start a 5-nodes cluster on current server, and generate flagfile for other scripts
  • Use stop_all.sh to stop all nodes, and clean_all.sh to stop cluster and clean up all data and log
  • Use stop_one.sh and start_one.sh to temporarily disable and enable a node to check the cluster status
  • Use show_cluster.sh to show the status of cluster
  • Use ins_shell.sh for old-fasioned nexus client, which uses script to wrap a binary client
  • Use run_sample.sh to start a 100k write times test and a 100k read times test

Cluster and client use GFlags to parse command line to alter inner parameters. For more information, please refer to this document.

In addition to script version of client, we introduced a new C++ version client, providing more convenient functions for testing and online operations. This client also gives an example on how to work with nexus SDK.

When deploying to online servers, please use control.sh for a single node to start/stop/restart or check the status of health.

Integration and API

  • For C++ user, use make install_sdk to export sdk to PREFIX dir. Please refer to this document for more information
  • For Python user, use make python to produce library. Please refer to this document for more information

Dependencies

To build the whole project, following dependencies must be meet:

For unittest, following dependency must be meet:

Raft defined log compaction function needs a slight change in LevelDB, the modified code is located in thirdparty/leveldb.

Contributing

We welcome any kind of contributions. If there are any developing questions or complaints, please feel free to contact us: opensearch.

Copyright (c) 2015, Baidu, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Baidu, Inc. nor the names of it contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

Raft Protocol Based Cluster Coordinator 展开 收起
C++
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/baidu/ins.git
git@gitee.com:baidu/ins.git
baidu
ins
ins
master

搜索帮助