How can i resolve a problem with Logstash? - logstash

I have installed java: jdk11 and jre11 , also logstash installed via apt-get, but when i call it: systemctl enable logstash
Here is answer:
Failed to enable unit: Unit file logstash.service does not exist.
So when i type apt-get install logstash
system says that it has already installed.

Try the following steps to create the logstash.service file.
Edit the file /etc/logstash/startup.options and put the variables for your java binary and java home, something like that:
JAVACMD=/opt/java/jdk1.8.0_161/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_161
Run the script /usr/share/logstash/bin/system-install
After running the system-install script you should be able to start logstash as a service on your system.

Related

/etc/init.d/logstash file not created for RHEL 6.8

I downloaded logstash-6.4.0.rpm and Installed with
yum install logstash-6.4.0.rpm
for RHEL 6.8 but etc/init.d/logstash
After installation, I got a message
Successfully created system startup script for Logstash
But the file is not created, it is autogenerated for SysV See here
I tried generating manually by editing /etc/logstash/startup.options added like this
JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111
and then went to /user/share/logstash/bin and ran sudo ./system-install Saw Here
After executing sudo ./system-install again got same message
Successfully created system startup script for Logstash
But still, the file is not created. Any idea, how I can achieve this?
I was able to generate the logstash service I was missing some options in the command.
step 1: check where your logstash is with command whereis logstash > for me :
[root#user ~]# whereis logstash
logstash: /etc/logstash /usr/share/logstash
step 2: edit /etc/logstash/startup.options file and correct path for JAVACMD and JAVA_HOME
JAVACMD=/opt/java/jdk1.8.0_111/bin/java
JAVA_HOME=/opt/java/jdk1.8.0_111
step 3: Go to /usr/share/logstash/bin and run system-install with sudo
sudo ./system-install /etc/logstashstartup.options sysv
Result
[root#user bin]# sudo ./system-install /etc/logstash/startup.options sysv
Using provided startup.options file: /etc/logstash/startup.options
Manually creating startup for specified platform: sysv
Successfully created system startup script for Logstash

How to know whether Apache is install or not from centos 7

I am new to centos 7. I want to install apache (httpd). so i command yum install httpd it says already installed. but i could find any file in etc directory.
There is folder in etc httpd but no file are there in this directory.
In CentOS there are no files in /etc/httpd since they are all in subdirectories.
/etc/httpd/conf/httpd.conf is main configuration file, and there are additional configuration files in /etc/httpd/conf.d and /etc/httpd/conf.modules.d directories which are included by main file.
To see in browser that Apache is installed, first start Apache using following command and then open http://localhost in browser:
sudo systemctl start httpd
You can also ask Apache status from commandline with command:
sudo systemctl status httpd
I'm not completely sure about what that outputs in all cases, but seems to output at least Loaded: loaded on second line when Apache has been installed.
The unix which command shows the full path of a command.
In order to check if Apache is installed, just check from the console if any of possible apache command exists :
> which apache || which httpd || which apache2
If there is no answer, Apache is not available...

phpMyAdmin downloads a file when I try to open it after installing LAMP on my 12.04 LTS system

I just installed LAMP on my 12.04 LTS system, but whenever I try to run phpMyAdmin, a stranage file downloads. Anyone got a solution for such an issue?
As it seems to me, your apache could have not been started. To check is if it running you can use one the following command (in console/terminal).
pgrep apache
Any output means it is running, no output means it is not.
If it is not running, start it and then try to access phpMyAdmin again.
To start it:
[sudo] /etc/init.d/apache2 start
Where of course, sudo in brackets is optional (but I would recommend using it).
More information would be definitively appreciated. For example what kind of file is downloaded.

Can't launch sonar 2.8 (permission denied to execute wrapper )

I'm new to Sonar, and i was trying to install Sonar 2.8 on my server (Linux 64 on HP-UX)
When i tried to launch it (sonar.sh start) i got the following message
[myHomeDirectory]/sonar/2.8/bin/linux-x86-64/./wrapper: Execute permission denied.
what drives me crazy is that i've putthe whole package on 777 permissions, so i really don't understand what's exactly happening.
Can anyone help with this please ?
Thanks in advance !
I hit a similar issue hence why I came to this post. I was attempting to install SonarQube's scanner in a Docker container but when I was running it, I was getting something along the lines of:
/root/sonar-scanner-2.6.1/bin//sonar-scanner: 103: exec: : Permission denied
I had given the whole /root/ folder all permissions so I was curious about the permission denied. In the end for me it wasn't anything to do with permissions. I simply needed to RTFM.
Sonar-scanner needs a JRE to run and my Docker container didn't have one installed. So if anyone else does the same thing as me, I hope this saves you a few minutes of head scratching.
Not really convinced in the way you are launching it. To get Sonar running I recommend running it on tomcat, providing you just want to use the default database that comes with Sonar. The steps would be:
Install Tomcat
Navigate to your /war directory within your sonar instance and run the command: $] ./build-war.sh.
When this finishes you should see a sonar.war file in the same directory.
Rename the war file ROOT.war instead of sonar.war: $] mv sonar.war ROOT.war
This ensures that sonar runs on tomcat's default port.
Move the war file into the tomcat webapps directory: $] mv ROOT.war /tomcathome/webapps
Navigate to the tomcat /bin folder and run the command $] ./catalina.sh start
Type your server hostname in your browser with a port :8080 at the end and you should see sonar running.
These steps will have sonar running on the default database, though. If you want a MySQL database i'd look at sonar tutorials on how to do that.
I finally came out with the conclusion that the binary file (wrapper) is simply not compiled to run under HP-UX
when launching a file command on wrapper under a Linux i get : <ELF-64 executable object file> which doesn't match the <ELF-64 executable object file - IA64> required by HP-UX running on a Itanium processor
Please check if you have java installed on the machine. Java should be installed on the machine before running sonar-runner.
Use this to check java : java -version

Creating MongoDB Start-up script

I have been struggling on creating mongodb start-up script.
I have this file here "script.js" that contain my scripts that i want to execute every-time the server boot.
My script file is under "/opt/temp/script.js"
db.getCollectionNames().forEach(function(collection) {
print(collection);
});
Which command should I write to execute this file every time after the sever restarted ?
Where to put that command ?
Please help me
Thanks you..
What version of Linux are you using, what version of MongoDB have you installed, and how did you install it?
If, for example, you installed Mongodb on Ubuntu as per the MongoDB Docs you should have a start up script in /etc/init.d/mongod which will auto-start MongoD on boot.
If you have installed, say, a release candidate in a non standard location, I found these scripts to be fairly good and very alterable.
Using this script will NOT guarantee mongod starting on boot. You'll need to use sysv-rc-conf to set the run-levels correctly, like the apache2 line in the image linked.
Hi I managed to get it working I created Script.jsfile with my mongoDb commands and place it at /op/myscripts. Then on the mongodb-confI included the command to execute my script once mongodb is started command mongo /opt/myscripts/script.js.

Resources