A Step-by-Step Guide to Setting Up and Monitoring Redis with AppDynamics on Ubuntu EC2
Monitoring your Redis instance is essential for ensuring optimal performance and identifying potential bottlenecks in real-time. In this guide, we’ll walk through the process of setting up Redis on an Ubuntu EC2 instance and configuring SplunkAppDynamics Redis Monitoring Extension to capture key metrics.
Step 1: Setting up Redis on Ubuntu
Prerequisites
- An AWS account with an EC2 instance running Ubuntu.
- SSH access to your EC2 instance.
Installing Redis
- Update package lists and install Redis:
sudo apt-get update sudo apt-get install redis-server
- Verify the installation:
redis-server --version
- Ensure Redis is running:
sudo systemctl status redis
Step 2: Installing AppDynamics Machine Agent
- Download the Machine Agent:
Visit AppDynamics and download the Machine Agent for your environment. - Install the Machine Agent: Follow the installation steps provided in the AppDynamics Machine Agent documentation.
https://docs.appdynamics.com/appd/24.x/24.11/en/infrastructure-visibility/machine-agent/install-the-... - Verify Installation: Start the Machine Agent and confirm it connects to your AppDynamics Controller.
Step 3: Configuring AppDynamics Redis Monitoring Extension
- Clone the Redis Monitoring Extension Repository
git clone https://github.com/Appdynamics/redis-monitoring-extension.git cd redis-monitoring-extension
- Build the Extension
Locate thesudo apt-get install openjdk-8-jdk maven mvn clean install
.zip
file in thetarget
folder and extract it:unzip target/RedisMonitor-*.zip -d <MachineAgent_Dir>/monitors/
- Edit the Configuration File
Navigate to the extracted folder and editconfig.yml
:metricPrefix: "Custom Metrics|Redis" #Add your list of Redis servers here. servers: - name: "localhost" host: "localhost" port: "6379" password: "" #encryptedPassword: "" useSSL: false
- Restart the Machine Agent
.<MachineAgent_Dir>/bin/machine-agent
Step 4: Verifying Metrics in AppDynamics
- Log in to your AppDynamics Controller.
- Navigate to the Metric Browser.
- Look for metrics under the path:
Custom Metrics|Redis
Verify that metrics like used_memory
, connected_clients
, and keyspace_hits
are visible.
Conclusion
By combining the power of Redis with the advanced monitoring capabilities of AppDynamics, you can ensure your application remains scalable and responsive under varying workloads. Whether you’re troubleshooting an issue or optimizing performance, this setup gives you full visibility into your Redis instance.
If you found this guide helpful, please share and connect with me for more DevOps insights!