This can be done by adding custom files to cluster specification - The init script looks for a specially named custom file called user-init, the file has to be called that, and it has to be marked as 'is executable' [Please refer the screenshots].
the user-init file should be a script (should start with something like #!/bin/bash or similar) and it'll run after the rest of our init scripts finish and you can use that to configure whatever custom service you want to configure.
You can also use the custom file mechanism to upload additional files for SignalFX - you could use 'Location Type' Default and the files would be placed at /opt/imply/user and you can reference them there.
Example: I am showing you an example where a user wants to install `SignalFx agent` on each imply managed EC2 instance
Step1 :
here, I have created a `user-init` file and placed it to into `s3-bucket`
eg:
Location:
s3://imply-signalfx/user-init
The user-init file has below content:
#!/bin/bash curl -sSL https://dl.signalfx.com/signalfx-agent.sh > /tmp/signalfx-agent.sh sudo sh /tmp/signalfx-agent.sh <SOME_ID> --realm us0
Step 2:
Login to imply cloud manager UI > Select the Cluster > Click on `manage` > click on `setup` >navigate to `Advance Config' and expand it > Now click on to ` Add custom file`
Step 3:
When you Add the `custom file` it will ask to you provide below details :
a) Custom File Path: The file path must start with `s3:// , http://, https://`,
In this example, the path should be :
s3://imply-signalfx/user-init
b) Location Type: I am using the default location, in this case, the init file will be placed inside this directory :
/opt/imply/user/
c) Extra Properties: In this case, it should be:
Is executable
Example:
Once you are done with the above configuration, you need to update the cluster!
What is the impact on the running cluster?
As It requires a cluster update and the instances will be recreated so if your cluster is HA and you do a rolling update, there should not be any downtime, otherwise, there will be downtime. If there is an error in the script, you should be able to roll back the update.
Suggestion to be on the safe side :
I will suggest to spin up a TEST cluster and try this first before doing it in PRODUCTION.
Comments
0 comments
Please sign in to leave a comment.