Kinesis Data Stream
Kinesis Data Stream
—Manish
1- Create User role and give access to Data Stream , S3 and EC2.
2- Configure EC2 Instance.
3- Create Data Stream.
4-Download data test data from my GitHub repository.
5- Login to EC2 instance from your local terminal.
6- install Agent in the EC2 instance.
7- configure stream data file in EC2.
Login to EC2 instance.
Sudo su
Install the Kinesis agent
Latest version.
Go to the logs inside /var and create the folder called weather. mkdir weather
{
"cloudwatch.emitMetrics": true,
"kinesis.endpoint": "",
"firehose.endpoint": “”,
"awsAccessKeyId": “AKIATPF6UVKKPZJGNHHD”,
"awsSecretAccessKey": “TBidJNOGxTqfLtUhDn5O5ysnFJMhphtDFsYPEDUq",
"flows": [
{
"filePattern": “/var/log/weather/.log*",
"kinesisStream": "Kinesis-Data-Stream-City-Temp",
"partitionKeyOption": “RANDOM”,
“dataProcessingOptions": [
{
“optionName” : “CSVTOJSON”
“customFieldNames” : [ “Region”,”Country”,”City”,”Month”,”Day”,”Year”,”AvgTemperature”]
}
]
}
]
1- Add the www group to your EC2 instance with the following command:
[ec2-user ~]$ sudo groupadd weather
3- To refresh your permissions and include the new www group, log out:
[ec2-user ~]$ exit
4- Log back in again and verify that the www group exists with the groups:
[ec2-user ~]$ groups
> ec2-user wheel weather
5- Change the group ownership of the /var/weather directory and its contents to the www group:
[ec2-user ~]$ sudo chown -R root:weather /var/log/weather
6- Change the directory permissions of /var/www and its subdirectories to add group write permissions and set the group ID on subdirectories created in the
future:
[ec2-user ~]$ sudo chmod 2775 /var/log/weather
[ec2-user ~]$ find /var/log/weather -type d -exec sudo chmod 2775 {} +
Thank you