JMX ports added to startup script in weblogic server - jmx

I have a weblogic cluster env with one admin and two managed servers, i need JMX ports added to startup script.
I have two shell script to start admin and managed server.
Please advice how to add the JMX port in the start up script.

Add the following JVM parameters to your Weblogic startup scripts
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888
Goto admin console> server> click on managed server > server start > Argument.
You can add above parameter in under argument list.

also add -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder in the arguments list

Related

Getting 401 Unauthorized error while trying to launch Jenkins slave via command line through JNLP using -secret option

I am trying to launch my Jenkins slave via command line through JNLP, so that I can put the command in the task scheduler. However, I am facing authentication issues only when I use the -secret option with the secret key generated by Jenkins. Works fine if I pass the -auth option with the same username password that I use for Jenkins.
java -jar slave.jar -jnlpUrl http://<jenkins host>:<port>/jenkins/computer/<Slave name>/slave-agent.jnlp -secret <secret_key> -workDir "C:\Jenkins\Robot"
Note: the command I try to execute is as is copied from Jenkins page.
It gives following error:
org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDirINFO: Using C:\Jenkins\Robot\remoting as a remoting work directory Both error and output logs will be printed to C:\Jenkins\Robot\remoting Not use http_proxy property or environment variable which is invalid: unknown protocol: one.proxy.att.com Failing to obtain http://<host:port>/jenkins/computer/<job>/slave-agent.jnlp?encrypt=true
java.io.IOException: Failed to load http://<host:port>/jenkins/computer/<job>//slave-agent.jnlp?encrypt=true: 401 Unauthorized
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:485)
at hudson.remoting.Launcher.run(Launcher.java:316)
at hudson.remoting.Launcher.main(Launcher.java:277)
Waiting 10 seconds before retry
However, if I change command as follows, it runs successfully.
java -jar slave.jar -jnlpUrl http://<jenkins host>:<port>/jenkins/computer/<Slave name>/slave-agent.jnlp/slave-agent.jnlp -auth <user>:<pass> -workDir "C:\Jenkins\Robot"
I cannot keep my credentials in the launch file as this will remain in public shared repository. Pls help.
I think that your issue may come from a security management.
Have you enable TCP port for JNLP agents in your Global Security ?
Go to Manage Jenkins > Global Security, Enable TCP port for JNLP agents, select Fixed and fill the port you used in your jnlpUrl, then select Java Web Start Agent Protocol/4 and save your config.
Further documentation here.
I had a similar problem. I resolved it by allowing anonymous access to Jenkins (the option is available in Manage Jenkins page, Kerberos properties section - we use Kerberos Single Sign-On plugin for Jenkins authentication, so not sure how would other authentication plugins work).
I'd also recommend limiting the scope of anonymous access if you enable it.

Why am I not able to access Jenkins remotely?

My jenkins has suddenly stopped being accessed from a remote machine. I have tried the following command to open it from another machines:
java -jar jenkins.war --httpPort=8085 --httpListenAddresss=0.0.0.0
and then I am tried to open it using
http://hostname:8085
And
http://ip:8085
but I am not able to access it. To launch the slave on other machine I need to have access to that url.
note: I am able to ping to my host name from any remote machine.
I given access to all inbound and outbound connections from my firewall
You can see the correct URL in Nodes view:
Create dummy node with "Launch method" = "Launch agent via Java Web Start"
Save it
Choose this 'dummy' node
Jenkins should show you a command line with correct URL, i.e.
java -jar slave.jar -jnlpUrl http://myjenkinsserver:8080/computer/dummy/slave-agent.jnlp -secret c159219e557d0e612371b97d86f9a319584cf1c53b8ab9df73f34b46eed8865c

Issues with Jenkins 1.67 URL set up

I am trying to set a new Jenkins instance (version 1.67) on to a Windows Server 2012 r2.
I am trying to configure a custom URL instead of using
localhost:8080
etc..
I have set Jenkins URL as
NewServer.domainname.com
But I cannot access it via that url, I get presented with a message "Remote Web Access is turned off" it only allows me to connect when I follow the URL with the port number;
NewServer.domainname.com:8080
I am sure that Remote web access is completely different from what my goal is.
By default, Jenkins launches its own built-in webserver, listening on port 8080.
Changing the URL in the Jenkins configuration does not change the port that the running webserver listens on, but rather the URL that is shown within the UI, or in emails sent to users etc.
In order to access Jenkins at just NewServer.domainname.com (i.e. running on port 80), you would first have to disable Windows Remote Web Access, which is currently occupying port 80.
You would then need to stop Jenkins and start it again with the flag --httpPort=80; these options are documented on the Jenkins wiki.
If Jenkins was started as a Windows Service, you can edit the jenkins.xml file as shown in these answers.
Just wanted to say, after setting Jenkins.xml to run on port 80, and then via the Jenkins web interface using
'install as service'
I found that this process seemed to create a new jenkins.xml along with the default httpPort which is stored within the Jenkins.war.
I get around this I installed as a service, ensured that the service was not set to start on start up. Rebooted the machine
On start up I re-edited the jenkins.xml httpPort value back to 80. Started the service and now running very happy!

jenkins job to check if port 80 responds to a http request

I am new to jenkins.I need to create a jenkins job to check if port 80 responds to a http request with 200 and restart apache if it is not.Please advise.
You need Conditional Build Step and HTTP Request plugins.
Enable build step as condition in global configuration.
Setup a job with Conditional build step executing HTTP Request plugin, and on failure restart apache.
Restarting apache can be done through Publish over SSH plugin, or through Execute shell buildstep, if you are on Linux. If you are on Windows, you will need Execute batch command buildstep, and then use plink.exe that comes with Putty to connect to your apache server. This is all providing that your apache server is running on Linux in the first place.
If your apache is on Windows, that's a whole different can of worms.
You are not providing any information in your question, and as it is, it is too broad and shows zero research on your part.

GlassFish as windows service

I am using GlassFish 3.1.2. I want to create a service of GlassFish so that each the system start it will automatically start the GlassFish domain.
In default domain domain1, there is a cluster cluster1 having two instances instance1 and instance2.
But when I use the command...
asadmin>domain1Service.exe start
It starts the domain, but clusters are not started. So How can I make a service which can start clusters ??
Do I have to create separate service for each instance within a cluster ??
We can create service over cluster instance in GlassFish.
For that we have to create separate service for each instance.
This command is used to create service for each an instance..
asadmin>>create-service --nodedir <<node-dir location>> <<node-name>>
Thanks,
Gunjan.
It sounds like you are running this on a windows machine, so I would write a batch script (.bat) that executes the appropriate asadmin commands.
asadmin start-domain --user admin --passwordfile adminpassword.txt domain1
asadmin start-cluster --user admin --passwordfile adminpassword.txt cluster1
Than I would setup the service to point at the batch file.

Resources