How to start GlassFish Server on Windows 7? - glassfish

I installed GlassFish Server in C:\glassfish3 directory.
When I type "dir" in c:\glassfish3\bin directory the files are listed just fine.
But when I type asadmin I get "The system cannot find the path specified."
What might be wrong?
How am I going to start GlassFish server?
-- Edit --
Also, after Installation I get:
Creating domain
Executing command :C:\glassfish3\glassfish\bin\asadmin.bat --user admin --passwordfile - create-domain --savelogin --checkports=false --adminport 4848 --instanceport 8080 --domainproperties=jms.port=7676:domain.jmxPort=8686:orb.listener.port=3700:http.ssl.port=8181:orb.ssl.port=3820:orb.mutualauth.port=3920 domain1
C:\glassfish3\glassfish\bin\asadmin.bat --user admin --passwordfile - create-domain --savelogin --checkports=false --adminport 4848 --instanceport 8080 --domainproperties=jms.port=7676:domain.jmxPort=8686:orb.listener.port=3700:http.ssl.port=8181:orb.ssl.port=3820:orb.mutualauth.port=3920 domain1 The system cannot find the path specified.

glassfish requires jdk6 or 7 already installed. type java -version on command line. if it's not working then you need to install it.
alternatively you can tell glassfish to look for a particular jdk, by modifying C:\glassfish3\glassfish\config\asenv.bat -- but I wouldn't recommend it.

Related

Problem while bootstraping ubuntu chef node from chefDK on windows workstation

I'm new to Chef and I have stuck in a problem. I'm using AWS Chef Automate Server and EC2 ubuntu instance as Chef Node. My workstation is local machine where I have installed ChefDK on windows. I have successfully configured the Chef server with ChefDK.
When I bootstrap the node using Knife Bootstrap command, it bootstraps the ubuntu node but shows this error in the end cannot create /etc/chef/trusted_certs/opsworks-cm-ca-2016-root.pem: Directory nonexistent
The command I used here is knife bootstrap myEC2PublicIPHere -N UmaidNode1 -x ubuntu --sudo --run-list "recipe[nginx]" -i .chef/my_key.pem.
After that I added some other cookbooks in the server and run Knife ssh command from my windows workstation to run Chef-client on the node, but this command is not working. I have tried it with different attributes, but always the similar issue FATAL: 1 node found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.
The command I tried here is knife ssh 'name:*' --attribute myEC2PublicIpHere -x ubuntu -i .chef/my_key.pem 'sudo chef-client'.
Furthur upon running this command knife node show UmaidNode1, it shows the data about node where IP is blank. I don't know why it is not getting this IP here. Showing the output Node Name: UmaidNode1 Environment: _default FQDN: IP: Run List: recipe[nginx], recipe[apache] Roles: Recipes: Platform: Tags:
enter image description here
The issue is finally resolved. I don't know why, but the problem was with the ChefDK version. I was using the latest version 4.8.23. It always creates directory /etcchef but the chef searches for all files in the directory /etc/chef. So it was unable to get the files like client.rb etc.
NOTE: I even make the required /etc/chef directory by myself, but it didn't work.
I installed an older version of ChefDK and now it's working fine.

I configured sonar in my local host Ubuntu 16.04 but http://localhost:9000/sonar not working

I am configuring sonar(https://www.sonarqube.org) to my local machine which has Ubuntu 16.04 OS with LAMP(Linux,Apache,mysql,PHP) installed in it.
I have considered these reference link to setup SonarPHP
https://www.howtoforge.com/tutorial/how-to-install-sonarqube-on-ubuntu-1604/
https://www.talentica.com/blogs/sonarqube-php-project-ubuntu/
Now I can see that sonar is running in my PC but link http://localhost:9000/sonar is not working.
Please help me.
After lot of research I found the solution. I am explaining step by step process of how to setup Sonar in Ubuntu16.04 so other's developer who is new to sonar can understand this process.
Step 1
Download sonar "Community Edition 7.7" from this link https://www.sonarqube.org/downloads/
Step 2
Unzip file and move folder to /opt/sonarqube
Step 3
Update Sonar configuration file
sudo vi sonarqube-7.0/conf/sonar.properties
Update following values [database user = sonarqube,database = sonarqube]
sonar.jdbc.username=sonarqube
sonar.jdbc.password=some_secure_password
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
sonar.web.host=127.0.0.1
sonar.web.javaAdditionalOpts=-server
...
Step 4
Create new service in ubuntu 16.04
sudo vi /etc/systemd/system/sonarqube.service
add following text to file and make sure that you have double checked mentioned path.
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sonarqube
Group=sonarqube
Restart=always
[Install]
WantedBy=multi-user.target
Start sonar by following command
sudo service sonarqube start
Check sonar status using following command
service sonarqube status
Enable sonar by following command
sudo systemctl enable sonarqube
Step 5
Create Mysql database user and database with following details
Database Username : sonarqube
Database Name : sonarqube
Done.
For project scan you have to download and setup sonar-scanner.
I have taken following links for reference.
https://www.digitalocean.com/community/tutorials/how-to-ensure-code-quality-with-sonarqube-on-ubuntu-16-04
https://www.talentica.com/blogs/sonarqube-php-project-ubuntu/

How to configure glassfish or Tomcat server with netbeans Ide in ubuntu 14.04 in 32-bit System

In ubuntu 14.04,i tried to configure glassfidh sever in netbeans. I am also following below steps.
But it could not configured.
Step 1: wget http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip
Step 2: unzip glassfish-4.1.zip -d /opt/
Step 3: nano ~/.profile
Step 4: source ~/.profile
Step 5: asadmin start-domain
step 1 to step 4, there is no problem but at step 5 there is problem like:
No command 'asadmin' found, did you mean: Command 'acsadmin'
from package 'ion' (universe) Command 'amadmin' from package
'amanda-server' (universe) asadmin: command not found
i am following above steps, if i am wrong please correct me.
Thank you.
The asadmin tool is located in the glassfish4 directory that you unzipped. The error message is Ubuntu telling you that it doesn't know of any command named asadmin.
You will need to specify where the asadmin tool is for Ubuntu to interact with it. If you are in the same directory, this means using:
./asadmin start-domain
If you want to be able to start GlassFish like this regardless of the directory, it would be best to install GlassFish as a service as follows:
./asadmin create-service
You should then be able to run something like the following from any terminal window:
service GlassFish_domain1 start
service GlassFish_domain1 stop
service GlassFish_domain1 restart
Find out more details about the options for the command by using the following:
./asadmin help create-service

How to install schema registry

I am looking options to install confluent schema registry, is it possible to download and install registry alone and make it work with existing kafka setup ?
Thanks
Assuming you have Zookeeper/Kafka running already, you can easily run Confulent Schema Registry using Docker with running the following command:
docker run -p 8081:8081 -e \
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=host.docker.internal:2181 \
-e SCHEMA_REGISTRY_HOST_NAME=localhost \
-e SCHEMA_REGISTRY_LISTENERS=http://0.0.0.0:8081 \
-e SCHEMA_REGISTRY_DEBUG=true confluentinc/cp-schema-registry:5.3.2
parameters:
-p 8081:8081 - will open the port 8081 between the container to your machine
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL - is your Zookeeper host and port, I'm using host.docker.internal to resolve local machine that is hosting Zookeeper (outside of the container)
SCHEMA_REGISTRY_HOST_NAME - The hostname advertised in Zookeeper. This is required if if you are running Schema Registry with multiple nodes. Hostname is required because it defaults to the Java canonical hostname for the container, which may not always be resolvable in a Docker environment.
SCHEMA_REGISTRY_LISTENERS - the Schema Registry host and port number to open
SCHEMA_REGISTRY_DEBUG Run in debug mode
note: the script was using the version 5.3.2, make sure this version is aligned with your Kafka version.
Yes you can use your existing Kafka setup, just match to the compatible version of Confluent Platform. Here are the docs on getting started
https://docs.confluent.io/current/schema-registry/docs/intro.html#installation
tl;dr download the platform to pull out the pieces you need or get the docker image and point it at your Kafka cluster.

how to list glassfish instances?

I have a glassfish domain running, but I cannot get the PID of the associated java process, is this broken or am I doing something wrong? I have FreeBSD 10.1, OpenJDK 1.7.0, and Glassfish 4.1.
$ asadmin list-domains -l
DOMAIN ADMIN_HOST ADMIN_PORT RUNNING RESTART_REQUIRED
domain1 127.0.0.1 4848 true false
Command list-domains executed successfully.
$ asadmin list-instances -l
Nothing to list.
Command list-instances executed successfully.
I can do jps -v, but with that I am not 100% sure the listed PID is my glassfish server...
$ jps -v
62737 Jps -Dapplication.home=/usr/local/openjdk7 -Xms8m
EDIT:
Ok. the jps command is definitely not what I want - that is just showing itself. Also I tried
$ asadmin list-instances -l domain1
remote failure: The target, domain1, is not an instance, cluster, domain, node or config.
Command list-instances failed.
and
$ asadmin list-instances -l 127.0.0.1
remote failure: The target, 127.0.0.1, is not an instance, cluster, domain, node or config.
Command list-instances failed.
Take a look at this issue from the Glassfish JIRA Server.
https://java.net/jira/browse/GLASSFISH-12744