CentOS Installation Consul service registration and Discovery software

Source: Internet
Author: User
Tags value store
This is a creation in Article, where the information may have evolved or changed.

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/56296013 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys

1, about consul

Consul simplifies the process of registering and discovering services in a distributed environment, which is discovered through HTTP or DNS interfaces.
There are a lot of useful functions.
The conformance protocol uses the RAFT algorithm to ensure high availability of the service.
Project Address: https://www.consul.io/
GitHub Address: Https://github.com/hashicorp/consul

2, installation

Unzip the installation directly under CentOS.
Download Address:
Https://www.consul.io/downloads.html
Decompression discovery has a file. No configuration. Not even a readme.
My machine uses VirtualBox to install CentOS. So you need to modify the IP. Start command:

.-dev-ui-node=consul-dev-client=10.0.2.15

-dev parameter Indication Development
The-ui parameter indicates that the UI is open or the UI interface is not visible.
The-node parameter indicates that a name is added to the node
The-client parameter represents the binding IP 10.0.2.15, which guarantees successful forwarding through the VirtualBox port.

You can then access the UI interface in the native computer.

3. Accessing the page UI


With VirtualBox port forwarding, you can see node names called Consul-dev nodes.

5, common commands

Use the Consul command:
Https://www.consul.io/docs/commands/index.html
Operation KV Command: Usage:consul KV
Because the server IP has been modified all in Consul, you can use environment variables to tell the consul command line.

#export CONSUL_HTTP_ADDR="10.0.2.15:8500"#consul"192.168.1.10"Success!Datato: redis/server

Indicates that the data has been added successfully: You can also look it up directly on the command line.

You can also query directly from the command line:

# consul kv get redis/server192.168.1.10

Other interface APIs:
Https://www.consul.io/docs/agent/http.html

You can also use the client to call the server directly. In fact, it encapsulates the next HTTP service.
Writing code is much more convenient than using curl.
Https://www.consul.io/downloads_tools.html
Calls can be made using many clients. The API is actually the same.

6, summary

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/56296013 not allowed to reprint without the Bo master.
Bo main address is: Http://blog.csdn.net/freewebsys

Summed up, experience the next stand-alone version of the consul service.
Just looked under the UI interface and added a Kev,value store.
Download a Java or Golang client for further research.
You can find out more about the services found. Because of a simple management interface.
Feel more simple and convenient than the ETCD. No more in-depth DNS service discovery has been researched yet.
Continue to study.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.