Creating A Second Instance of the IPS Repository Server With SMF

Sometimes,you  want to configure multiple IPS repository running in one server.Such as solaris repository and solaris cluster repository or update repository coexist in one server.To do that you must use Solaris SMF to Manage the pkg.depotd processes as services.For more information from here.I'm going to show you how to add a ha-cluster instance to the pkg/server service.

1.Create a filesystem or directory to save the repository data

  
  
  
  
  1. [root@pkg:~]#mkdir /u01/osc4 

2.Using pkgrepo command to create the ha-cluster skeleton repository

  
  
  
  
  1. [root@pkg:~]# pkgrepo create /u01/osc4  
  2. [root@pkg:~]# pkgrepo set -s /u01/osc4 publisher/prefix=ha-cluster 
  3. [root@pkg:u01]# more /u01/osc4/pkg5.repository  
  4. [publisher] 
  5. prefix = ha-cluster 
  6. [CONFIGURATION] 
  7. version = 4 
  8. [repository] 
  9. version = 4 

3.Add a new instance of the pkg/server service

  
  
  
  
  1. [root@pkg:~]# svccfg -s pkg/server add osc4  //osc4 is my new instance name
  2. [root@pkg:~]# svccfg -s pkg/server:osc4 addpg pkg application 
  3. [root@pkg:~]# svccfg -s pkg/server:osc4 addpg general framework 
  4. [root@pkg:~]# svccfg -s pkg/server:osc4 setprop general/complete=astring:\"\" 
  5. [root@pkg:~]# svccfg -s pkg/server:osc4 setprop general/enabled=boolean: true 

4.Set the value of the port and path to repository data

  
  
  
  
  1. [root@pkg:~]# svccfg -s pkg/server:osc4 setprop pkg/port=1001 
  2. [root@pkg:~]# svccfg -s pkg/server:osc4 setprop pkg/inst_root=/u01/osc4 

5.Refresh and start the repository service instance

  
  
  
  
  1. [root@pkg:~]# svcadm refresh pkg/server:osc4 
  2. [root@pkg:~]# svcadm enable pkg/server:osc4 

6.Verify that the new instance runs ok

  
  
  
  
  1. [root@pkg:~]# svcs -l pkg/server:osc4 
  2. fmri         svc:/application/pkg/server:osc4 
  3. name         image packaging repository 
  4. enabled      true 
  5. state        online 
  6. next_state   none 
  7. state_time   May 22, 2012 05:13:25 PM CST 
  8. logfile      /var/svc/log/application-pkg-server:osc4.log 
  9. restarter    svc:/system/svc/restarter:default 
  10. contract_id  124  
  11. manifest     /lib/svc/manifest/application/pkg/pkg-server.xml 
  12. dependency   require_all/none svc:/system/filesystem/local (online) 
  13. dependency   optional_all/none svc:/system/filesystem/autofs (online) 
  14. dependency   optional_all/none svc:/network/ntp (disabled) 
  15. dependency   require_all/none svc:/milestone/network (online) 
  16. [root@pkg:~]#  

  
  
  
  
  1. [root@pkg:~]# svcs pkg/server 
  2. STATE          STIME    FMRI 
  3. online         16:53:44 svc:/application/pkg/server:default 
  4. online         17:13:25 svc:/application/pkg/server:osc4 
  5. [root@pkg:~]#  

本文出自 “candon123” 博客,谢绝转载!

你可能感兴趣的:(Solaris)