Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cassandra): Env vars #999

Merged
merged 15 commits into from
Jan 4, 2024
Merged

feat(cassandra): Env vars #999

merged 15 commits into from
Jan 4, 2024

Conversation

michaelkro
Copy link
Contributor

@michaelkro michaelkro commented Nov 27, 2023

Updates the Cassandra recipes to be able to accept required user input as environment variables. This is necessary so that we can add Cassandra as a target to ansible-install.

Notes

  • Tested on debian10 and AL2 during development

Testing
Happy path

  1. Log in to machine that is running Cassandra
  2. Clone this repo and switch to this PR branch
  3. Run the installation with --localRecipes /path/to/recipes
  4. Use the standard test credentials when prompted

Hostname

  1. You can test the hostname input behavior by providing 0.0.0.0 as an invalid value and running with --localRecipes

Custom port

  1. Search for JMX_PORT in cassandra-env.sh and change it from 7199. Find the script on your host at:
    // Debian
    /etc/cassandra
    
    // RHEL
    /etc/cassandra/conf
    
  2. Restart Cassandra
    sudo service casssandra restart
    
  3. Run the installation with --localRecipes and the CLI should prompt you for a port

Install in non-interactive mode with environment variables

  1. Add the environment variables to your installation command as well as the -y flag
    ... sudo NEW_RELIC_CASSANDRA_USERNAME=<username> NEW_RELIC_CASSANDRA_PASSWORD=<password> NEW_RELIC_CASSANDRA_PORT=<port> NEW_RELIC_CASSANDRA_HOSTNAME=<hostname> ... /usr/local/bin newrelic install -n cassandra-open-source-integration --localRecipes /path/to/recipes -y
    
  2. To test invalid inputs, add the --debug flag to see error output

Legacy environment variables

NR_CLI_DB_USERNAME
NR_CLI_DB_PASSWORD
NR_CLI_DB_HOSTNAME
  1. You should be able to use the new and legacy environment variables interchangeably.

@michaelkro michaelkro marked this pull request as draft November 27, 2023 22:48
@michaelkro michaelkro force-pushed the mro/NR-1789910/cassandra-env-vars branch 6 times, most recently from 611c9eb to a1faeb1 Compare November 29, 2023 22:21
@michaelkro michaelkro marked this pull request as ready for review December 5, 2023 18:33
@michaelkro michaelkro marked this pull request as draft December 5, 2023 20:15
@michaelkro michaelkro force-pushed the mro/NR-1789910/cassandra-env-vars branch 2 times, most recently from a615da3 to 9d93e8d Compare December 11, 2023 18:22
@michaelkro michaelkro marked this pull request as ready for review December 11, 2023 18:36
NRhzhao
NRhzhao previously approved these changes Dec 14, 2023
@michaelkro michaelkro force-pushed the mro/NR-1789910/cassandra-env-vars branch from 30887fe to 484f8d6 Compare December 15, 2023 00:07
@NRhzhao NRhzhao merged commit 820fdda into main Jan 4, 2024
9 checks passed
@NRhzhao NRhzhao deleted the mro/NR-1789910/cassandra-env-vars branch January 4, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants