在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:heidihoward/ios开源软件地址:https://github.com/heidihoward/ios开源编程语言:Go 99.3%开源软件介绍:Welcome to Ios, a reliable distributed agreement service for cloud applications. Built upon a novel decentralised consensus protocol, Ios provides vital services for your cloud application such as distributed locking, consistent data structures and leader election as well as distributed configuration and coordination. This repository is pre-alpha and under active development. APIs will be broken. This code has not been proven correct and is not ready for production deployment. Getting StartedThese instructions will get you a simple Ios server and client up and running on your local machine. See deployment for notes on how to deploy Ios across a cluster. PrerequisitesIos is built in Go version 1.6.2 and currently supports Go version 1.6 and 1.7. The Golang site details how to install and setup Go on your local machine. Don't forget to add GOPATH to your .profile. InstallationAfter installing Go, run:
This command will copy the Ios source code to $GOPATH/src/github.com/heidi-ann/ios and then fetch and build the following dependancies:
Up & RunningYou can now start a simple 1 node Ios cluster as follows:
This will start an Ios server providing a simple key-value store. The server is listening for clients on port 8080. You can now start an Ios client as follows:
You can now enter commands for the key value store, followed by the enter key. These commands are being sent to the Ios server, executed and the result is returned to the user. The Ios server is using files called persistent_log_0.temp, persistent_snap_0.temp and persistent_data_0.temp to store Ios's persistent state. If these files are present when a server starts, it will restore its state from these files. You can try this by killing the server process and restarting it, it should carry on from where it left off. When you would like to start a fresh server instance, use Building in DockerAlternatively, you can build and run in Ios using Docker. Make sure Docker is installed and running, then clone this repository and cd into it. Build an image named 'ios' using the following command
You should now be able to run
Running
Note that this will only use storage local to the container instance. If you want persistence/recoverability for instances you will need to store persistence logs on a mounted data volume Next stepsIn this section, we are going to take a closer look at what is going on underneath. We will then use this information to setup a 3 server Ios cluster on your local machine and automatically generate a workload to put it to the test. PS: you might want to start by opening up a few terminal windows. Server configurationThe server we ran in previous section was using the default configuration file found in example.conf. The first section of this file lists the Ios servers in the cluster and how the peers can connect to them and the second section lists how the client can connect to them. The configuration file example3.conf shows what this looks like for 3 servers running on localhost. The same configuration file is used for all the servers, at run time they are each given an ID (starting from 0) and use this to know which ports to listen on. The rest of the configuration file options are documented at https://godoc.org/github.com/heidi-ann/ios/config. After removing the persistent storage, start 3 Ios servers in 3 separate terminal windows as follows:
For ID 0, 1 and 2 Client configurationLike the servers, the client we ran in the previous section was using the default configuration file found in example.conf. The first section lists the Ios servers in the cluster and how to connect to them. The configuration file example3.conf shows what this looks like for 3 servers currently running on localhost. We are run a client as before and interact with our 3 servers.
You should be able to kill and restart the servers to test when the system is available to the client. Since the Ios cluster you have deployed is configured to use strict majority quorums then the system should be available whenever at least two servers are up. Workload configurationTyping requests into a terminal is, of course, slow and unrealistic. To help test the system, Ios provides test clients which can automatically generate a workload and measure system performance. To run a client in test mode use:
This client will run the workload described in test/workloads/example.conf and then terminate. It will write performance metrics into a file called latency.csv. Ios currently also support a REST API mode which listens for HTTP on port 12345. ContributingDebuggingWe use glog for logging. Adding Likewise, the following commands work with the above example and are useful for debugging:
BenchmarkingThe benchmarking scripts for Ios can found here https://github.com/heidi-ann/consensus_eval LicenseThis project is licensed under the MIT License - see the LICENSE.md file for details |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论