Deploying Redis to persist Mosquitto sensor data
To install our Redis to persist Mosquitto weather data, we are going to use Redis with persistence and a single list of messages. To deploy this Redis setup in your cluster, follow these steps:
- Create the PersistentVolume to persist Redis data using the
/mnt/data
directory in the node:$ cat <<EOF | kubectl apply -f - apiVersion: v1 kind: PersistentVolume metadata: name: db-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 5Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" EOF
- Create a PersistentVolumeClaim using 5 GB of storage or more, depending on how many sensors and how much data you are processing:
$ cat <<EOF | kubectl apply -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: ...