Tries to follow the packaging guidelines from Fedora.
- Binary:
/usr/bin/consul
- Config:
/etc/consul.d/
- Configs to manage logs:
/etc/logrotate.d/consul.conf
,/etc/rsyslog.d/consul.conf
- Shared state:
/var/lib/consul/
- Environment config variables:
/usr/lib/systemd/system/consul.service.d/consul.env.conf
Only supports SystemD.
Build the RPM as a non-root user from your home directory:
-
Check out this repo. Seriously - check it out. Nice.
git clone https://github.com/devghai/consul-rpm.git
-
Use
build.sh
to build the RPM.build.sh -h
tells you all options that are available, along with respective default settings. It will build the latest version in current directory by default. Examples:# Build version 0.7.2 build.sh -v 0.7.2 # Build version 0.7.2 with RPM tree located in /tmp folder build.sh -v 0.7.2 -b /tmp # Build version 0.7.2 with RPM tree located in /tmp folder and set release version 'example' build.sh -v 0.7.2 -b /tmp -r example
Use build.sh -l
to see versions available for packaging. Script queries consul download URL to find available versions... so will need a network connection and curl
.
- Install the RPM.
- Reload SystemD daemon
systemctl daemon-reload
- (Optional) Restart RSyslog if you want logs to be written to
/var/log/consul/consul.log
systemctl restart rsyslog.service
- (Optional) Modify config files in
/etc/consul.d/
. - (Optional) Change command line arguments to consul in
/usr/lib/systemd/system/consul.service.d/consul.env.conf
.- Add
-bootstrap
only if this is the first server and instance.
- Add
- Start the service
systemctl start consul.service
- (Optional) Tail the logs
or
journalctl -xef _SYSTEMD_UNIT=consul.service
tail -f /var/log/consul/consul.log
- To enable at reboot
systemctl enable consul.service
- Consul may complain about the
GOMAXPROCS
setting. This is safe to ignore; however, the warning can be supressed by uncommenting the appropriate line in/usr/lib/systemd/system/consul.service.d/consul.env.conf
.
Config files are loaded in lexicographical order from the /etc/consul.d
.
See the consul.io website.
- Earlier verisons of this package used
/etc/consul/
as the default configuration directory. As of 0.7.2, the default directory was changed to/etc/consul.d/
. Need to add this in order to align with the offcial Consul docuemntation. - Follow same patterns for logging and env variables for consul-template as they are being done for consul.
- Versions prior to 0.9.0 also packaged consul-ui separately.