Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddClusterUser
01-19-2017, 04:15 PM (This post was last modified: 06-30-2017 04:49 PM by rayluk.)
Post: #1
AddClusterUser
Create the user on each node with password-less SSH.

If the user already exists, it would check the uid, group id & group name are expected and consistent on all node.
It makes sure the user on all nodes have the same uid, group id & group name.

Usage:
AddClusterUser {--username|-u <USERNAME>} {--password|-p <PASSWORD>} [--uid <UID>] [--groupid <GID>] [--ips <ips file>]
AddClusterUser {--help|-h}
--username, -u: The name of the created user.
--password, -p: The password of the created user. If the user exists, the password would not be changed.
--uid: The user id of the created user. It must not be used in any node, or consistent on all nodes.
--groupid: The group id of the primary group of the created user. It must not be used in any node, or consistent on all nodes.
--ips: The node list of the cluster. Default value is /thinker/etc/ips.cfg.
--help, -h: Print this info.

Error Codes:
16: ips file does not exist.
17: Do not have root permission.
18: User does not exist but group with the same name exists on some nodes.
20: Existed user info is not consistent.
21: uid is not expected.
22: groupid is not expected.
23: groupname is not expected.
Others are omitted.

Example:
AddClusterUser --username abc --password 123456
Find all posts by this user
Quote this message in a reply
02-26-2017, 02:56 PM
Post: #2
RE: AddClusterUser
Pls specify important return status, e.g.,

If the user exists, AddClusterUser returns 18.
Find all posts by this user
Quote this message in a reply
02-26-2017, 03:06 PM (This post was last modified: 02-26-2017 03:07 PM by lingu.)
Post: #3
RE: AddClusterUser
Currently, user existing is considered an error. But this is a normal situation in many automated systems.

I suggest changing the following output message to be a warning or info, not an error mesage.

"ERROR: User gene already exists on 10.28.1.2."
Find all posts by this user
Quote this message in a reply
02-26-2017, 08:14 PM
Post: #4
RE: AddClusterUser
(02-26-2017 02:56 PM)lingu Wrote:  Pls specify important return status, e.g.,

If the user exists, AddClusterUser returns 18.

Added.

(02-26-2017 03:06 PM)lingu Wrote:  Currently, user existing is considered an error. But this is a normal situation in many automated systems.

I suggest changing the following output message to be a warning or info, not an error mesage.

"ERROR: User gene already exists on 10.28.1.2."

No.
It is not good for this case because AddClusterUser would also do some basic configuration such as password-less SSH and make sure the uid are same in all nodes.
When we feel it is necessary to do the same basic configuration for an existed account, we can improve the implementation of AddClusterUser to allow the existence of account, just like AddOpuser. Currently I do not find such necessary.
Find all posts by this user
Quote this message in a reply
06-30-2017, 04:49 PM
Post: #5
RE: AddClusterUser
Updated help info for optional ips files
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: