Set up a production environment
Use this guide to set up and manage a production-level full Terra node.
For information about running a validator node, visit the validator guide.
Create a dedicated user
Although Terrad does not require a super user account, during the setup process you'll need super user permission to create and modify some files. It is strongly recommended to use a normal user when running Terrad.
Increase the maximum files Terrad can open
Terrad is set to open 1024 files by default. It is recommended that you increase this amount.
/etc/security/limits.conf* to increase the amount, where
nofile is the number of files Terrad can open.
_5# If you have never changed this system config or your system is fresh, most of this file will be commented_5# ..._5* soft nofile 65535 # Uncomment the following two lines at the bottom_5* hard nofile 65535 # Change the default values to ~65535_5# ...
Run the server as a daemon
Terrad must be running at all times. It is recommended that you register Terrad as a
systemd service so that it will be started automatically when the system reboots.
Register Terrad as a service
Create a service definition file in
Example:_15[Unit]_15Description=Terra Daemon_15After=network.target_15_15[Service]_15Type=simple_15User=<TERRA_USER>_15ExecStart=<PATH_TO_TERRAD>/terrad start_15Restart=on-abort_15_15[Install]_15WantedBy=multi-user.target_15_15[Service]_15LimitNOFILE=65535
Servicesection according to your environment:
- Enter the user (likely your username, unless you created a user specifically for Terrad)
- Enter the path to the Terrad executable.
/usr/go/bin. Confirm this with
- Make sure you made the correct edits to /etc/security/limits.conf
systemctl daemon-reloadfollowed by
systemctl enable terrad. This will register Terrad as a system service and turn it on upon startup.
Now start the serivce with
systemctl start terrad.
Controlling the service
systemctl to start, stop, and restart the service:
_8# Check health_8systemctl status terrad_8# Start_8systemctl start terrad_8# Stop_8systemctl stop terrad_8# Restart_8systemctl restart terrad
journalctl -t to access entire logs, entire logs in reverse, and the latest and continuous log.
_6# Entire log reversed_6journalctl -t terrad -r_6# Entire log_6journalctl -t terrad_6# Latest and continuous_6journalctl -t terrad -f