Persistent static
Does anybody have a recommendation on good way to get the effect of a
persistent static object (ie. one persistent instance for all objects of a
persistent class)?
Scott
If you mean one shared PC instance, you can have a facade to store the
oid of that single object for use by each specific instance:
public class Foo
private static Object oid = null;
// ... persistent attributes here ...//
public static Foo getSharedInstance (PersistenceManager pm)
if (oid == null)
Extent e = pm.getExtent (Foo.class, false);
oid = JDOHelper.getObjectId
(e.iterator ().next ());
return pm.getObjectById (false);
Of course this is untested, but you get the idea. Then in when you deal
with Bar instances sharing that Foo, you can simply do something along
the lines of
Bar bar = new Bar ();
bar.setFoo (Foo.getSharedInstance (pm));
Scott Leschke wrote:
Does anybody have a recommendation on good way to get the effect of a
persistent static object (ie. one persistent instance for all objects of a
persistent class)?
Scott
Stephen Kim
[email protected]
SolarMetric, Inc.
http://www.solarmetric.com
Similar Messages
-
How to persistent static object
JDO always assigns a StateManager to a PersistenceCapable object when
creating instance. If an object is static, it'll keep its StateManager for
ever after instantiation. So If I excute the following code repeadly, kodo
will complain that persistence manager has been closed.
1) Get PersistenceManager
2) Begin transaction
3) Get object from datastore. If not exist, create a new object. This
object is a static.
4) Commit transaction
5) pm.close
For the first time, kodo will assign a new StateManager to this static
object. But for the second time, exception, "persistence manager has been
closed", will arise when excuting some of object's methods. Because each
StateManager object owns a PersistenceManager object. If this pm is
closed, according StateManager object is also useless.
After enhancing, kodo will change some getter/setter methods to
according jdo getter/setter ones. These methods may invoke
startManager.isLoaded(), which invokes pm.isActive(). Unfortunately, pm
has been closed.
Any other tricky methods to persistent static object ?
Thanks !Dear Marc,
Thanks for your kind help. It's an effective advice to prevent
persistent object from being static.
However, what if the object to be persistent is an enumeration type
constant ? For example :
public class MyEnumType
private String name = null;
private int value = 0;
protected MyEnumType( String name, int value )
this.name = name;
this.value = value;
public static final TYPE_1 = new MyEnumType( "type 1", 1 );
public class EnumTypeUseClass
private MyEnumType type = null;
public void setType(..) {..}
public MyEnumType getType() {..}
public class TestClass
public void f()
PersistenceManager pm = null;
try
// Obtain pm
pm = ...;
pm.currentTransaction().begin();
EnumTypeUseClass use = new EnumTypeUseClass();
// Obtain myenumtype object from datastore
MyEnumType type = getJdoObject( pm, MyEnumType.class, "value ==" +
MyEnumType.TYPE_1.getValue() );
// Following line will cause "PersistenceManager has been closed"
exception
use.setType( type );
pm.makePersistent( use );
pm.currentTransaction().commit();
catch( .. )
finally
pm.close();
public static void main( String args[] )
for( int i = 0; i < 10; i ++ )
f();
Actually, exception is caused by MyEnumType.TYPE_1.getValue() because
this object's pm has been closed in the first loop time.
Now I solved this problem by not persistent MyEnumType objects, and
change type field in EnumTypeUseClass from MyEnumType to int.
But I still wonder how to persistent static objects.
Maybe your first advice is feasible, but I think it will make your
program tangly. Do you think so ? :)
Marc Prud'hommeaux wrote:
Liang-
You are correct that a persistent instance must be associated with a
PersistenceManager. You could always just leave the PersistenceManager
open (if using optimistic transaction, Kodo won't tie up database
resources in this case). Another option is to not have the singleston
instance be a static variable, but have it be obtained via a factory
method that takes a PersistenceManager argument.
If this doesn't help, perhaps you could help clarify the situation by
posting some code that shows that you would like to do?
In article <[email protected]>, Liang Zhilong wrote:
JDO always assigns a StateManager to a PersistenceCapable object when
creating instance. If an object is static, it'll keep its StateManager for
ever after instantiation. So If I excute the following code repeadly, kodo
will complain that persistence manager has been closed.
1) Get PersistenceManager
2) Begin transaction
3) Get object from datastore. If not exist, create a new object. This
object is a static.
4) Commit transaction
5) pm.close
For the first time, kodo will assign a new StateManager to this static
object. But for the second time, exception, "persistence manager has been
closed", will arise when excuting some of object's methods. Because each
StateManager object owns a PersistenceManager object. If this pm is
closed, according StateManager object is also useless.
After enhancing, kodo will change some getter/setter methods to
according jdo getter/setter ones. These methods may invoke
startManager.isLoaded(), which invokes pm.isActive(). Unfortunately, pm
has been closed.
Any other tricky methods to persistent static object ?
Thanks !
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
I have three Macs that need to have persistent static routes set up. I installed RouteSplit for this purpose and it seems to work well. After reboot, I can ping a host machine on the static route. But if I try to mount an SMB share over that route, it fails and I find that I can't even ping the host address anymore. If I reboot, I am back to having connectivity again, but attempting to mount the SMB share breaks it again. Is there something in the SMB.conf file that is breaking my static route?
By the way, even after it has been broken, I can do a netstat -rn and it shows the static route in the routing table. I am lost.
Bob ReedI can ping a host machine on the static route
By name, or by address?
But if I try to mount an SMB share over that route, it fails and I find that I can't even ping the host address anymore
By name, or by address?
You don't state how you're testing your ping, either before or after the attempt to mount the server.
There is a 100% disconnect between SMB and your routing table - it shouldn't be possible for SMB to affect that, nor should SMB care how to get to the specified host. Therefore I'm thinking the problem lies somewhere in between, possibly in the name resolution part of the process, hence my questions. -
Persistent static routes on OS Yosemite
Hi there ,
I have 2 Macs ( MacBook Pro 15 inch, Retina - Yosemite OS ) in a big network
These MACs have installed Outlook. Our Exchange Server is completely in another network as the MACs .
Now I have added a route yesterday.
sudo route add -n xx.xx.xx.xx / 16 gw xx.xx.xx.xx
After a restart , these routes are unfortunately gone and the Outlook can not connect to the server again .
I have found that the MAC can not save static routes via terminal. Just as in Windows via route add -p
Unfortunately, I am not a professional in this area , but then i tried it this way:
sudo vi /etc/rc.local
route add -net 192.168.192.6 netmask 255.255.255.0 gw 10.1.106.209
then with esc out and then with : w! stored
After a restart , these routes are unfortunately gone (according to the route table )
Have you any tips?
P.S sorry for my bad english
vesbarFor example, here's a launch daemon plist file = "com.your_username.routes.plist"
which is placed in /Library/LaunchDaemons so that launchd runs it once at boot.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.your_username.routes</string>
<key>ProgramArguments</key>
<array>
<string>/Users/your_username/Documents/add_routes</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
You can place the shell script file in your Documents folder with name = "add_routes".
This shell script contains the commands to actually add the routes.
Each time your machine is booted, launchd will execute the plist file. -
Persistant routes sometimes not working
This is the situation
We have a MSSQL cluster of 2 servers the SQL03A and SQL03B windows 2008 R2 enterprise on vmware 5.5
There are 2 persistant routes, they are for the backup:
10.64.67.171 255.255.255.255 10.37.4.30
10.64.67.169 255.255.255.255 10.37.4.29
Sometimes , one?s a month, the persistant route does not work and the backup wil not work.
We delete the persistant route and we make the persistant route again, than it wil work again.
What could be the problem?You need to use root print to list the available routes. When the problem gets reproduced again, please run it to see what are the available routes.
Also, you can double check that you are creating the routes properly. Here is an article about how to create persistent routes: http://www.itsyourip.com/networking/howto-add-persistent-static-routes-in-windows/comment-page-1/
This posting is provided AS IS with no warranties or guarantees , and confers no rights.
Ahmed MALEK
My Website Link
My Linkedin Profile
My MVP Profile -
What is the Right Form of OSX 10.8 's Static Route Grammars
I am not good at mac os code. so i have some questions about route grammar.
eg:
I need add a static route for a IP,
just like:sudo route -nv add -net 10.0.0.0 192.168.42.254
i input it in termina,then it worked. But when i restart mac. the route did not exist.
so where is not right form about the "sudo route -nv add -net 10.0.0.0 192.168.42.254"?
who can tell me more about How to add STATIC ROUTE in mac os? waiting on line.guys help me.Defining a persistent static route on Mac OS X - Server Fault
Adding static routes to a network - Mac OS X Hints
RouteSplit
Setting a static route every boot with launchd - Ask Different -
Exchange 2013 Migration in a complicated network environment
Hello everyone,
I am conducting an Exchange migration from 2007 to 2013. The client have 4 geographical site and each of those site have an Exchange CAS server on it. The sites
have also DCs on each of them.
There's two types of connection between sites one is MPLS that's 50MBPs and the other is p2p that's 2mbps. Client wants to have only 2 Exchange 2013 Server with
all the roles collocated on them and DAG between them.
I already have installed and configured DAG on the servers. One server is located in the Central data center and the other is located on a second geographical
site that also have a disaster recovery data center.
Client wants to configure the MAPI network on Exchange 2013 to use the P2P 2mbps connection and use the MPLS 50mbps connection for the replication NIC.
The problem is that both networks MPLS and P2P have the same IP subnet, same gateway e.g. (10.1.1.0/16) but a range of those IPs are configured on the router to
use the MPLS connectivity.
I have tried to add static route to the replication network to use the gateway but when trying to add a copy of a centralized database to the DAG. the DAG copies
the connection over the P2P line.
Is it possible to configure this with the same subnet or do I need to have the mpls connection on a totally different network and subnet?
I would appreciate all your suggestions and I am very sorry for my terrible explanation because I am my self confused about their network topology.
I will prepare a visio diagram of the network, IPs and everything to clear everything out.
Mohammed JHI have solved the issue, it was very simple but due to lack of knowledge about networking it got complicated. the way I have configured the replication networks between both sites was that each replication NIC on each site should have a different subnet
that configured on the MPLS network with the high speed and bandwidth. they must be different on each site.
For each replication NIC a persistent static route should be configured on Exchange server to tell the NIC where to direct traffic exactly.
After configuring the subnets on the replication NIC, I added the static routes and the replication started to work flawlessly.
This is the static route command that I run on the first machine on the first site, it tells the Replication NIC to direct traffic to the subnet network on the second site through the gateway 10.1.1.1
route -p add 10.5.1.0 MASK 255.255.0.0 10.1.1.1
On Exchange on the second site, I had to run the same command as well
route -p add 10.1.1.0 MASK 255.255.0.0 10.5.1.1
thanks everyone for the help.
Mohammed JH -
How to model parent child relationship with DPL? @Transient?
Hello All,
I want to model a parent entity object with a collection of child entities:
@Entity
public class Parent{
@PrimaryKey
String uuid;
List<Child> children;
@Entity
public class Child{
@PrimaryKey
String id;
I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
Thanks in advance,
Steven
Harvard Children's Hospital Informatics Program
Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PMHi Steven,
The definition of persistence is here:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
I suggest looking at this javadoc:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
--mark -
Composite key field is not a simple type or enum
According to the docs here - http://www.oracle.com/technology/documentation/berkeley-db/je/java/index.html?com/sleepycat/persist/model/PrimaryKey.html - you can use "A composite key class containing one or more simple type or enum fields" as a key field. When we try that we get "java.lang.IllegalArgumentException: Composite key field is not a simple type or enum: Result$Key.recordId". Am I misreading the docs?
Thanks,
Trevor
@Persistent
public final class RecordKey {
@KeyField(1)
private final String name;
@KeyField(2)
private final int duplicateNumber;
RecordKey(final String name, final int duplicateNumber) {
this.name = name;
this.duplicateNumber = duplicateNumber;
RecordKey() {
this.name = null;
this.duplicateNumber = -1;
@Persistent
static final class Key {
@KeyField(1)
private final RecordKey recordId;
@KeyField(2)
private final String key;
Key(final RecordKey recordId, final String key) {
this.recordId = recordId;
this.key = key;
Key() {
this.recordId = null;
this.key = null;
}Hi Trevor,
You're nesting one key class inside another. All fields of a key class must be simple types or enums, which is what the exception message is trying to say. If you want all those fields in your key class, you'll have to include them in a single flattened class.
Neither nesting of key classes nor inheritance of key classes is supported. We have enhancements filed to support these in the future, but no concrete plans.
--mark -
Managing Lync Online user traffic
Hi,
Trying to understand what is the best way to route the Lync online user traffic from corporate LAN to Lync online server and to users connected on Internet.
I see that suggested methods are route it via firewall or proxy
Challenges I see with firewall method are: Routing issue from certain subnets and risk of opening up so many ports for so many subnets.
In Proxy method I foresee performance issue.
Is there any other better method to achieve this?
Can we do something better using dedicated F5 big IP for Lync traffic alone? Is this supported?
Also is it mandatory to open up 50-60K port to have p2p call? Can’t it happen via Lync online edge server?
Please share your thoughts.
We use Lync 2013 on prim with 3 Lync pool in three different sites with total user base of 30k. Each site has dedicated internet connectivity.
Regards
Praveen RAccording to your description, I suppose when you mentioned Lync online user you meant the Lync on premises users other than Office 365 account.
The 50k port ranges are required between internet and Lync A/V service.
You need to create persistent static routes on the internal interface to all internal networks.
The Lync Server 2013 scaled consolidated Edge topology is optimized for DNS load balancing for new deployments federating primarily with other organizations using Lync Server. If high availability is required for any of the following scenarios, a hardware
load balancer must be used on Edge Server pools for the following:
Federation with organizations using Office Communications Server 2007 R2 or Office Communications Server 2007
Exchange UM for remote users using Exchange UM prior to Exchange 2010 with SP1
Connectivity to public IM users
For details, check
http://technet.microsoft.com/en-us/library/jj656815.aspx
You need to open 50k port ranges to have peer-to-peer call.
Lisa Zheng
TechNet Community Support -
The client connection is not allowed on the internal edge of the Access Edge Server
We are trying to setup Lync 2013 Edge Server, we have a setup as described below
Real IPs for Lync Edge/WebConf/AV
NAT of real IPs through Firewall Juniper to FE IP
Topology with NAT (Firewall IP) IP enabled
Certificates for with SAN for sip.acme.com etc (Both certs are Client Server Auth Templates from Internal MS CA)(Trusted) on Edge
Route 192.215.0.0 255.255.255.0 gateway (=firewall internal ip address)
But when external user connects and we are tracing the connection we are getting below error and lync client is
not able to connect.
TL_INFO(TF_CONNECTION) [1]0AD8.0C30::09/07/2014-08:11:13.091.0000000f
(SIPStack,SIPAdminLog::WriteConnectionEvent:SIPAdminLog.cpp(454))[4150361027] $$begin_recordSeverity: information
Text: TLS negotiation started
Local-IP: 192.215.0.xxx:5061 (Edge IP)
Peer-IP: 192.215.0.xxx:1835 (Firewall IP)
Connection-ID: 0x1100
Transport: TLS
$$end_record
TL_ERROR(TF_CONNECTION) [0]0AD8.0638::09/07/2014-08:12:45.279.0000005d (SIPStack,SIPAdminLog::WriteConnectionEvent:SIPAdminLog.cpp(389))[4150360514] $$begin_record
Severity: error
Text: The client connection is not allowed on the internal edge of the Access Edge Server
Peer-IP: 192.xxx.0.xxx:1322 (firewall ip)
Transport: TLS
Result-Code: 0xc3e93d6b SIPPROXY_E_CONNECTION_INTERNAL_FROM_CLIENT
$$end_recordHi pshetty,
Check the following blog to deploy your Edge Server:
http://jsilverdrake.blogspot.se/2012/04/publishing-lync-with-forefront-tmg-part_25.html
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
sure that you completely understand the risk before retrieving any suggestions from the above link.
You need to create persistent static routes on the internal interface to all internal networks.
Regards,
Lisa Zheng
Lisa Zheng
TechNet Community Support -
Building index on a map element in DPL
Hi,
If I have an entity which has a map in its data elements:
@Entity
static class Person {
@PrimaryKey
String ssn;
Map<String, String> attributes;
where the map takes key value pairs for the person attributes like { ("name","Jane"), ("age", "25") }. Is there a way to build a secondary index on the name attribute, meaning that the index is on attributes.get("name")?
Thanks,
Walaa.Using the DPL, the only way to do this (that I know of) is to create a many-many secondary index. Each key in the index could be a two part (name, value) key object. For example:
@Entity
static class Person {
@PrimaryKey
String ssn;
@SecondryKey(relate=MANY_TO_MANY)
Set<Atrribute> attributes;
@Persistent
static class Attribute {
@KeyField(1)
String name;
@KeyField(2)
String value;
}You can use the SecondaryIndex<Attribute, String, Person> to query Person by Attribute.
You previously said that you're using the collections API with a TupleSerialBinding, so I'm a little confused. I guess you're exploring multiple APIs?
--mark -
Dear support,
I'm trying to use the DPL layer of the JE edition of BerkelyDB. My
use case is very simple, two classes both annotated with "Entity", one
of which has a secondaryKey with an onRelatedEntityDelete=CASCADE
constraint. The one slight difference from the manual example is that
both these classes have a base class annotated with "Persistent",
which has a Date field that is also annotated as a many-to-many
sencondary key with no constraints.
What I'm seeing is the delete of the primary is not cascading as
intended. As I step through the source I can see the trigger but am
not sure why it isn't fired correctly.
I've tried the latest 3.2.13 release with no luck. I'm sure I can fix
it but I wanted to see if perhaps I'm doing something stupid first. I
need to make progress on this. I chose Sleepycat for a simple
persistence solution, if needed I can do the usual O-R thing with a
relational db but would prefer not to until our app and schema are
more stable.
Thanks,
Bob DionneHere you go Mark, sorry it took so long I got called away. I tried commenting out the static classes in your code and let it use mine and it worked fine. In my code I have a few threads, some are scheduled futures, that open and close the environment. They do this in read and wrote mode. I have two JVMs hitting the same database so I need to do this as only one process can be the writer. In the code below I have a simulation of what I do and it exhibits the failure. I open and close the env each time. Note that just prior to the delete of the report "r1" I only get the primaryIndex for Report not Correlation. If I uncomment the line and get the index for Correlation it works. Should I be doing that? If so could you explain why? Thanks much for your help,
Bob
import java.io.File;
import java.util.Date;
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.persist.EntityStore;
import com.sleepycat.persist.PrimaryIndex;
import com.sleepycat.persist.SecondaryIndex;
import com.sleepycat.persist.StoreConfig;
import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.SecondaryKey;
import static com.sleepycat.persist.model.DeleteAction.CASCADE;
import static com.sleepycat.persist.model.Relationship.MANY_TO_ONE;
public class CascadeTest {
@Persistent
static class PirceObject {
@SecondaryKey(relate=MANY_TO_ONE)
private Date lastUpdated;
public Date getLastUpdated() {return lastUpdated;}
public void setLastUpdated(Date d) {lastUpdated = d;}
public PirceObject() {
@Entity
static class Report extends PirceObject {
public Report(String rid) {
rdfId = rid;
public Report() {super();}
@PrimaryKey
private String rdfId;
public String getRdfId() {return rdfId;}
public void setRdfId(String s) {rdfId = s;}
@Entity
static class Correlation extends PirceObject {
@PrimaryKey
private String rdfId;
public String getRdfId() {return rdfId;}
public void setRdfId(String s) {rdfId = s;}
@SecondaryKey(relate=MANY_TO_ONE, relatedEntity=Report.class,
onRelatedEntityDelete=CASCADE)
private String reportId;
public String getReportId() {return reportId;}
public void setReportId(String s) {reportId = s;}
public Correlation() {super();}
public Correlation(String rid, String rp_id) {
super();
setRdfId(rid);
setReportId(rp_id);
public static void main(String[] args) throws DatabaseException {
if (args.length != 2 || !"-h".equals(args[0])) {
System.err.println("Usage: java " + CascadeTest.class.getName()
+ " -h <envHome>");
System.exit(2);
CascadeTest example = new CascadeTest(new File(args[1]));
example.run();
example.close();
private Environment env;
private File envHome;
private EntityStore store;
private PrimaryIndex<String, Report> reportById;
private PrimaryIndex<String, Correlation> corrById;
private SecondaryIndex<String, String, Correlation> corrByReport;
private void open() throws DatabaseException {
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setReadOnly(false);
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
env = new Environment(envHome, envConfig);
StoreConfig storeConfig = new StoreConfig();
storeConfig.setReadOnly(false);
storeConfig.setAllowCreate(true);
storeConfig.setTransactional(true);
store = new EntityStore(env, "foo", storeConfig);
private CascadeTest(File envHome) throws DatabaseException {
this.envHome = envHome;
private void run() throws DatabaseException {
open();
close();
open();
reportById = store.getPrimaryIndex(String.class, Report.class);
Report r1 = new Report("r1");
r1.setLastUpdated(new Date());
reportById.put(r1);
close();
open();
corrById = store.getPrimaryIndex(String.class, Correlation.class);
Correlation c1 = new Correlation("c1", "r1");
c1.setLastUpdated(new Date());
corrById.put(c1);
close();
open();
corrById = store.getPrimaryIndex(String.class, Correlation.class);
Correlation c2 = new Correlation("c2", "r1");
c2.setLastUpdated(new Date());
corrById.put(c2);
close();
open();
reportById = store.getPrimaryIndex(String.class, Report.class);
corrById = store.getPrimaryIndex(String.class, Correlation.class);
System.out.println("Before delete");
System.out.println("nReports=" + reportById.count());
System.out.println("nCorrelations=" + corrById.count());
close();
open();
reportById = store.getPrimaryIndex(String.class, Report.class);
// Mark see here --> corrById = store.getPrimaryIndex(String.class, Correlation.class);
reportById.delete("r1");
close();
open();
reportById = store.getPrimaryIndex(String.class, Report.class);
corrById = store.getPrimaryIndex(String.class, Correlation.class);
System.out.println("\nAfter delete");
System.out.println("nReports=" + reportById.count());
System.out.println("nCorrelations=" + corrById.count());
private void close() throws DatabaseException {
store.close();
env.close();
} -
How to save routing entries permanently after route add
Hi guys,
I have added routing entries through route add command. I know i can add routing entries permanently thru -p option in route add command but didin't use that option. How to save those routing entries now?
Thanks...The filename you are looking for is /etc/inet/static_routes which is available only on Solaris 10 update 3 or later:
root_sol10u3# route -p add -net 192.168.138.0/24 192.168.136.1
root_sol10u3# cat /etc/inet/static_routes
# File generated by route(1M) - do not edit.
-net 192.168.128.0/22 192.168.136.1
-net 192.168.138.0/24 192.168.136.1
-net 172.31.68.0/24 192.168.149.253
-net 172.31.69.0/24 192.168.149.253
root_sol10u3#For Solaris 10 update 2 or earlier, persistent static routes are not implemented. Additionally, the old RC script method suggested above also will not work for Solaris 10 given the host isn't always guaranteed to reach the "multiuser" milestone and subsequently run the legacy /etc/rc*/S* scripts (say if a filesystem fails to mount). For those releases, you should create a new manifest file as follows:
root_sol10u2# cat /var/svc/manifest/network/RKstatic-routes.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Static Route SMF Manefest
To be replaced by official Sun mechanism in next solaris release
-->
<service_bundle type='manifest' name='RKstatic-routes'>
<service
name='network/RKstatic-routes'
type='service'
version='1'>
<create_default_instance enabled='true' />
<single_instance/>
<dependency name='network'
grouping='require_any'
restart_on='error'
type='service'>
<service_fmri value='svc:/network/service' />
</dependency>
<exec_method
type='method'
name='start'
exec='/lib/svc/method/RKstatic-routes start'
timeout_seconds='60' />
<exec_method
type='method'
name='stop'
exec='/lib/svc/method/RKstatic-routes stop'
timeout_seconds='60' />
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
</property_group>
<stability value='Unstable' />
</service>
</service_bundle>
root_sol10u2#Then create the method script:
root_sol10u2# cat /lib/svc/method/RKstatic-routes
#!/bin/sh
# RKstatic-routes
# To be called by the network/RKstatic-route SMF service
ACTION=${ACTION:-add}
setup_routes () {
#Route to networks.
/usr/sbin/route $ACTION net 172.1.0.0 -netmask 255.255.0.0 10.1.0.0
/usr/sbin/route $ACTION net 172.2.0.0 -netmask 255.255.0.0 10.2.0.0
case "$1" in
start)
echo "${ACTION}ing static routes"
setup_routes
stop)
ACTION=delete
echo "${ACTION}ing static routes"
setup_routes
echo "Usage: $0 {start|stop}"
exit 1
esac
root_sol10u2#Then, import and enable/start the service:
root_sol10u2# svccfg -v import /var/svc/manifest/network/RKstatic-routes.xml
root_sol10u2# svcadm enable network/RKstatic-routes
root_sol10u2# To stop:
root_sol10u2# svcadm disable network/RKstatic-routes
root_sol10u2# For posterity, here is a pre-Solaris 10 version:
root_sol9# cat /etc/init.d/staticRoutes.sh
#!/bin/sh
case "$1" in
start)
test -f /etc/routes.conf || exit 0
while read type route gateway
do
/usr/sbin/route add $type $route $gateway
done < /etc/routes.conf
stop)
test -f /etc/routes.conf || exit 0
while read type route gateway
do
/usr/sbin/route delete $type $route $gateway
done < /etc/routes.conf
echo "Usage: /etc/init.d/routes { start | stop }"
esac
root_sol9# cat /etc/routes.conf
172.1.2.0/24 172.1.2.4
172.1.3.0/24 172.1.3.4
root_sol9# ln -s /etc/rc2.d/S70staticRoutes /etc/init.d/staticRoutes.sh
root_sol9#Best Regards,
Bryan Wood -
Planning for Exchange 2013 DR. I have some queries on configuring DAG in my DR site.
Current setup:-
Primary site:- (2MB,2 CAS)
DR Planning:-
One Mailbox,One CAS Server
In primary mailbox server, two nic card is there. One is for MAPI and other one is for DAG replication. In DAG replication NIC card there is no gateway. Primary site DAG working without
any issues. In DR mailbox server two nic is there(One for Mapi and other for DAG replication). Problem iam facing is Primary site DAG NIC card not able to communicate with DR MBX server, since there is no gateway in replication NIC card. If I add the gateway
in replication NIC, then it is communicating with DR MBX. But iam getting mutiple gateways warning message.
MY Query is:-
1) Is there any problem having multiple gateways in MBX server.
2) If there is no problem with multiple gateway, how to restrict the users traffic hitting DAG replication NIC card.
3) Is there any configuration required in failover cluster manger menu for DR.
4) Is there any way to check DAG(replication) traffic hitting which NIC card..
Thanks for your support...Hi vino,
Thank you for your question.
Replication networks typically do not have default gateways, and if the MAPI network has a default gateway, then no other networks should have default gateways. Routing of network traffic on a Replication network can be configured by using persistent, static
routes to the corresponding network on other DAG members using gateway addresses that have the ability to route between the Replication networks. All other traffic not matching this route will be handled by the default gateway that's configured on the adapter
for the MAPI network.
So we should check configuration which is DAG cross site, we could refer to the following link:
https://social.technet.microsoft.com/Forums/exchange/en-US/bc260c97-a5aa-484d-bc8a-e7660ef4554f/setup-exchange-2010-dag-across-sites?forum=exchange2010
Issue 1: NO
Issue 2: In a general, user network was separated with replication network.
Issue 3:NO
Issue 4:it is pre-defined by yourselves, we could defined which NIC is charged for replication.
If there are any questions regarding this issue, please be free to let me know.
Best Regard,
Jim
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
Jim Xu
TechNet Community Support
Maybe you are looking for
-
Need help in creating a user exit variable
Hi all, I have created a query in which a key figure needs to be automated with an user exit variable.I want to derive the value of this key figure 'x' based on calender month. This key figure should get the cumulative value from the first month of t
-
Transferring video from hi8 camcorder
I have an Sony Hi8 Cancorder that I need to get video off of it. Is there sofware that will allow me to transfer the video from the hi-8 video to an format that I can then use in final cut pro?
-
Safari Crash: Frustrating: Fault Module Name - WebKit.dll
Safari: 5.0.2 (7533.18.5) My safari crashes, very frequently; almost once everyday. Very very frustrating.. I was almost contemplating.. giving up on my favourite browser. Reader is the only thing.. which keeps me binded. Not sure if this is the erro
-
Iphoto Crashes immediately after upgrade
I just upgraded to iPhoto 9.5.1 When I try to open iPhoto now it says I need to upgrade my library to work with this new version of iPhoto. Almost instantly when I click on 'upgrade' it crashes. It crashes so fast I can't even read what pops up, bu
-
PM Confirmations to update CATS2 (IW42 - CATS2)
Hi Experts, We have a business requirement to use CATS2 for a standard approach to time entry. As such, the project that implemented SAP PM did not give access to the IW42 transaction (confirmations). Now we still have the requirement for all time c