Install LogScale
We recommend installing LogScale on Ubuntu, at least version 18.04. We also recommend that you first install Zookeeper and Kafka Usage & Installation on your server. You will also need to make sure your server is up-to-date, if you haven't already. You can do this with apt-get like so:
apt-get update
apt-get upgrade
Once you've ensured your server is up-to-date, installed Kafka and Zookeeper, you'll need to do some LogScale specific preparations.
LogScale User & Directories
First, you'll need to create a non-administrative user named,
humio
to run LogScale software in
the background. You can do this by executing the following from the
command-line:
adduser humio --shell=/bin/false --no-create-home --system --group
You should add this user to the
DenyUsers
section of your nodes
/etc/ssh/sshd_config
file to prevent it from
being able to ssh or sftp into the node. Remember to restart the
sshd
daemon after making the
change. Once the system has finished updating and the user has been
created, you can install Kafka.
Next, create the LogScale system directories and give the
humio
user ownership of them:
mkdir -p /opt/humio /etc/humio/filebeat /var/log/humio /var/humio/data
chown humio:humio /opt/humio /etc/humio/filebeat
chown humio:humio /var/log/humio /var/humio/data
LogScale Software Installation
You're now ready to download and install LogScale's software. You should go to the LogScale directory and use wget to download the LogScale Java Archive. You can do this from the command-line like so:
cd /opt/humio/
wget https://repo.humio.com/repository/maven-releases/com/humio/server/x.x.x/server-x.x.x.tar.gz
tar xzf /opt/humio/server-x.x.x.tar.gz
ln -s /opt/humio/humio-x.x.x /opt/humio/humio
The wget here is used to download the latest release from https://repo.humio.com/service/rest/repository/browse/maven-releases/com/humio/server/. You'll have to adjust the lines for the correct directory and file name, based on the version at the time. After you've downloaded it, enter the last line here to create a symbolic link to it.
Configuration
Using a simple text editor, create the LogScale configuration file,
server.conf
in the
/etc/humio
directory. There are a few environment
variables you will need to enter in this configuration file in order
to run LogScale on a single server or instance. Below are those basic
settings:
AUTHENTICATION_METHOD=single-user
BOOTSTRAP_HOST_ID=1
DIRECTORY=/var/humio/data
HUMIO_AUDITLOG_DIR=/var/log/humio
HUMIO_DEBUGLOG_DIR=/var/log/humio
JVM_LOG_DIR=/var/log/humio
HUMIO_PORT=8080
ELASTIC_PORT=9200
ZOOKEEPER_URL=127.0.0.1:2181
KAFKA_SERVERS=127.0.0.1:9092
EXTERNAL_URL=http://127.0.0.1:8080
PUBLIC_URL=http://127.0.0.1
HUMIO_SOCKET_BIND=0.0.0.0
HUMIO_HTTP_BIND=0.0.0.0
You could copy these lines into the server.conf
file. If you're intending to use this single server as the first node
of a cluster, you'll have to change the IP addresses from
127.0.0.1
to the IP addresses of the server. When you
replicate it to each node, these IP addresses will have to be adjusted
for each node. See the Cluster Setup
documentation page for more information on this.
For more information on each of the environment variables, see the Configuration Parameters reference page.
Setting Up a Service
Next you should set up a service file. Using a simple text editor,
create a file named, humio.service
in the
/etc/systemd/system/
sub-directory. Add these
lines to that file:
[Unit]
Description=LogScale service
After=network.service
[Service]
Type=notify
Restart=on-abnormal
User=humio
Group=humio
LimitNOFILE=250000:250000
EnvironmentFile=/etc/humio/server.conf
WorkingDirectory=/var/humio
ExecStart=/opt/humio/humio/bin/humio-server-start.sh
[Install]
WantedBy=default.target
LogScale Ownership & Starting
You will need to change the ownership of the LogScale files and start the LogScale service. To change the ownership, execute the following two lines from the command-line:
chown -R humio:humio /opt/humio /etc/humio/filebeat
chown -R humio:humio /var/log/humio /var/humio/data
You're ready to start LogScale. Do so with the systemctl utility like so:
systemctl start humio
Just to be sure LogScale is running and everything is fine, check it with the journalctl tool. You can do this by entering the following from the command-line:
journalctl -fu humio
If there are no errors, open a web browser and enter the domain name
or IP address with port 8080
. For
example, you would enter something like
http://example.com:8080
in the browser's address field.