Viewing Windows Commissioning Results
Scenario
After a FusionInsight Manager application is run, you can check the running result using either of the following methods:
- View the IntelliJ IDEA running result. Configure log printing information in the log4j.properties file in the /conf directory.
- Log in to the management node and view the system log web.log in the /var/log/Bigdata/tomcat directory.
Procedure
- Run the UserManager class. If the following log information is displayed, the operation is successful.
2020-10-19 14:22:52,111 INFO [main] Enter main. rest.UserManager.main(UserManager.java:43) 2020-10-19 14:22:52,113 INFO [main] Get the web info and user info from file .\conf\UserInfo.properties rest.UserManager.main(UserManager.java:56) 2020-10-19 14:22:52,113 INFO [main] The user name is : admin. rest.UserManager.main(UserManager.java:63) 2020-10-19 14:22:52,113 INFO [main] The webUrl is : https://10.112.16.93:28443/web/. rest.UserManager.main(UserManager.java:75) 2020-10-19 14:22:52,113 INFO [main] Begin to get httpclient and first access. rest.UserManager.main(UserManager.java:84) 2020-10-19 14:22:52,117 INFO [main] Enter loginAndAccess. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:56) 2020-10-19 14:22:52,120 INFO [main] 1.Get http client for sending https request, username is admin, webUrl is https://10.112.16.93:28443/web/. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:66) 2020-10-19 14:22:52,121 INFO [main] Enter getHttpClient. basicAuth.BasicAuthAccess.getHttpClient(BasicAuthAccess.java:98) 2020-10-19 14:22:52,693 INFO [main] Exit getHttpClient. basicAuth.BasicAuthAccess.getHttpClient(BasicAuthAccess.java:104) 2020-10-19 14:22:52,693 INFO [main] The new http client is: org.apache.http.impl.client.DefaultHttpClient@66d2e7d9. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:70) 2020-10-19 14:22:52,693 INFO [main] 2.Construct basic authentication,username is admin. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:76) 2020-10-19 14:22:52,694 INFO [main] the authentication is Basic YWRtaW46QmlnZGF0YV8yMDEz . basicAuth.BasicAuthAccess.constructAuthentication(BasicAuthAccess.java:122) 2020-10-19 14:22:52,695 INFO [main] 3. Send first access request, usename is admin. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:86) 2020-10-19 14:22:53,555 INFO [main] First access status is HTTP/1.1 200 basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:162) 2020-10-19 14:22:53,556 INFO [main] Response content is [{"infoType":1,"infoContent":"","alarmStat":[{"level":"Critical","num":0},{"level":"Major","num":6},{"level":"Minor","num":0},{"level":"Warning","num":0}],"timestamp":1603088492362,"timezoneOffset":-480}] basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:168) 2020-10-19 14:22:53,556 INFO [main] User admin first access success basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:174) 2020-10-19 14:22:53,556 INFO [main] Start to access REST API. rest.UserManager.main(UserManager.java:88) 2020-10-19 14:22:53,557 INFO [main] Enter sendHttpPostRequest for userOperation AddUser. basicAuth.HttpManager.sendHttpPostRequest(HttpManager.java:93) 2020-10-19 14:22:53,558 INFO [main] The json content = {"userName":"user888","userType":"HM","password":"XXX","confirmPassword":"XXX","userGroups":["supergroup"],"userRoles":[],"primaryGroup":"supergroup","description":"Add user"}. basicAuth.HttpManager.sendHttpPostRequest(HttpManager.java:148) 2020-10-19 14:22:55,437 INFO [main] The AddUser status is HTTP/1.1 204 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425) 2020-10-19 14:22:55,437 INFO [main] sendHttpPostRequest completely. basicAuth.HttpManager.sendHttpPostRequest(HttpManager.java:178) 2020-10-19 14:22:55,437 INFO [main] Enter sendHttpGetRequest for userOperation QueryUserList. basicAuth.HttpManager.sendHttpGetRequest(HttpManager.java:48) 2020-10-19 14:22:55,437 INFO [main] The operationUrl is:https://10.112.16.93:28443/web/api/v2/permission/users?limit=10&offset=0&filter=&order=ASC&order_by=userName basicAuth.HttpManager.sendHttpGetRequest(HttpManager.java:60) 2020-10-19 14:22:55,565 INFO [main] The QueryUserList status is HTTP/1.1 200 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425) 2020-10-19 14:22:55,565 INFO [main] The response lineContent is {"users":[{"userName":"admin","userType":"HM","description":"Administrator of FusionInsight Manager.","password":"","createTime":"2020-09-30T10:31:44+08:00","defaultUser":true,"primaryGroup":"compcommon","locked":false,"userRoles":["Manager_administrator"],"userGroups":[],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"developuser","userType":"MM","description":"","password":"","createTime":"2020-10-15T19:16:37+08:00","defaultUser":false,"primaryGroup":"elasticsearch","locked":false,"userRoles":["System_administrator"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"hue1","userType":"HM","description":"","password":"","createTime":"2020-10-09T17:39:57+08:00","defaultUser":false,"primaryGroup":"hive","locked":false,"userRoles":["System_administrator"],"userGroups":["hive","hadoop","supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"user888","userType":"HM","description":"Add user","password":"","createTime":"2020-10-19T14:21:32+08:00","defaultUser":false,"primaryGroup":"supergroup","locked":false,"userRoles":[],"userGroups":["supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"yangtong","userType":"MM","description":"","password":"","createTime":"2020-10-19T10:50:52+08:00","defaultUser":false,"primaryGroup":"supergroup","locked":false,"userRoles":["System_administrator"],"userGroups":["supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false}],"totalCount":5}. basicAuth.HttpManager.handleHttpResponse(HttpManager.java:430) 2020-10-19 14:22:55,565 INFO [main] SendHttpGetRequest completely. basicAuth.HttpManager.sendHttpGetRequest(HttpManager.java:69) 2020-10-19 14:22:55,565 INFO [main] The QueryUserList response is {"users":[{"userName":"admin","userType":"HM","description":"Administrator of FusionInsight Manager.","password":"","createTime":"2020-09-30T10:31:44+08:00","defaultUser":true,"primaryGroup":"compcommon","locked":false,"userRoles":["Manager_administrator"],"userGroups":[],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"developuser","userType":"MM","description":"","password":"","createTime":"2020-10-15T19:16:37+08:00","defaultUser":false,"primaryGroup":"elasticsearch","locked":false,"userRoles":["System_administrator"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"hue1","userType":"HM","description":"","password":"","createTime":"2020-10-09T17:39:57+08:00","defaultUser":false,"primaryGroup":"hive","locked":false,"userRoles":["System_administrator"],"userGroups":["hive","hadoop","supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"user888","userType":"HM","description":"Add user","password":"","createTime":"2020-10-19T14:21:32+08:00","defaultUser":false,"primaryGroup":"supergroup","locked":false,"userRoles":[],"userGroups":["supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false},{"userName":"yangtong","userType":"MM","description":"","password":"","createTime":"2020-10-19T10:50:52+08:00","defaultUser":false,"primaryGroup":"supergroup","locked":false,"userRoles":["System_administrator"],"userGroups":["supergroup"],"indepdtType":"NONE","domainUser":false,"synchroStatus":"SYNCHRO","userSource":"MRS_MANAGER_USER","iamCustomPolicyUser":false}],"totalCount":5}. rest.UserManager.main(UserManager.java:105) 2020-10-19 14:22:55,565 INFO [main] Enter sendHttpPutRequest for userOperation ModifyUser. basicAuth.HttpManager.sendHttpPutRequest(HttpManager.java:239) 2020-10-19 14:22:55,566 INFO [main] The json content = {"userName":"user888","userType":"HM","password":"XXX","confirmPassword":"XXX","userGroups":["supergroup"],"primaryGroup":"supergroup","userRoles":["Manager_administrator"],"description":"Modify user"}. basicAuth.HttpManager.sendHttpPutRequest(HttpManager.java:293) 2020-10-19 14:22:56,299 INFO [main] The ModifyUser status is HTTP/1.1 204 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425) 2020-10-19 14:22:56,299 INFO [main] sendHttpPutRequest completely. basicAuth.HttpManager.sendHttpPutRequest(HttpManager.java:304) 2020-10-19 14:22:56,299 INFO [main] The operationUrl is:https://10.112.16.93:28443/web/api/v2/permission/users basicAuth.HttpManager.sendHttpDeleteRequest(HttpManager.java:389) 2020-10-19 14:22:56,299 INFO [main] Enter sendHttpDeleteMessage for operation DeleteUser. basicAuth.HttpManager.sendHttpDeleteRequest(HttpManager.java:390) 2020-10-19 14:22:57,463 INFO [main] The DeleteUser status is HTTP/1.1 204 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425) 2020-10-19 14:22:57,463 INFO [main] sendHttpDeleteMessage for DeleteUser completely. basicAuth.HttpManager.sendHttpDeleteRequest(HttpManager.java:406) 2020-10-19 14:22:57,463 INFO [main] Exit main. rest.UserManager.main(UserManager.java:120)
As indicated in the log, when the main method of the UserManager class is executed, the loginAndAccess, sendHttpPostRequest, sendHttpGetRequest, sendHttpPutRequest, and sendHttpDeleteRequest methods are invoked in sequence to send the POST, GET, PUT, and DELETE requests for login authentication, adding users, searching for users, modifying users, and deleting users.
- Run the ExportUsers class. If the following log information is displayed, the operation is successful.
2020-10-19 14:25:02,845 INFO [main] Enter main. rest.ExportUsers.main(ExportUsers.java:41) 2020-10-19 14:25:02,847 INFO [main] Get the web info and user info from file .\conf\UserInfo.properties rest.ExportUsers.main(ExportUsers.java:54) 2020-10-19 14:25:02,847 INFO [main] The user name is : admin. rest.ExportUsers.main(ExportUsers.java:61) 2020-10-19 14:25:02,847 INFO [main] The webUrl is : https://10.112.16.93:28443/web/. rest.ExportUsers.main(ExportUsers.java:73) 2020-10-19 14:25:02,847 INFO [main] Begin to get httpclient and first access. rest.ExportUsers.main(ExportUsers.java:82) 2020-10-19 14:25:02,851 INFO [main] Enter loginAndAccess. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:56) 2020-10-19 14:25:02,854 INFO [main] 1.Get http client for sending https request, username is admin, webUrl is https://10.112.16.93:28443/web/. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:66) 2020-10-19 14:25:02,855 INFO [main] Enter getHttpClient. basicAuth.BasicAuthAccess.getHttpClient(BasicAuthAccess.java:98) 2020-10-19 14:25:03,414 INFO [main] Exit getHttpClient. basicAuth.BasicAuthAccess.getHttpClient(BasicAuthAccess.java:104) 2020-10-19 14:25:03,414 INFO [main] The new http client is: org.apache.http.impl.client.DefaultHttpClient@66d2e7d9. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:70) 2020-10-19 14:25:03,414 INFO [main] 2.Construct basic authentication,username is admin. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:76) 2020-10-19 14:25:03,415 INFO [main] the authentication is Basic YWRtaW46QmlnZGF0YV8yMDEz . basicAuth.BasicAuthAccess.constructAuthentication(BasicAuthAccess.java:122) 2020-10-19 14:25:03,415 INFO [main] 3. Send first access request, usename is admin. basicAuth.BasicAuthAccess.loginAndAccess(BasicAuthAccess.java:86) 2020-10-19 14:25:04,205 INFO [main] First access status is HTTP/1.1 200 basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:162) 2020-10-19 14:25:04,206 INFO [main] Response content is [{"infoType":1,"infoContent":"","alarmStat":[{"level":"Critical","num":0},{"level":"Major","num":6},{"level":"Minor","num":0},{"level":"Warning","num":0}],"timestamp":1603088623013,"timezoneOffset":-480}] basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:168) 2020-10-19 14:25:04,206 INFO [main] User admin first access success basicAuth.BasicAuthAccess.firstAccessResp(BasicAuthAccess.java:174) 2020-10-19 14:25:04,207 INFO [main] Start to access REST API. rest.ExportUsers.main(ExportUsers.java:86) 2020-10-19 14:25:04,208 INFO [main] Enter sendHttpPostRequest for userOperation ExportUsers. basicAuth.HttpManager.sendHttpPostRequestWithString(HttpManager.java:193) 2020-10-19 14:25:04,418 INFO [main] The ExportUsers status is HTTP/1.1 200 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425) 2020-10-19 14:25:04,418 INFO [main] The response lineContent is {"fileName":"userInfo_2020-10-19-14-23-43.zip"}. basicAuth.HttpManager.handleHttpResponse(HttpManager.java:430) 2020-10-19 14:25:04,418 INFO [main] SendHttpPostRequest completely. basicAuth.HttpManager.sendHttpPostRequestWithString(HttpManager.java:216) 2020-10-19 14:25:04,464 INFO [main] Enter sendHttpGetRequest for userOperation DownloadUsers. basicAuth.HttpManager.sendHttpGetRequest(HttpManager.java:48) 2020-10-19 14:25:04,464 INFO [main] The operationUrl is:https://10.112.16.93:28443/web/api/v2/permission/users/download?file_name=userInfo_2020-10-19-14-23-43.zip basicAuth.HttpManager.sendHttpGetRequest(HttpManager.java:60) 2020-10-19 14:25:04,508 INFO [main] The DownloadUsers status is HTTP/1.1 200 . basicAuth.HttpManager.handleHttpResponse(HttpManager.java:425)
As indicated in the log, when the main method of the ExportUsers class is executed, the loginAndAccess, sendHttpPostRequestWithString, and sendHttpGetRequest methods are invoked in sequence to send the POST and GET requests for login authentication, exporting users, and downloading users.
- You can configure the log printing information in the conf\log4j.properties file to view the application running process and result.
The printing information is configured by default. The following provides an example.
##set log4j DEBUG < INFO < WARN < ERROR < FATAL log4j.logger.rest=INFO,A1,A2 log4j.logger.basicAuth=INFO,A1,A2 log4j.logger.org.apache.http=INFO,A1,A2 #print to the console?A1 log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %m %l%n #log file log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.File=./log/rest.log log4j.appender.A2.Append = true log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %m %l%n
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot