Member since
03-14-2016
4721
Posts
1111
Kudos Received
874
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 2513 | 04-27-2020 03:48 AM | |
| 4979 | 04-26-2020 06:18 PM | |
| 4057 | 04-26-2020 06:05 PM | |
| 3291 | 04-13-2020 08:53 PM | |
| 5020 | 03-31-2020 02:10 AM |
09-11-2017
06:51 PM
@uri ben-ari That error you will get only when you have not specified the "Cluster Name" aftaer the ambari server hostname in the config.sh command: /var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 get amb25101.example.com plain_ambari cluster-env /tmp/cluster-env.txt .
... View more
09-08-2017
07:38 AM
@Anurag Mishra - You will need to pass all the previous user privilege details as well along with the new user when you want to edit the list using API call: Example if you already have users privilleges for "123jay", "jay". Now you want to add another user "jayyarn" in the privilleges list then you should PUT the whole list again. Example: curl -i -u $Ambariadmin:$ambaripass -H "X-Requested-By: ambari" -X PUT -d '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"123jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jayyarn","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.USER","principal_type":"ROLE"}}]' http://localhost:8080/api/v1/views/$viewname/versions/$version/instances/$instance/privileges .
... View more
02-28-2019
05:23 PM
Thank you for the very helpful article.
... View more
08-30-2017
03:56 PM
@Anurag Mishra You should use extra single quotes as "'${password}'" and "'${username}'" Notice: "'${password}'" And "'${username}'" Example: # export username=test112233
# export password=test112233_password
# export Ambariuser=admin
# export ambaripass=admin
# curl -iv -u $Ambariuser:$ambaripass -H "X-Requested-By: ambari" -X POST -d '{"Users/user_name":"'${username}'","Users/password":"'${password}'","Users/active":"true","Users/admin":"false"}' http://localhost:8080/api/v1/users . Output: .
... View more
08-29-2017
09:29 AM
1 Kudo
Many times we see some repeated logging inside our log files. For example in case of ambari-server.log we see the following kind of repeated logging inside the log. WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.ambari.server.api.services.StacksService.getStackArtifacts(java.lang.String,javax.ws.rs.core.HttpHeaders,javax.ws.rs.core.UriInfo,java.lang.String,java.lang.String), should not consume any entity. We might see the above kind of warning messages repeated many times. # grep 'public javax.ws.rs.core.Response org.apache.ambari.server.api.services.RequestService.getRequests' /var/log/ambari-server/ambari-server.log
150
- These are actually harmless WARNING messages, but many times it is desired to make sure that they are not logged, That way we can save some disk space issues and have a clean log. - Every time it is not possible to change the rootLogger to "ERROR" like following to avoid printing some INFO/WARNING messages, Because it will cause suppressing other useful INFO/WARNING messages not t be logged. log4j.rootLogger=ERROR,file - In order to avoid logging of few specific log entries based on the Strings irrespective of the various different logging level (INFO/WARNING/ERROR/DEBUG) those entries are coming from. - In this case suppose, if we do not want to log the line which has "public javax.ws.rs.core.Response" entry in it at any place then we can make use of StringMatchFilter feature of log4j as following: . Step-1). Edit the "/etc/ambari-serevr/conf/log4j.properties" and add the following 3 lines in it Just below to the "file" log appender. log4j.appender.file.filter.01=org.apache.log4j.varia.StringMatchFilter
log4j.appender.file.filter.01.StringToMatch=public javax.ws.rs.core.Response
log4j.appender.file.filter.01.AcceptOnMatch=false Now the log4j.properties audit log appender will look like following: # Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=${ambari.log.dir}/${ambari.log.file}
log4j.appender.file.MaxFileSize=80MB
log4j.appender.file.MaxBackupIndex=60
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{DATE} %5p [%t] %c{1}:%L - %m%n
log4j.appender.file.filter.01=org.apache.log4j.varia.StringMatchFilter
log4j.appender.file.filter.01.StringToMatch=public javax.ws.rs.core.Response
log4j.appender.file.filter.01.AcceptOnMatch=false NOTE: we can use as many filters we want. We will only need to change the filter number like "log4j.appender.file.filter.01", "log4j.appender.file.filter.02", "log4j.appender.file.filter.03" with different "StringToMatch" values. Step-2). Move the OLD ambari-server logs and restart the ambari-server # mv /var/log/ambari-server /var/log/ambari-server_OLD
# ambari-server restart . Step-3). Put the ambari-server.log in tail and then restart ambari server to see if the following line entry is gone from the ambari-server.log now and you should not see those lines again. # grep 'public javax.ws.rs.core.Response org.apache.ambari.server.api.services.RequestService.getRequests' /var/log/ambari-server/ambari-server.log .
... View more
Labels:
12-01-2017
08:31 PM
FYI, the tutorial has recently been updated: Learning the Ropes of the Hortonworks Sandbox
... View more
08-25-2017
06:54 AM
1 Kudo
@Sheetal Sharma LongWritable is the WritableComparable for longs, Similarly IntWritable is a WritableComparable for ints. These interfaces [1] & [2] are all necessary for Hadoop/MapReduce, as the Comparable interface is used for comparing when the reducer sorts the keys, and Writable can write the result to the local disk. It does not use the java Serializable because java Serializable is too big or too heavy for hadoop, Writable can serializable the hadoop Object in a very light way. [1] https://hadoop.apache.org/docs/r2.7.2/api/org/apache/hadoop/io/LongWritable.html [2] https://hadoop.apache.org/docs/r2.7.2/api/org/apache/hadoop/io/IntWritable.html#IntWritable() "Comparable" is the interface whose abstract methods give us the flexibility to compare two objects. "Writable" is meant for writing the data to local disk and it's a serialization format. One can implement own Writables in Hadoop. Java’s serialization is too bulky and slow on the system. That’s why Hadoop community had put Writable in place. "WritableComparable" is a combination of the above two interfaces. "int" is a primitive type so it cannot be used as key-value. Integer is the wrapper class around it. So I’ll correct your question that what is the difference between Integer and IntWritable? "IntWritable" is the Hadoop variant of Integer which has been optimized for serialization in the Hadoop environment. An integer would use the default Java Serialization which is very costly in Hadoop environment. .
... View more
08-24-2017
05:20 PM
You're absolutely correct, I hadn't even looked at that. I was using ver 2.3 of the Hive JDBC driver. Downgrading to 2.2 worked like a charm. Thanks!
... View more
08-22-2017
08:27 AM
@Johannes Mayer There can be two approaches 1. To Suppress the alerts (if they are getting cleared quickly), Means increasing the "timeout" and "check interval" of those alerts. 2. Finding the resources that might be causing the issue like looking at the Memory # free -m
# top
# Logs of individual components like DataNode & NodeManager (When they were not responding) were there any Long GC pause? Looking at the GC log of DataNode/NodeManager can be helpful to know if there were Long GC pauses?
# /var/log/messages to see any abnormal behaviour during the time period.
# SAR Report (Historical Data Capturing of the OS which includes various statistocs including IO/CPU/Memory ...etc).
. .
... View more
08-17-2017
06:43 PM
every thing is ok now thx
... View more