awslabs / amazon-kinesis-agent

Continuously monitors a set of log files and sends new data to the Amazon Kinesis Stream and Amazon Kinesis Firehose in near-real-time.
Other
352 stars 218 forks source link

start-aws-kinesis-agent returns "No such file or directory" on clean install #268

Open JeremyCanfield opened 2 months ago

JeremyCanfield commented 2 months ago

As ec2-user on an EC2 instance, I use wget to download master.zip.

[ec2-user@ip-172-31-86-107 ~]$ wget https://github.com/awslabs/amazon-kinesis-agent/archive/refs/heads/master.zip

I unzip master.zip in my present working directory which is /home/ec2-user.

[ec2-user@ip-172-31-86-107 ~]$ unzip master.zip

I move into the amazon-kinesis-agent-master directory and run setup --install. It complains I am not root.

[ec2-user@ip-172-31-86-107 ~]$ ./setup --install Detected OS Distro: RedHat This script must be run as root

I run setup --install with sudo. All good.

[ec2-user@ip-172-31-86-107 ~]$ sudo ./setup --install . . . Your installation has completed!

I try to start the Agent and I get the following.

[ec2-user@ip-172-31-86-107 ~]$ /home/ec2-user/amazon-kinesis-agent-master/bin/start-aws-kinesis-agent /home/ec2-user/amazon-kinesis-agent-master/bin/start-aws-kinesis-agent: line 125: cd: /home/ec2-user/amazon-kinesis-agent-master/bin/../share/aws-kinesis-agent/lib: No such file or directory

As a quick and dirty workaround, I mkdir /home/ec2-user/amazon-kinesis-agent-master/share/aws-kinesis-agent/lib.

[ec2-user@ip-172-31-86-107 ~]$ mkdir --parents /home/ec2-user/amazon-kinesis-agent-master/share/aws-kinesis-agent/lib

And copy the JAR files into the directory I just created.

[ec2-user@ip-172-31-86-107 ~]$ cp /usr/share/aws-kinesis-agent/lib/* /home/ec2-user/amazon-kinesis-agent-master/share/aws-kinesis-agent/lib

And the agent starts.

Maybe this happens because I had to use sudo?