August 2025
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2025
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Why does yum return error: [Errno 256] No more mirrors to try

Issue

  • yum update fails with the error : [Errno 256] No more mirrors to try
  • yum update fails with :-
Error Downloading Packages:
InstallMedia: [Errno 256] No more mirrors to try.
  • yum fails with :
Error Downloading Packages:
ftp-0.17-35.el5.x86_64:failure:ftp-0.17-35.el5.x86_64.rpm from Red5repo55:[Errno 256] No more mirrors to try. [[6]]" (code -1) Packages Scheduled
  • yum fails with :
Downloading Packages:
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/supplementary/os/Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error Downloading Packages:
  1:java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64: failure: Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm from rhel-6-server-supplementary-rpms: [Errno 256] No more mirrors to try.

Environment

  • Red Hat Enterprise Linux 5 and later
  • Red Hat Network (RHN)
  • Subscription Management (RHSM)

Resolution

  • Check what files are present under /etc/yum.repos.d directory by:-
# ll /etc/yum.repos.d
  • If the system is registered to RHN Classic, only rhel-source.repo should be present under /etc/yum.repos.d/.
    If the system is registered to subscription-manager (RHSM), rhel-source.repo and ‘redhat.repo’ are present.
    If any local repositories, or any other media repositories are present, remove them by :-
# rm -rf /etc/yum.repos.d/<local or other repository name>
  • Remove old yum cache from system by running following commands:
# rm -fr /var/cache/yum/*
# yum clean all
  • Check if you can list the valid repositories by :-
# yum repolist

Root Cause

  • This issue persist due to following reasons:
    1. Corrupted yum cache.
    2. Inaccessibility of a repository URL from the system.
    3. Presence of customized or other media repositories.

Diagnostic Steps

  • Check the accessibility of the repository URL in the system/network.
# ping URL
  • Check the repositories under /etc/yum.repos.d
ll /etc/yum.repos.d
  • Collect a sosreport of the affected system.

Forward & Reverse Apache Proxy – CentOS 7

Forward Apache Proxy is a proxy configuration that is commonly used in companies and it enables users to access the internet. Users or clients must configure their browsers or operating system to use a proxy server (Forward Apache Proxy) to be able to access the internet. This means that requests from all clients go through this apache Forward Apache Proxy which then communicates with the destination servers, websites, … on the internet and responds back to the clients.

Reverse Apache Proxy is a proxy configuration that works the other way around from the Forward Apache Proxy. The Reverse Apache Proxy configuration is used to enable users or clients from the internet, to access websites or applications on the company internal network, based on the reverse apache proxy rules that are configured. Reverse Apache Proxy provides internet clients access to servers behind a firewall.

FORWARD APACHE PROXY

1. Install Required Packages

Firts we must install Apache (httpd) and mod_ssl package on our server. Please note that in CentOS 7 Apache 2.4.X is available

[root@cluster1  ~]# yum install httpd mod_ssl
2. Basic Forward Apache Proxy Configuration

We need to add a forward proxy configuration file to “/etc/httpd/conf.d” location. We named if “forward-proxy.conf” and added the following content to it:

ProxyRequests On
ProxyVia On
ProxyTimeout 60

<Proxy *>
Require local
Require ip 192.168.1.0/255.255.255.0
</Proxy>
The “ProxyRequests” parameter and “ProxyVia” is needed to enable proxy on Apache. “ProxyTimeout” is optional, it just enables request to fail gracefully if the server does not respond in a reasobnale time. The “Require” parameters inside the “Proxy” directive are the client allowed settings.

You can add a specific IP address (as in my case) or whole subnet (with mask like 192.168.1.0/255.255.255.0). The “Require local” allows localhost requests. You could also use “Require host hostname” directive. There are many more parameters available – this is just basic configuration – read more about additional parameters HERE.

3. Block WebSites

We can block the desired websites using “ProxyBlock” parameter. “ProxyBlock” parameter specifies a list of words, hosts or domains separated by spaces (a wildcard * would block all sites!) as follows:

ProxyRequests On
ProxyVia On
ProxyTimeout 60

ProxyBlock facebook.com plus.google.com twitter.com

<Proxy *>
Require local
Require ip 192.168.1.0/255.255.255.0
</Proxy>
4. Configure Forwarding to Second Proxy

If you work in a big company (or in other situations) there is a possibility your proxy is not the “last in line” out to the open world. In this case you need to configure a second proxy. This is a proxy your proxy will forward requests to, to get to the internet. We can do this with “ProxyRemote” parameter. “ProxyRemote” parameters takes two two arguments, a scheme, partial URL or ‘*’ and a proxy server. Using wildcard ‘*’ will forward all requests to the second proxy.

ProxyRequests On
ProxyVia On
ProxyTimeout 60

ProxyBlock facebook.com plus.google.com twitter.com
ProxyRemote * http://second.proxy.com:8080

<Proxy *>
Require local
Require ip 192.168.1.0/255.255.255.0
</Proxy>
5. Configure NoProxy

If you configured a second proxy it is probably a good idea to use a “NoProxy” parameter. “NoProxy” parameter specifies a list of subnets, IP addresses, hosts and/or domains, separated by spaces which are always served directly without forwarding to the “ProxyRemote” address.

ProxyRequests On
ProxyVia On
ProxyTimeout 60

ProxyBlock facebook.com plus.google.com twitter.com
ProxyRemote * http://second.proxy.com:8080
NoProxy .geekpeek.net

<Proxy *>
Require local
Require ip 192.168.1.0/255.255.255.0
</Proxy>
REVERSE APACHE PROXY

1. Install Required Packages

At this stage we must install Apache (httpd) and mod_ssl package on our server. Please note that in CentOS 7 Apache 2.4.X is available (in CentOS 5 and 6 Apache 2.2.X).

[root@cluster1  ~]# yum install httpd mod_ssl
2. Basic Reverse Apache Proxy Configuration

We need to add a reverse proxy configuration file to “/etc/httpd/conf.d” location. We named if “reverse-proxy.conf” and added the following lines to it:

ProxyRequests Off

ProxyPass /test1 http://192.168.1.10:8080/test1
ProxyPassReverse /test1 http://192.168.1.10:8080/test1
“ProxyRequests” parameter does not need to be turned on when configuring reverse proxy so turning it off. Next two lines are passing all requests, hitting the reverse proxy server IP/hostname with /test1 URL to the machine with IP address 192.168.1.10, port 8080 and /test1 URL and the other way around. For the communication to work both ways we need to add both lines “ProxyPass” and “ProxyPassReverse“.

3. Add Additional ProxyPasses

It is easy to add additional proxy passes simply by adding new two lines with “ProxyPass” and “ProxyPassReverse” parameters:

ProxyRequests Off

ProxyPass /test1 http://192.168.1.59:8080/test1
ProxyPassReverse /test1 http://192.168.1.59:8080/test1

ProxyPass /test2 http://192.168.1.60:8080/test2
ProxyPassReverse /test2 http://192.168.1.60:8080/test2
Please note that proxy pass can point to a different server, different hostname or IP address.

4. Configure Timeouts

It is wise to configure some sort of time limit on how long to wait if there is no response from backend. We can do this by appending a “connectiontimeout” and “timeout” value at the end of “ProxyPass” line. The “connectiontimeout” is the time it takes to create the connection to the backend and “timeout” is the time proxy waits for response from backend.

ProxyRequests Off
ProxyPass /test1 http://192.168.1.59:8080/test1 connectiontimeout=5 timeout=30
ProxyPassReverse /test1  http://192.168.1.59:8080/test1

ProxyPass /test2 http://192.168.1.60:8080/test2 connectiontimeout=5 timeout=30
ProxyPassReverse /test2 http://192.168.1.60:8080/test2
5. Rewrite HTML Links

Using reverse proxy and accessing internal networks and applications via it, cause specific HTML links (internal links with absolute paths) to fail – not work, since they are redirecting to internal addresses. This is why we need to call for help another Apache module called “mod_proxy_html” which enables rewriting of HTML links and making them work.

“mod_proxy_html” does not come by default with httpd installation in CentOS 7so we need to install it first and then copy the configuration file to the right location. The example HTML links configuration file is quite sufficient for ordinary situations and is located at “/usr/share/doc/httpd-X.X.X/” where X.X.X is your apache version number.

What we have to do is:

[root@cluster1  ~]# yum install mod_proxy_html
..and then

[root@cluster1  ~]# cp /usr/share/doc/httpd-2.4.6/proxy-html.conf /etc/httpd/conf.d/

Increase Root Partition Size – LVM – CentOS 7 , Fedora, RHEL 7

Increase Root Partition Size – LVM – CentOS
Linux root partition is different from all other partitions on your system since it holds all of the system files required for your system to run and operate.

This is the reason why you can not increase root partition size as simply as any other partition – you can not just un-mount it because the system will not let you since it is using it.

To increase root partition size, we have to boot off a bootable live CD/DVD or USB image and increase root partition size from there and this requires SYSTEM DOWNTIME! It is not possible to increase root partition size without system downtime!

For this how to i have set up a virtual linux system and filled up it’s root partition, as you can see in the picture below. I will use CentOS ISO to boot a live system which will enable me to increase root partition size.

Let’s learn how to Increase Root Partition Size!

1. Prepare Your CentOS 7 Live CD/DVD or USB Image

Make sure you have a live CD/DVD or USB image to boot off from. In this how to i will use CentOS 7 DVD ISO image, but in the end you can do the same with Fedora, Ubuntu or any other live CD/DVD ISO image.

2. Identify Your Root Partition

Make sure you will be able to identify the root partition when in live system. Since we are increasing a LVM root partition this should be a no brainer else, the easiest way would be remembering it’s size. If you have many partitions the same size you could check the start and end blocks.

Using LVM i identified my root partition as /dev/mapper/centos-root LVM partition (centos/root) which means it is in a VG (Volume Group) called “centos” and a LV (Logical Volume) called “root”. Read more about managing LVM’s HERE.

After this, the CentOS 7 menu should appear.

Choose “Troubleshooting”

When your CentOS 7 ISO boots choose “Troubleshooting” option from the first menu.

 

Add Additional Disk

Add additional disk to your system so we can increase root partition size or make sure you have free space available on your existing disk configuration. Since i am using virtual system i added an additional 20GB disk to it which is recognized as /dev/sdb in my system

 

 

Choose “Troubleshooting”

When your CentOS 7 ISO boots choose “Troubleshooting” option from the first menu.

rootfile 001 rootfile 002

 

Choose “Rescue a CentOS system”

In the second menu choose “Rescue a CentOS System”.

 

rootfile 003

 

Skip Mounting Existing Linux Installations

When asked to find and mount any existing linux installations choose “Skip”. Since we are increasing our root partition, this partition must not be mounted.

 

rootfile 004 rootfile 005

 

 

When hiting “Enter” you will drop to bash shell.

 Prepare New Disk

Since i added a completely new 2GB disk to my virtual system i must prepare this disk for use with LVM. Read more about managing LVM’s HERE. If you are extending your root partition with existing empty partition the process is similar just use the partition identifier (sdaX or sdbX) when running commands.

Checking current disk configuration with “fdisk -l”.

rootfile 006 rootfile 007 rootfile 008

 

e must prepare new additional disk by creating a new PV (Physical Volume) and extend our VG (Volume Group) as shown in the picture below – identified in Step 2 and with fdisk, VG to extend is called “centos”. rootfile 009

rootfile 010

rootfile 011

 Increase Root Partition Size

To wrap things up we need to extend root LV with “lvextend” command. In my case i am extending it by 511 PE (as much as there are free) and i am also using the parameter “-r” at the end of my command which automatically resizes the filesystem too!

The command sytnax i used is “# lvextend -l +100%FREE centos/root -r”. DO NOT FORGET the “+” sign before PE number! If you do, you might loose data!

 

 

rootfile 014

 

Reboot the System

It is time to remove live image from CD/DVD or USB and reboot to boot our existing system. After that we can check the root partition free disk space

rootfile 015

Solaris command: prstat

Total Physical Memory

  1. >prtdiag -v | grep Memory
  2. Memory size: 8192 Megabytes
  3. >prtconf | grep Memory
  4. Memory size: 8192 Megabytes

Total Physical Memory

  1. >vmstat 5 10
  2. r b w swap free re mf pi po fr de sr vc vc vc vc in sy cs us sy id
  3. 0 0 0 14841224 772880 23 147 19 6 6 0 1 1 0 2 2 3775 2990 3820 2 2 96
  4. 1 0 0 20482808 4992304 3 3 0 0 0 0 0 1 0 0 0 527 474 482 13 0 87
  5. 0 0 0 20483192 5000272 1 5 0 3 3 0 0 0 0 0 1 583 645 606 13 1 86
  6. 0 0 0 20485848 5033400 0 0 0 0 0 0 0 0 0 0 0 528 463 492 13 1 86
  7. 0 0 0 20485848 5033344 0 0 0 0 0 0 0 0 0 0 1 514 469 475 13 0 87
  8. 0 0 0 20485848 5033288 0 0 0 0 0 0 0 0 0 0 2 513 450 476 13 0 87
  9. 0 0 0 20485848 5033288 0 0 0 0 0 0 0 1 0 0 0 516 468 476 13 0 87
  10. 0 0 0 20485848 5033240 0 0 0 0 0 0 0 0 0 0 0 510 451 467 13 0 87
  11. 0 0 0 20485848 5033184 0 0 0 0 0 0 0 0 0 0 0 518 468 475 13 0 87
  12. 0 0 0 20485848 5033128 0 0 0 0 0 0 0 0 0 0 0 523 456 474 13 1 86

Find Overall CPU Usages

* Use multiple processor stat tool ‘mpstat’
* Columns to note
– ‘usr’: percent user time
– ‘sys’: percent system time
– ‘idl’: percent idle time
* Example

  1. # Generate 2 processor reports with 5 second interval
  2. mpstat 5 2
  3. CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
  4. 0 14 0 42 35 18 48 0 1 8 0 139 1 0 0 99
  5. 1 7 0 27 87 55 65 0 1 8 0 92 0 1 0 99

Find CPU Usage by Processes

* Use process stat tool ‘prstat’
* Similar to Linux ‘top’ command
* Examples

  1. # Sort by cpu usage (default)
  2. prstat
  3. # Sort by memory usage
  4. prstat -s rss
  5. # Sort by virtual memory usage
  6. prstat -s size
  7. # Sort by process execution time
  8. prstat -s time
  9. # Find top 5 processes
  10. prstat -n 5
  11. # Also print process numbers each user is using
  12. prstat -a
  13. # Follow a particular process id
  14. prstat -p pid
  15. # Follow threads of a particular process id
  16. prstat -L -p pid

Find Paging Activities

* Use system activity report tool ‘sar’
* Examples

  1. # Find top 3 paging activities with 5 second interval
  2. sar -g 5 3
  3. 18:57:12 pgout/s ppgout/s pgfree/s pgscan/s %ufs_ipf
  4. 18:57:17 0.00 0.00 0.00 0.00 0.00
  5. 18:57:22 0.00 0.00 0.00 0.00 0.00
  6. 18:57:27 0.00 0.00 0.00 0.00 0.00
  7. Average 0.00 0.00 0.00 0.00 0.00
  8. # Total memory
  9. /usr/sbin/prtconf | grep Memory | awk -F”:” ‘{print $2}’
  10. Memory size: 8192 Megabytes
  11. # Find free memory and swap space based on 3 reads with 5 second read intervals
  12. sar -r 5 3
  13. 18:56:24 freemem freeswap
  14. 18:56:29 175049 28289968
  15. 18:56:34 175031 28289843
  16. 18:56:39 175026 28289952
  17. Average 175036 28289921

Process Memory Usage

  1. >ps -A -o pmem -o pcpu -o args
  2. >ps -e -o “rss(k) vsz(k) pmem pid comm” | qrep -v COMMAND | sort -rn | awk ‘{print $1 “\t” $2 “\t” $3 “\t” $4 “\t” $5;}’

Sample Sessions

* Follow a particular process id in 5 second intervals and send result to server.out file

  1. bash-3.00$ prstat -L -p 16401 5 > server.out &
  2. [1] 16530
  3. bash-3.00$ tail -f server.out
  4. PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
  5. 16401 oracle 5270M 4125M sleep 59 0 0:00:00 0.0% oracle/1
  6. Total: 1 processes, 1 lwps, load averages: 0.03, 0.04, 0.04
  7. PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
  8. 16401 oracle 5270M 4125M sleep 59 0 0:00:00 0.0% oracle/1
  9. Total: 1 processes, 1 lwps, load averages: 0.03, 0.04, 0.04
  10. PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
  11. 16401 oracle 5270M 4125M sleep 59 0 0:00:00 0.0% oracle/1
  12. Total: 1 processes, 1 lwps, load averages: 0.03, 0.04, 0.04
  13. PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
  14. 16401 oracle 5270M 4125M sleep 59 0 0:00:00 0.0% oracle/1
  15. Total: 1 processes, 1 lwps, load averages: 0.03, 0.04, 0.04
  16. ^C
  17. bash-3.00$ jobs
  18. [1]+ Running prstat -L -p 16401 5 >server.out &
  19. bash-3.00$ fg %1
  20. prstat -L -p 16401 5 >server.out
  21. ^C
  22. bash-3.00$

WSadmin.sh

Websphere WSadmin.sh Scripting basics

WSADMIN Scripting basiscs: 

Why to Use Scripting?

  • Making configuration changes using the Websphere administrative console is error prone and dangerous in complex production environments
  • Routine tasks can be automated, making repetitive tasks more easily done and done consistently
  • Automated tasks faster to execute.
  • Common Operational and Configurationally tasks can be performed from scripts and command line

 What can be done using WSADMIN?

Few Examples:

  • Start and stop deployment manager, nodes, application servers, enterprise applications and clusters
  • Configure virtual hosts, JDBC providers, JMS resources
  • Create application servers
  • Create clusters and add members to a cluster
  • Deploying Applications
  • Almost all tasks available through administrative Console

Running WSADMIN

WSADMIN tool can be run in 3 different modes

  1. Interactive mode

This is the default mode. In this you’ll enter the command, wait for output and then enter the second command. This is useful for quick administrative tasks

$wsadmin.sh

>wsadmin> your Command

Output

>wsadmin

  1. Inline mode

You can specify this mode by using –C after wsadmin. Here you will run one command at a time. The command will be specified in line with wsadmin.

$wsadmin.sh –C your_command

  1. Using a File Input

A script file can be given as input using –f option along with wsadmin.

$ wsadmin.sh –f your_script_file

How to use WSADMIN

Wsadmin.sh host port

  • Host name is the name of the machine which has websphere running and port number is either SOAP or RMI port number of the websphere JVM to which you want to connect.
  • If the Global security is enabled…you will be asked for user name and password or you can specify it inline using –user and –password.
  • You can specify the language of the script file, the command, or an interactive shell using –Lang. The possible languages include: Jacl and Jython
  • You can run the profile scripts before executing the actual wsadmin commands by using –profile option.
  • To specify the profile from which the wsadmin tool will run, you can use –profileName option.
  • Note: the wsadmin command will be available in bin directory of your DMGR as well as the bin your application server profiles.
  • You can use either SOAP or RMI to connect to the wsadmin and this can be specifeid using –conntype option.

WSADMIN Syntax and all options

wsadmin [-c ] [-p ] [-profile ] [-profileName ] [-f ] [-javaoption java_option] [-lang language] [-wsadmin_classpath classpath] [-conntype SOAP [-host host_name] [-port port_number] [-user userid] [-password password] | RMI [-host host_name] [-portport_number] [-user userid] [-password password] | NONE]

Example: wsadmin -lang jython -f test1.py -profile setup.py -conntype SOAP -port mymachinesoapportnumber -hostmymachine -userid userid -password password

WSADMIN has 5 objects

  1. Help – The Help object provides general help and dynamic online information about the currently running MBeans. You can use the Help object as an aid in writing and running scripts with the AdminControl object.
  2. AdminConfig – Use the AdminConfig object to invoke configuration commands and to create or change elements of the WebSphere Application Server configuration
  3. AdminControl – Use the AdminControl object to invoke operational commands that deal with running objects in the WebSphere Application Server.
  4. AdminApp – Use the AdminApp object to install, modify, and administer applications.
  5. AdminTask – Use the AdminTask object to run an administrative command.

Using WSADMIN:

Deploying Applications

You can install the application in batch mode, using the install command, or you can install the application in interactive mode using the install interactive command. Interactive mode prompts you through a series of tasks to provide information. All the options available to use are listed here in the IBM documentation.

Note: words in bold are command or options and in italic are your inputs

To find out the options available to install the EAR file, run:

AdminApp.options()

Installing EAR application:

Using Batch Mode:

If you are deploying on single servers….make sure that server is running before you execute the commands.

AdminApp.install(‘/home/joseph/applications/SampleApp.ear’, ‘[-server test_server1]‘)

If you are deploying it in network deployment/ Clusters, you must connect to WSADMIN of deployment manager.

AdminApp.install(‘/home/joseph/applications/SampleApp.ear’, ‘[-cluster sample_cluster]‘)

Using Interactive Mode:

AdminApp.installInteractive(‘/home/joseph/applications/SampleApp.ear’)

now it will take you through a series of questions before finishing the deployment.

After the deployment is done, you need to perform two more steps

step1. Save the changes by issuing

AdminConfig.save()

step2. Synchronize the changes across all nodes by using

Sync1 = AdminControl.completeObjectName(‘type=NodeSync,node=myNodeName,*’)

and then

AdminControl.invoke(Sync1, ‘sync’)

step2 is required only for network deployment models.

Starting Applications

This involves two steps.
step1: getting the handler of the application, means .. locating where the application is running. To do this we use a variable and use query names option on admincontrol object

appHandle= AdminControl.queryNamescell=SampleCell, node=virt_node1,type=ApplicationManager,process=test_server1,*’)
print appHandle

then you will get an output like the one below

WebSphere:cell=SampleCell,name=ApplicationManager,mbeanIdentifier=ApplicationManager,type=ApplicationManager,node=virt_node1,process=test_server1

step2: Now we execute the command to start the application

AdminControl.invoke(appHandle, ‘startApplication’‘Dynamic Cache Monitor’)

You can do both steps at once by using the below format

AdminControl.invoke(‘WebSphere:name=ApplicationManager,process=test_server1,node=virt_node1,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=SampleCell, ‘startApplication‘, ‘[“Dynamic Cache Monitor“]‘, ‘[java.lang.String]‘)

Stopping Application

The steps are same as starting the application except ‘startApplication’ should be renamed to ‘stopApplication’

But, if you want to stop all applications running on a server… after executing step1 of above
Step2: you need to first get the list of applications

# get line separator
import  java.lang.System  as sys
lineSeparator = sys.getProperty(‘line.separator’)
apps_list =AdminControl.queryNames(‘cell=SampleCell,node=virt_node1,type=Application,process=test_server1,*’).split(lineSeparator)
print apps_list

Step3: now we need to create a loop to stop the applications one by one

for app in apps_list:
appName = AdminControl.getAttribute(app‘name’)
AdminControl.invoke(appHandle, ‘stopApplication’appName)

Updating Application

We have different options to update applications, like, full update, module update, single file update etc…Similar to the install, we do have both batch mode and interactive mode for updating [update and updateinteractive]. All the options available to use are listed here in the IBM documentation.

  • updating entire application

AdminApp.update(‘SampleApp’, ‘app’, ‘[-operation update -contents /home/joseph/applications/SampleAppv2.ear ]‘)

  • Adding a new module to EJB

AdminApp.update(‘SampleApp’, ‘modulefile’, ‘[-operation addupdate -contents /home/joseph/applications/Increment.jar -contenturi Increment.jar -nodeployejb
-BindJndiForEJBNonMessageBinding [[“Increment Enterprise Java Bean” Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]’)

  • Updating Single file

AdminApp.update(‘SampleApp’, ‘file’, ‘[-operation update -contents /home/joseph/applications/my.xml -contenturi SampleApp/my.xml]‘)

TIP: Use the taskInfo command of the AdminApp object to obtain information about the data that is needed for your application.

for example, you want to know what options you need to supply for mapping modules to servers…use the following taskinfo command

AdminApp taskInfo MapModulesToServers

  • Adding an application server

There are 3 steps involved in creating a new application server

first we need to get the node on which we want to create the application server. Obtain the configuration ID of the object and assign it to the node variable

node = AdminConfig.getid(‘/Node:mynode/’)

Then, create the application server using admintask

AdminTask.createApplicationServer(node, [‘-name’, ‘test1’, ‘-templateName’, ‘default’])

where test1 is the name of the server you want to create and mynode is the node on which this server will be created.

Then, save the changes using admintask.save ()

  • create a new cluster

This involves 3 steps

1A. using existing server

1Aa. Choose the server you want to convert into server and assign it to a variable

server = AdminConfig.getid(‘/Cell:mycell/Node:mynode/Server:server1/’)

1Ab. Convert that existing server into cluster

print AdminConfig.convertToCluster(server, ‘myCluster1?)

1B. creating new cluster without members

1Ba. Identify the cell configuration ID and assign it to a variable

C1 = AdminConfig.getid(‘/Cell:mycell/’)

1Bb. Create a new cluster without a cluster member

print AdminConfig.create(‘ServerCluster’, C1, ‘[[name ClusterName]]’)

  1. Adding new members:

2a. get the ncluster configuration ID and assign it to a variable

cluster = AdminConfig.getid(‘/ServerCluster:myCluster1/’)
print cluster

2b. get the ncluster configuration ID and assign it to a variable

node = AdminConfig.getid(‘/Node:mynode/’)
print node

2c. get the ncluster configuration ID and assign it to a variable

serverTemplate = AdminConfig.listTemplates(‘Server’)
print serverTemplate

2d. Create the cluster member

AdminConfig.createClusterMember(cluster, node, [[‘memberName’, ‘clusterMember1’]])

  1. save the changes and synchronize them.
  • start/stop application servers

Starting

print AdminControl.startServer(‘server1?, ‘mynode’)

Output:

WASX7319I: The serverStartupSyncEnabled attribute is set to false.  A start will be attempted for server “server1? but the configuration information for node “mynode” may not be current.
WASX7262I: Start completed for server “server1? on node “mynode”

Stopping

print AdminControl.stopServer(‘serverName’, ‘mynode’)

this command will stop the server named servername on node named mynode. Since we used print, we can see the following output on the console

Output

WASX7337I: Invoked stop for server “serverName” Waiting for stop completion.
WASX7264I: Stop completed for server “serverName” on node “mynode”

Exit codes for stop/starting of the servers

Server state Return code
Server initialization failed -1
Server initialization timed out -2
Server start in progress 1
Server is initializing the applications that are present 2
Server initialization is complete (successful) 0
Server stop failed -10
Server stop timed out -11
Server stop operation started 1000
Server successfully stopped 0
  • Checking the status of the servers

first get the server MBean and assign it to a variable

server = AdminControl.completeObjectName(‘cell=mycell,node=mynode,name=server1,type=Server,*’)

Print server

you can see output similar to the below:

WebSphere:cell=mycell,name=server1,mbeanIdentifier=server.xml#Server_1,type=Server,node=mynode,process=server1,processType=ManagedProcess

The execute the following command

print AdminControl.getAttribute(server, ‘state’)

This will return the state of the server on the command line, something like STARTED/STOPPED etc.

 

Creating a Windows service for the node agent

In a network deployment configuration, you can create the node agent as a Windows service to make WebSphere® Application Server nodes easier to start and manage.

About this task

Create the node agent as a Windows service so that the node agent starts automatically when the server is rebooted. An activated node agent communicates with the cell Deployment Manager to manage the set of servers on the node.
If you do not create the node agent as a service, you must run the startNode command manually. For example: <was_home>/profiles/<profile_name>/startNode.bat.

Procedure

  1. Open a command prompt window.
  2. Change the directory to <was_home>\binFor example: type cd c:\Program Files\IBM\WebSphere\AppServer\bin
  3. Type the following WASService command with the following parameters (case-sensitive, without the line breaks):
    WASService -add <profile_name>_nodeagent -serverName nodeagent -profilePath 
    "<was_home>\profiles\<profile_name>" -wasHome 
    "<was_home>" -logRoot 
    "<was_home>\profiles\<profile_name>\logs\nodeagent" -logFile 
    "<was_home>\profiles\<profile_name>\logs\nodeagent\startServer.log" 
    -restart true
    -startType automatic
    Where
    <was_home>
    Specifies the directory where WebSphere Application Server is installed. For example: C:\Program Files\IBM\WebSphere\AppServer
    <profile_name>
    Specifies the name of the custom node profile in Windows service. For example: Custom01.

    Example (with sample values)

    WASService -add Custom01_nodeagent -serverName nodeagent -profilePath "c:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01" -wasHome"c:\Program Files\IBM\WebSphere\AppServer" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01\logs\nodeagent" -logFile"C:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01\logs\nodeagent\startServer.log" -restart true -startType automatic
  4. Press Enter. For example: The last line of the screen is displayed.
    IBM WebSphere Application Server V7.0 - Custom01_nodeagent service successfully 
    added.
  5. Close the command prompt.
  6. Verify that the service is added to Windows services.
    1. Click Start > Run. Type services.msc.
    2. Verify that the node agent service is displayed. For example:IBM WebSphere Application Server v7.0 – Custom01_nodeagent.
  7. Optional: If you have additional nodes, repeat this task for other nodes in your cluster. For example: Custom02.

Results

You added the node agent service to the list of Windows services.

Websphere – Windows service for Nodeagent, AppSrv creating example

Websphere – Windows service for Nodeagent, AppSrv creating example

Creating Service for Application Server (JVM):

WASService.exe -add ServiceNameAppSrv01 -serverName server1 -profilePath c:\IBM\WebSphere\AppServer\profiles\AppSrv01

Creating Service for Nodeagent:

WASService.exe -add ServiceNameNodeAgent01 -serverName nodeagent -profilePath c:\IBM\WebSphere\AppServer\profiles\CustomNode01 

Deleting service:

WASService.exe -remove SrvNameAppSrv01

or

WASService.exe -remove ServiceNameNodeAgent01

Delete Websphere Application Server Profile

First list all profiles on a server:
List the profile using one of these commands
  • Windows: was_install_dir\bin\manageprofiles.bat –listProfiles
  • UNIX/Linux: was_install_dir/bin/manageprofiles.sh –listProfiles
Remove a WebSphere Application Server profile:
Delete the profile using one of these commands:
  • On Windows: was_install_dir\bin\manageprofiles.bat –delete –profileName profile
  • On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –delete –profileName profile
Ensure that references to the deleted profile are removed from the profile registry by running the following command:
 
  • On Windows: was_install_dir\bin\manageprofiles.bat –validateAndUpdateRegistry
  • On UNIX/Linux: was_install_dir/bin/manageprofiles.sh –validateAndUpdateRegistry
Delete the profile directory tree (if it was not deleted by the previous action).
Delete the profile Directory using one of these commands:
  • On Windows: was_install_dir\profiles\rmdir /s profileDirectory
  • On UNIX/Linux: was_install_dir\profiles\rm -R profileDirectory

How to Delete a Windows Service

Deleting a Service

The first thing you’ll need to do is identify the name of the service, so open up Services through the start menu or control panel, and then find the service in the list that you want to delete.window

 

You’ll want to open up the properties by double-clicking on the service name, and then highlight the “Service name” value and copy it to the clipboard. This is what we’ll need to disable it.

 

window1

You’ll need to open up a command prompt, you’ll need to right-click the command prompt and choose Run as Administrator. We’ll use the sc command to actually do the work.
The syntax used to delete a service is this:
sc delete ServiceName
If your service name has spaces in it, you’ll need to wrap the service name in quotes, like this:
sc delete “Adobe LM Service”

Introduction Coherence

[gview file=”http://rmohan.com/wp-content/uploads/2015/05/080310_AnEngineers_Introduction_to_Oracle_Coherence.ppt”]