The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Creating create mirrored disk files systems using mkfs command GLJ@USC UNIX for Dummies Questions & Answers 4 11-07-2006 01:52 PM
Grid vs. Parallel vs. Distributed Heathe_Kyle High Performance Computing 2 10-30-2006 12:23 PM
creating unique lists from user input annie Shell Programming and Scripting 1 11-20-2005 01:22 AM
Creating user ids on multiple systems simultaneously darthur UNIX for Dummies Questions & Answers 1 08-07-2003 03:22 PM
Distributed veitcha UNIX for Dummies Questions & Answers 3 11-06-2000 09:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-03-2006
pic pic is offline
Registered User
  
 

Join Date: May 2006
Posts: 2
Creating a Unique ID on distributed systems

Hi,

How do you actually create a unique ID on a distributed system. I looked at gethostid but the man page says that its not guaranteed to be unique. Also using the IP address does not seem to be a feasible solution. Is there a function call or mechanism by which this is possible when even the time is not synchronized using NTP ?

Thanks
  #2 (permalink)  
Old 05-03-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Whan you install the system, create a file called /etc/unique_id and put a unique_id in it. Then you just read that file. I don't know why you think that time has anything to do with this, but yes, this technique is possible even when the time is not synchronized using NTP.
  #3 (permalink)  
Old 05-09-2006
DreamWarrior DreamWarrior is offline
Registered User
  
 

Join Date: Oct 2003
Posts: 70
If you have access to a database, such as Oracle, you may find this useful. However, that would of course cause all the processes using said unique ID to potentially block each another up. There are ways around that too, pre-fetching UIDs etc.

The other way, as Pederabo said, is to assign each distributed machine some machine ID. Then as it feeds transactions (or whatever needs to be uniquely identified) it can prepend/append its unique ID to a machine independant unique ID.
  #4 (permalink)  
Old 05-09-2006
bugbugbug bugbugbug is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 6
use your ip address + local time + a huge random number to generate a Unique ID

many programs use this kind of technology.
  #5 (permalink)  
Old 05-10-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,933
Why not use your network card's mac address? That's a big very-unique number that comes with your PC. The only caveat would be, upgrade your network card and it changes Maybye generate /etc/unique_id from the mac address then just use the file thereafter?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0