This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3764|Reply: 4

Consul installation tutorial in a Windows test environment

[Copy link]
Posted on 6/17/2023 7:38:15 PM | | | |
HashiCorp Consul is a service networking solution that enables teams to manage secure network connectivity between services and across on-premises and multi-cloud environments and runtime. Consul provides service discovery, service meshing, traffic management, and automated updates for network infrastructure devices. You can use these features individually or together in a single Consul deployment.

Consul provides a control plane that enables you to register, query, and secure services deployed across networks. The control plane is a part of the network infrastructure that maintains a central registry to track services and their respective IP addresses. It is a distributed system that runs on a cluster of nodes, such as physical servers, cloud instances, virtual machines, or containers.

Review:

Consul HTTP API interface call
https://www.itsvse.com/thread-9578-1-1.html

ASP.NET Core Link Tracing (3) SkyAPM is based on Consul dynamic configuration
https://www.itsvse.com/thread-9468-1-1.html

【Architecture】ASP.NET Core is highly available based on Consul services
https://www.itsvse.com/thread-9422-1-1.html

Architecture: ASP.NET Core dynamically configures hot updates based on Consul
https://www.itsvse.com/thread-9421-1-1.html

[Architecture]. net/c# implements distributed configuration of Key/Value store based on Consul
https://www.itsvse.com/thread-9420-1-1.html

Download Address:

The hyperlink login is visible.
The hyperlink login is visible.

Consul (CLI) commands:

The hyperlink login is visible.
The hyperlink login is visible.

First, download consul_1.15.3_windows_amd64 and create a new onestart.batscript to start consul, the script is as follows:

Then execute the start.bat script, as shown in the image below:



Browser open:http://127.0.0.1:8500/, as shown in the figure below:



Attached is the command to build a consul test environment using docker:


Consul startup command parameter information:

Field resolution
-server
Start as server. The default is client.
-bootstrap
It is used to control whether a server is in bootstrap mode, only one server can be in bootstrap mode in a data center, and when a server is in bootstrap mode, it can be elected as the server-leader.
-bootstrap-expect=1
If the minimum number of servers required by the cluster is less than this number, the cluster will be invalidated.
-ui
Specify to open the UI interface, so that you can access the web UI interface that comes with consul through an address like http://localhost:8500/ui.
-data-dir
Specify the datastore directory.
-bind
The address specified for communication within the cluster must be reachable to all nodes in the cluster, and the default is 0.0.0.0.
-client
Specify which client address consul is bound to, which provides services such as HTTP, DNS, RPC, etc., and the default is 127.0.0.1.
-node
The name of a node in a cluster must be unique in a cluster, and the default is the hostname of the node.
-datacenter
Specify the name of the data center, which defaults to DC1.

After starting Consul, it listens to 6 ports by default:

8300
Replication and leader farwarding ports (replica synchronization, forwarding ports)
8301
LAN Cossip port (port connected to the cluster)
8302
WAN Gossip port (port connected to the outside of the cluster)
8500
Port of the web ui interface (access port of the web interface)
8600
Ports that use DNS protocol to view node information (ports used by DNS protocols)
8503
gRPC TLS: gRPC API with TLS connection

For more information about consul ports, see:The hyperlink login is visible.

(End)




Previous:[Transfer] to MySQL Advanced: optimize table command
Next:ASP.NET Core (twenty-one) configuration options are the difference between AddOptions and Configure
 Landlord| Posted on 6/17/2023 7:57:01 PM |
Docker consul container service updates and discovery:https://www.cnblogs.com/pengdi/p/15425378.html
 Landlord| Posted on 6/17/2023 8:20:01 PM |
Linux environment deployment


Create a new start.sh file with the following contents:

Create a new consul.service service file as follows:



 Landlord| Posted on 6/17/2023 8:28:20 PM |
Run Consul with docker-compose

Use the docker command to run the Consul cluster, the docker-compose file looks like this:

 Landlord| Posted on 8/13/2025 10:36:13 AM |
agent: Error starting agent: error="Failed to start Consul server: Failed to start Raft: fail to open write-ahead-log: failed initializing meta DB: sync D:\itsvse\consul_1.21.3_windows_amd64\data\raft\wal: Access is denied."

solution

The hyperlink login is visible.
The hyperlink login is visible.

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com