Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation hands on #2125

Closed
Frazer-Nyambe opened this issue Jun 27, 2022 · 11 comments
Closed

Installation hands on #2125

Frazer-Nyambe opened this issue Jun 27, 2022 · 11 comments

Comments

@Frazer-Nyambe
Copy link

i'm on the step below and the buffer is saying : [ Directory '/opt/karaf/bin' does not exist ]

Creating a setenv.sh Script for Karaf

Similar to Tomcat, our Karaf service is going to rely on a setenv shell script to determine environment variables Karaf needs in place when running. For now, this will simply be the path to JAVA_HOME, but this also accepts many other parameters you can find in the default setenv script.

/opt/karaf/bin/setenv | karaf:karaf/755

#!/bin/sh
export JAVA_HOME="PATH_TO_JAVA_HOME"

PATH_TO_JAVA_HOME: This will be the same JAVA_HOME we used when installing Tomcat , and can be found using the same method (i.e., still /usr/lib/jvm/java-11-openjdk-amd64 if that's what it was before).
@flummingbird
Copy link

flummingbird commented Jun 27, 2022

Frazer-Nyambe, I think this is a similar problem to what you've faced before:

check this path:
ls /opt/karaf/
or
ls /opt/apache-karaf-*

if there isn't anything there go back to this step:

sudo wget -O karaf.tar.gz KARAF_TARBALL_LINK
sudo tar -xzvf karaf.tar.gz
sudo chown -R karaf:karaf KARAF_DIRECTORY
sudo mv KARAF_DIRECTORY/* /opt/karaf

The variables in ALL_CAPS are supplied by you, visit https://karaf.apache.org/download.html for the KARAF_TARBALL_LINK probably (https://dlcdn.apache.org/karaf/4.4.0/apache-karaf-4.4.0.tar.gz),

when you run sudo tar -xzvf karaf.tar.gz you should use the directory that outputs as the KARAF_DIRECTORY variable.
(if you ls /opt/apache-karaf-* I think that will help you find the correct directory, which I think is /opt/apache-karaf-4.4.0)

If you have more trouble let me know.

@Frazer-Nyambe
Copy link
Author

The first code outputs:
frazer@frazer-Islandora:~$ ls /opt/karaf/
ls: cannot access '/opt/karaf/': No such file or directory

Then the second code outputs the following content:
frazer@frazer-Islandora:~$ ls /opt/apache-karaf-*
bin data etc lib NOTICE RELEASE-NOTES.md
BUILDING.md deploy examples LICENSE README.md system

@Frazer-Nyambe
Copy link
Author

is there some code i would run to probably uninstall karaf and restart the whole installation process.

@Frazer-Nyambe
Copy link
Author

So the directory 'opt/karaf' does not exist, where is it created?:

frazer@frazer-Islandora:/opt$ sudo mv /opt/apache-karaf-4.4.0/* opt/karaf
mv: target 'opt/karaf' is not a directory

@seth-shaw-unlv
Copy link
Contributor

So the directory 'opt/karaf' does not exist, where is it created?:

opt/karaf is relative because it lacks the leading '/'. Try sudo mv /opt/apache-karaf-4.4.0/* /opt/karaf

Although, with Alpaca 2.0, you no longer need Karaf. The installation instructions should be updated to reflect that.

@Frazer-Nyambe
Copy link
Author

@seth-shaw-unlv i'm still getting the below output:

frazer@frazer-Islandora:/opt$ sudo mv /opt/apache-karaf-4.4.0/* /opt/karaf
mv: target '/opt/karaf' is not a directory

@seth-shaw-unlv
Copy link
Contributor

Well it looks like the step earlier in the instructions, sudo adduser karaf --ingroup karaf --home /opt/karaf --shell /usr/bin, wasn't successful in creating the home directory. I suppose you could try running that again, or simply create the directory manually: sudo mkdir /opt/karaf.

Alternatively, you could create a link instead of moving everything over: sudo ln -s /opt/apache-karaf-4.4.0 /opt/karaf.

@Frazer-Nyambe
Copy link
Author

The file path below tells me that...... [ Directory '/opt/karaf/etc' does not exist ] ...... ON the step for Configuring Karaf Logging

frazer@frazer-Islandora:/opt$ sudo nano /opt/karaf/etc/org.pos4j.pax.logging.cfg

@Frazer-Nyambe
Copy link
Author

or maybe help me with the uninstallation instructions so that i can restart the whole process for karaf

@flummingbird
Copy link

flummingbird commented Jun 29, 2022

Sorry you're having so much trouble.

I think we can get what you have fixed.
ls /opt/apache-karaf-4.4.0/*

If it outputs bin data etc lib NOTICE RELEASE-NOTES.md
then you still have the files you need. We just need to get them to a directory.

If you can confirm that ls /opt/karaf
is not a directory try running sudo mkdir /opt/karaf
then ls /opt you should see karaf listed among other directories

Now you have a choice you can simlink as Seth Suggests (thanks seth!)
sudo ln -s /opt/apache-karaf-4.4.0 /opt/karaf
or you can move the files from one directory to the other as in
sudo mv /opt/apache-karaf-4.4.0/* /opt/karaf
this should work now that the directory /opt/karaf is properly created.

I do think we should also check that the karaf user is set up correctly too, cat you write:
groups karaf
If you get no user try sudo adduser karaf --ingroup karaf

@Frazer-Nyambe
Copy link
Author

This worked thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants