Tries to follow the packaging guidelines from Fedora.
- Binary:
/usr/bin/consul
- Config:
/etc/consul.d/
- Shared state:
/var/lib/consul/
- Sysconfig:
/etc/sysconfig/consul
- WebUI:
/usr/share/consul/
The version number is hardcoded into the SPEC, however should you so choose, it can be set explicitly by passing an argument to rpmbuild
directly:
$ rpmbuild --define "_version 0.8.10"
-
Build the Docker image. You can pick and choose the RHEL version.
docker build --rm -t consul:build7 -f Dockerfile.centos7 .
or
docker build --rm -t consul:build6 -f Dockerfile.centos6 .
-
Run the build. Replace
#
with the RHEL version you want.docker run --rm -v $PWD:/build consul:build#
-
Retrieve the built S/RPMs from:
$PWD/rpmbuild/RPMS
$PWD/rpmbuild/SRPMS
Three RPMs:
- consul server
- consul web UI
- consul-template
- Install the RPM.
- Put config files in
/etc/consul.d/
. - Change command line arguments to consul in
/etc/sysconfig/consul
.- Add
-bootstrap
only if this is the first server and instance.
- Add
- Start the service and tail the logs
systemctl start consul.service
andjournalctl -f
.- To enable at reboot
systemctl enable consul.service
.
- To enable at reboot
- Consul may complain about the
GOMAXPROCS
setting. This is safe to ignore; however, the warning can be supressed by uncommenting the appropriate line in/etc/sysconfig/consul
.
Config files are loaded in lexical order from the /etc/consul.d/
. Some
sample configs are provided.
See the consul.io website.