Install Jenkins in specific folder in RHEL - linux

When we install jenkins, by default it installs at /var/lib directory in the RHEL machine. But I want to install jenkins in other folder or filesystem. for example /jenkins.
Before installing jenkins I changed JENKINS_HOME=/jenkins and tried installing jenkins but it wont work.
These are the steps which I followed to install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
But the result is same it installs in /var/lib.
How can I install in /jenkins directory this?

Edit the /etc/sysconfig/jenkins file and change:
JENKINS_HOME = /var/lib/jenkins
to
JENKINS_HOME = /jenkins
and restart Jenkins.

Related

How can we enable UCI interface available on openwrt on ubuntu.

How can we enable UCI interface available on openwrt on ubuntu. Currently, I installed libuci and libubox, with which I am able to get and set configuration parameters for files under /etc/config in ubuntu. But these values are not reflected in system services when I do a service restart. For example I set some values in /etc/config/network and /etc/config/dhcp . But /etc/init.d/networking reload, the system is picking up values from /etc/dnsmasq.conf and /etc/network/interfaces.
You can run uci in Ubuntu by following the instructions available in (external link). Make UCI in UBUNTU 16.04 , Raspbian Jessie or similar.
First make a directory for download source codes
mkdir ~/Desktop/uci
Install json-c
Install the required packages:
sudo apt-get install dh-autoreconf git
Download source code:
cd ~/Desktop/uci
git clone https://github.com/json-c/json-c.git
Make and install json-c:
cd json-c
sh ./autogen.sh
./configure
make
sudo make install
make check
Install libubox
Install the required packages:
sudo apt-get install lua5.1 liblua5.1-0-dev cmake
Download source code:
cd ~/Desktop/uci
git clone https://git.openwrt.org/project/libubox.git
Install libubox
cd libubox
cmake .
make
sudo make install
Install uci
Download source code:
cd ~/Desktop/uci
git clone https://git.openwrt.org/project/uci.git
Make and install uci:
cd uci
cmake .
sudo make install
Now you can use uci :
uci
If you still see this message:
error while loading shared libraries: libubox.so: cannot open shared object file: No such file or directory
edit this file:
sudo nano /etc/environment
Add this command into it:
LD_LIBRARY_PATH=/usr/local/lib
or this file
sudo nano /etc/profile
Add these commands into it:
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
Then restart your computer.

Empty file in /var/lib/jenkins diectory on centOS

I am using Jenkins on centOS/Linux server. Now I am facing the same problem like this.
I have tried uninstalling Jenkins more than 2 times, but still getting the same empty file on the /var/lib/jenkins location.
I think I made some mistakes while uninstalling, I used this command to uninstall.
sudo yum clean all
sudo yum remove jenkins
sudo yum install jenkins
Is this correct way for uninstalling Jenkins?
And how to get files into the folder /var/lib/jenkins.?
Can anyone tell me to solve this...
You must start jenkins first. The jenkins itself populates the /var/lib/jenkins.
Just use
systemctl start jenkins
After that open in browser http://localhost:8080

Install Apache Zeppelin binary on Ubuntu Linux

I'm trying to install Apache Zeppelin and various interpreters on Ubuntu Linux using AWS EC2. Below are my steps for the binary and from source.
SSH through Putty as ubuntu#IP
wget http://mirrors.gigenet.com/apache/zeppelin/zeppelin-0.6.2/zeppelin-0.6.2.tgz
sudo tar -zxf zeppelin-0.6.2.tgz
cd zeppelin-0.6.2
sudo bin/zeppelin-daemon.sh start
It gives me the following status in the cli:
Zeppelin start [OK]
Zeppelin process died [FAILED]
I then tried to install build from source using the following:
sudo apt-get update
sudo apt-get install git
sudo apt-get install openjdk-7-jdk
sudo apt-get install npm
sudo apt-get install libfontconfig
git clone https://github.com/apache/zeppelin.git
apt-cache search maven
sudo apt-get install maven
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=1024m"
mvn -version
I use the java home directory and set the environment variable for JAVA_HOME by
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
cd into zeppelin folder and then run
mvn clean package -Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pscala-2.11
And it builds Zeppelin but fails at the next Zeppelin: Interpreter
How do I get her to work without going to AWS EMR? Thanks in advance.
The tgz file that you downloaded is source file. Not prebuild one. So you need to build it first before you try to start Zeppelin daemone. If you won't modify the source, I'd recommend you to download binary package.
$ http://mirrors.gigenet.com/apache/zeppelin/zeppelin-0.6.2/zeppelin-0.6.2-bin-all.tgz
$ sudo tar -zxf zeppelin-0.6.2-bin-all.tgz
$ cd zeppelin-0.6.2-bin-all
$ sudo bin/zeppelin-daemon.sh start
Then you can start Zeppelin server without any further steps.

Jenkins docker missing some binaries

I am running Jenkins in docker from official docker hub .
I created job which runs my own shell script, however I see some binaries
are missing in docker e.g.file command.
They mention on docker hub that one can install additional binaries over Ubuntu's aptitude however I don't know which package to install to get e.g file command working.
Unless Ubuntu did something different than the base Debian environment, file is included in the file package.
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -f file

PM2 inside bash script deployed and executed with puppet not working

#!/bin/bash
yum -y install gcc-c++
wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
tar -xvzf node-v0.12.7.tar.gz
cd node-v0.12.7
./configure
make
sudo make install
yum -y install git
/usr/local/bin/npm install pm2 -g
cd /home/admin/Order-Management/
/usr/local/lib/node_modules/pm2/bin/pm2 start processes.json
The above script run perfectly when I run it locally but when I try to execute it with puppet on the client machine the last line throwing the following error.
/usr/bin/env: node: No such file or directory
I am using RedHat 6 master and RedHat 6 client. I saw a solution here
Node forever /usr/bin/env: node: No such file or directory However not working for me. Any help will be much appreciated.
I had to add environment variable for puppet exec resource. That was not a problem for node.

Resources