Skip to content

Instantly share code, notes, and snippets.

@brianmcgue
Last active June 16, 2020 15:36
Show Gist options
  • Save brianmcgue/fcd9097ba2460cca3680c8743c107180 to your computer and use it in GitHub Desktop.
Save brianmcgue/fcd9097ba2460cca3680c8743c107180 to your computer and use it in GitHub Desktop.
Testing Enterprise Search on Red Hat

Testing Enterprise Search on Red Hat

Set up a Red Hat GCP instance in the elastic-swiftype project

  1. Visit the elastic-swiftype GCP project
    • if you don't have access, talk to @kellen and @bvans about getting access
  2. Click CREATE INSTANCE
  3. Name the instance
  4. Select a region
  5. Set the Machine type to n1-standard-4
  6. Change the Boot disk and set the follow parameters
    • Operating system: Red Hat Enterprise Linux
    • Version: Red Hat Enterprise Linux 8
  7. Click Create to create the instance

SSH into the instance you created

Take note of the External IP and then ssh into the box

ssh <username>@<external_ip> # username will probably be your @elastic.co username

Become the root and install all the things:

sudo -i
yum install java-1.8.0
yum install jq # not necessary, I like it for reading JSON output from curl commands

# install the non-oss RPM distributions
# get the URLs from staging.elastic.co
# there should be a link for the latest BC in the release GitHub issue
yum install "https://staging.elastic.co/7.8.0-054254f1/downloads/elasticsearch/elasticsearch-7.8.0-x86_64.rpm"
yum install "https://staging.elastic.co/7.8.0-054254f1/downloads/enterprise-search/enterprise-search-7.8.0.rpm"

# if that doesn't work, curl and localinstall them:
curl -LO "https://staging.elastic.co/7.8.0-054254f1/downloads/elasticsearch/elasticsearch-7.8.0-x86_64.rpm"
curl -LO "https://staging.elastic.co/7.8.0-054254f1/downloads/enterprise-search/enterprise-search-7.8.0.rpm"
yum localinstall elasticsearch-7.8.0-x86_64.rpm enterprise-search-7.8.0.rpm

Set up Elasticsearch

Add various settings to the config file

vi /etc/elasticsearch/elasticsearch.yml
discovery.type: single-node
xpack.security.enabled: true
action.auto_create_index: ".ent-search-*-logs-*,-.ent-search-*,+*"
xpack.security.authc.token.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.authc.api_key.enabled: true

Start Elasticsearch and set up the passwords

systemctl start elasticsearch
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive # set password to `changeme`

Set up Enterprise Search

Add encryption keys to config

You need to add encryption_keys or startup will fail

vi /usr/share/enterprise-search/config/enterprise-search.yml
secret_management.encryption_keys: [5aa5b9296211c141a9a78f2cfe7923f0bcc1b5c9a89a130e58db25ddbb524a26]

Start enterprise search and follow the logs

systemctl start enterprise-search
journalctl -fu enterprise-search # ctrl-C to exit after you get the password

Set up port forwarding to your actual localhost so you can view the UI

~C # type it fast
-L 3002:localhost:3002

Check to make sure it's running

curl "localhost:3002/swiftype-app-version" | jq

And you should be all set to start testing

Make sure to delete the GCP instance when you're done testing!

@richkuz
Copy link

richkuz commented May 12, 2020

👍 👊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment