CN111209539A - Method for realizing license detection function based on ambari heartbeat mechanism - Google Patents

Method for realizing license detection function based on ambari heartbeat mechanism Download PDF

Info

Publication number
CN111209539A
CN111209539A CN201911357105.1A CN201911357105A CN111209539A CN 111209539 A CN111209539 A CN 111209539A CN 201911357105 A CN201911357105 A CN 201911357105A CN 111209539 A CN111209539 A CN 111209539A
Authority
CN
China
Prior art keywords
license
ambari
machine code
executing
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911357105.1A
Other languages
Chinese (zh)
Inventor
王康
范渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN201911357105.1A priority Critical patent/CN111209539A/en
Publication of CN111209539A publication Critical patent/CN111209539A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/105Arrangements for software license management or administration, e.g. for managing licenses at corporate level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/33User authentication using certificates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Abstract

The invention provides a method for realizing license detection function based on ambari heartbeat mechanism, which comprises the following steps: 1) generating a server machine code file: executing the step 2; 2) obtaining a unique license certificate file according to the server machine code file and the machine; executing the step 3; 3) compiling a script according to the server machine code file; executing the step 4; 4) adding the script obtained in the step 3 into an ambari heartbeat detection script, and executing the script by ambari at intervals; executing the step 5; 5) obtaining a machine code of the current host machine according to the ambari heartbeat detection script obtained in the step 4, and comparing the machine code with the license certificate file content of the current host machine to obtain a return result; 6) if the returned result is failure, ending; if the returned result is that the certificate passes, the method for realizing the license detection function based on the ambari heartbeat mechanism has clear and simple logic in the authentication process; the real-time heartbeat detection can be finished by utilizing the existing platform heartbeat mechanism.

Description

Method for realizing license detection function based on ambari heartbeat mechanism
Technical Field
The invention relates to a license detection method, in particular to a method for realizing a license detection function based on an ambari heartbeat mechanism.
Background
Apache ambari is a Web-based tool that supports the provisioning, management, and monitoring of Apache Hadoop clusters. Ambari already supports most Hadoop components including HDFS, MapReduce, Hive, Pig, zookeeper, Sqoop and the like, and our products can normally operate based on these components, so we add the products to Ambari clusters in a plug-in form as a service in the clusters. As a commercial product, license function is necessary, and whether a large data platform or a web interface of the product needs to import a certificate for normal use. The invention makes good use of the characteristics of the ambari platform to realize the function.
Apache hadoop, Cloudera CDH, is currently prevalent in china, although Hortonworks is also useful;
because of the limitations of stability, reliability, performance, ease of use, etc. in the face of enterprise-level applications, Hadoop, Apache community edition, has been "twice packaged" by many companies, known as Hadoop commercial release providers.
The large wave sand washing is divided by several companies since Hadoop was born before 10+ years (2006) to 2017, and more famous suppliers in foreign countries include Cloudera, MapR, Hortonworks, IBM, Amazon and the like, and more famous suppliers in domestic countries include Huazhen, star-and-loop science and technology and the like. Among them, only two foreign companies, Cloudera and Hortonworks, currently have commercial releases of Hadoop that provide no charge, which are called Cloudera's Distribution incorporation Apache Hadoop (abbreviated as "CDH") and Hortonworks Data Platform (abbreviated as "HDP"), respectively. Both companies also provide corresponding cluster management, deployment, monitoring tools, Cloudera Manager and Ambari, respectively.
Apache ambari is a web-based tool for configuring, managing and monitoring Apache Hadoop clusters, supporting Hadoop HDFS, Hadoop MapReduce, Hive, HCatalog, HBase, ZooKeeper, Oozie, Pig and Sqoop. Ambari also provides a cluster status dashboard, such as heatmaps and the ability to view MapReduce, Pig, Hive applications to diagnose their performance characteristics in a friendly user interface.
Accordingly, there is a need for improvements in the art.
Disclosure of Invention
The invention aims to provide an efficient method for realizing a license detection function based on an ambari heartbeat mechanism.
In order to solve the technical problem, the invention provides a method for realizing license detection function based on ambari heartbeat mechanism, which comprises the following steps:
1) generating a server machine code file: executing the step 2;
2) obtaining a unique license certificate file according to the server machine code file and the machine; executing the step 3;
3) compiling a script according to the server machine code file; executing the step 4;
4) adding the script obtained in the step 3 into an ambari heartbeat detection script, and executing the script by ambari at intervals; executing the step 5;
5) obtaining a machine code of the current host machine according to the ambari heartbeat detection script obtained in the step 4, and comparing the machine code with the license certificate file content of the current host machine to obtain a return result; executing the step 6;
6) if the returned result is failure, ending;
if the returned result is pass, executing step 7;
7) and jumping to an ambari management interface.
The method for realizing the license detection function based on the ambari heartbeat mechanism is improved as follows:
the step 6 comprises the following steps:
if the returned result is that the service does not pass, closing the ambari-server service, and ending when the big data platform cannot be opened;
if the returned result is pass, the ambari-server service is opened, and step 7 is executed.
As a further improvement of the method for realizing the license detection function based on the ambari heartbeat mechanism of the invention:
the license certificate file comprises a machine code, a department mark, a trial contract number, a trial client name, a license type, a service name and a maintenance time, wherein the maintenance time comprises a trial license maintenance period and a trial contract starting time.
As a further improvement of the method for realizing the license detection function based on the ambari heartbeat mechanism of the invention:
in step 6, it is determined that the returned result does not pass in the following cases:
firstly, the ambari heartbeat detection script can not obtain the machine code of the current host machine, the license certificate file of the corresponding current host machine does not exist,
secondly, the date in the machine code of the current host is not in the maintenance time in the license certificate file content;
and thirdly, the client information in the machine code of the current host is different from the client information in the license certificate file content.
As a further improvement of the method for realizing the license detection function based on the ambari heartbeat mechanism of the invention:
the step 1 comprises the following steps:
writing a license checksum generation tool by using c or c + +; the system is used for collecting various hardware indexes of a server to generate a machine code, and making a license according to the machine code, wherein the license comprises client information, license type (trial or contract), maintenance time (expiration time is automatically generated), an applicant, a contract number, a salesperson and an automatic generation application date.
As a further improvement of the method for realizing the license detection function based on the ambari heartbeat mechanism of the invention:
in the running process, the product page can be reminded through an interface 10 days before the maintenance time period in the license certificate file, the license expires after 10 days, and after the expiration, the product page can jump to a license expiration page for trial permission to access the product page and is not allowed to be used, but each component of the big data can be normally served, the data can be processed, and if the big data component is restarted, the big data component cannot normally work.
The method for realizing the license detection function based on the ambari heartbeat mechanism has the technical advantages that:
1. the authentication function can be completed without using a third party license authentication program;
2. the heartbeat detection in real time can be finished by utilizing the existing platform heartbeat mechanism;
3. the authentication process is clear and simple in logic;
4. no additional software needs to be installed on the platform.
Drawings
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
FIG. 1 is a schematic flow chart illustrating a process of starting a license import program after a server machine code file is generated according to the present invention;
Detailed Description
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto.
Embodiment 1, a method for implementing license detection function based on ambari heartbeat mechanism, as shown in fig. 1, includes the following steps:
1) generating a server machine code file:
writing a license check sum generation tool by using c or c + +, wherein the license check sum generation tool is used for collecting various hardware indexes of a server to generate machine codes, and the license made by a company according to the machine codes comprises client information, license types (trial or contract), maintenance time (expiration time is automatically generated), an applicant, a contract number, sales personnel and an automatic generation application date, the imported license is put into a certain specific catalogue of the machine, the verification is required before the license is imported, the main verification is carried out, and whether the local machine codes are consistent with the machine codes in the uploaded license or not is inconsistent, and the import fails; and if the system time is consistent with the preset server system time, the system time is compared, the service is not closed but the interface access is limited after the system time is expired, and the ambari service is started if the system time is not expired.
2) Starting a license import program in a background;
the obtained machine code can obtain a unique license certificate file according to the machine, and the certificate file is encrypted.
The license import program provides a license import function, and after the license import is successful, the ambari-server service is pulled up;
the license certificate file comprises a machine code, a department mark, a trial contract number, a trial client name, a license type, a service name and a maintenance time, wherein the maintenance time comprises a trial license maintenance period and a trial contract starting time.
3) Compiling a script;
writing a script to call a c or c + + program (the generated server machine code file obtained in the step 1) to obtain a current host machine code;
4) adding an ambari heartbeat detection script;
adding the script obtained in the step 3 into an ambari heartbeat detection script, and executing the script by ambari every other minute;
5) comparing machine codes;
the called script compares the machine code of the current host machine with the license certificate file content of the current host machine obtained in the step 2, so as to obtain a return result;
6) and returning a result for judgment;
6.1), the following can be found:
-3: reading a license certificate file with an error; (the ambari heartbeat detection script can not obtain the machine code of the current host machine or does not have the license certificate file of the corresponding current host machine)
-2: expiration; (not in the maintenance time, that is, the date in the machine code of the current host is not in the maintenance time in the content of the license certificate file)
-1: product name is wrong; (the client information does not conform, namely, the client information in the machine code of the current host machine is different from the client information in the license certificate file content)
0: the machine codes are not right; (the machine code in the machine code of the current host is different from the machine code in the content of license certificate file)
1: check is passed;
and directly closing the ambari-server service under the condition that the return value is-3-10, and jumping to a license import interface through the host/standby configuration of nginx at the moment, wherein the host/standby configuration is a web interface of the ambari-server and a license program interface, the access of the web interface is limited when the web interface is expired, and the access of the web interface is normal when the web interface is 1.
6.2) judging according to the returned value, if the returned value is-3, -2, -1, 0 (check does not pass), closing ambari-server service by calling command, and at this moment, the big data platform can not be opened, and ending;
6.3), if the return value is 1(check passed), the ambari command is called to open ambari-server service, by default in case no license is imported, ambari-server is closed, and step 7 is performed.
The license is made according to the machine code and includes contract number expiration time and the like, and the certificate content includes the following content:
machine code (waiting for filling)
CHECKINFO.MAC=EA0D333A8399386ECD45833567645BF4
Department mark (fixed)
CHECKINFO.HDTYPE=AILPHA
Contract number on probation (to be rotated Unicode filling)
CHECKINFO.NO=\u48\u32\u30\u31\u39\u30\u34\u33\u32\u32\u37\u8bd5
Customer name on probation (to be rotated Unicode filling)
CHECKINFO.CLIENT=\u901A\u5E02\u5927\u6570\u636E\u5C40
The type of license: trial (can be changed)
CHECKINFO.TYPE=\u8bd5\u7528
Service name (Can modify)
CHECKINFO.NAME=\u41\u49\u56\u49\u45\u57\u2e\u41\u69\u4c\u50\u48\u41\u5927\u6570\u636e\u667a\u80fd\u5b89\u5168\u5206\u6790\u5e73\u53f0
And (3) maintaining the trial license: 3 months (can change)
CHECKINFO.MONTH=3
Trial contract start time: current time (waiting to be calculated)
CHECKINFO.DURATION=2019-03-15
Number of nodes (to be filled)
CHECKINFO.TOTAL_NODES=2
7) If the return value is 1, executing the step 7, and jumping to an ambari management interface;
the ambari big data platform interface can be normally accessed, and the big data component can be normally switched on and off.
8) And at the running time, if license expires:
the method comprises the following steps that 10 days before license expiration, a product page is reminded through an interface, 10 days after license expiration are allowed, after expiration, for trial permission, a product page is accessed and jumps to a license expiration page, and the license expiration page is not allowed to be used, but each component of big data can be normally served and can be processed, and if the big data component is restarted, the big data component cannot normally work;
for the contract user, the expiration does not exist, and only if the contract user is within the maintenance time, the interface can be obviously reminded.
As shown in fig. 1, the method for implementing license detection function based on ambari heartbeat detection mechanism specifically includes the following steps:
A) and acquiring the machine code of the host machine where the license file is located.
command:./securityClient machine_code
return:string
B) The license content is read using the c + + program.
Figure BDA0002336228660000061
C) Comparing machine codes:
c1, the script gets the return value.
result1=`ssh-o″StrictHostKeyChecking no″master
Figure BDA0002336228660000064
{basepath}/securityclient valid
Figure BDA0002336228660000063
{basepath}/lic_AiLPHA_*.dat`
C2, corresponding operation according to the return value
Figure BDA0002336228660000062
D1, close or open ambari-server.
Amabri-server start
Ambari-server stop
Finally, it is also noted that the above-mentioned lists merely illustrate a few specific embodiments of the invention. It is obvious that the invention is not limited to the above embodiments, but that many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.

Claims (6)

1. A method for realizing license detection function based on ambari heartbeat mechanism is characterized in that: the method comprises the following steps:
1) generating a server machine code file: executing the step 2;
2) obtaining a unique license certificate file according to the server machine code file and the machine; executing the step 3;
3) compiling a script according to the server machine code file; executing the step 4;
4) adding the script obtained in the step 3 into an ambari heartbeat detection script, and executing the script by ambari at intervals; executing the step 5;
5) obtaining a machine code of the current host machine according to the ambari heartbeat detection script obtained in the step 4, and comparing the machine code with the license certificate file content of the current host machine to obtain a return result; executing the step 6;
6) if the returned result is failure, ending;
if the returned result is pass, executing step 7;
7) and jumping to an ambari management interface.
2. The method for realizing license detection function based on ambari heartbeat mechanism according to claim 1, wherein the method comprises the following steps:
the step 6 comprises the following steps:
if the returned result is that the service does not pass, closing the ambari-server service, and ending when the big data platform cannot be opened;
if the returned result is pass, the ambari-server service is opened, and step 7 is executed.
3. The method for realizing license detection function based on ambari heartbeat mechanism according to claim 2, wherein the method comprises the following steps:
the license certificate file comprises a machine code, a department mark, a trial contract number, a trial client name, a license type, a service name and a maintenance time, wherein the maintenance time comprises a trial license maintenance period and a trial contract starting time.
4. The method for realizing license detection function based on ambari heartbeat mechanism according to claim 3, wherein the method comprises the following steps:
in step 6, it is determined that the returned result does not pass in the following cases:
firstly, the ambari heartbeat detection script can not obtain the machine code of the current host machine, the license certificate file of the corresponding current host machine does not exist,
secondly, the date in the machine code of the current host is not in the maintenance time in the license certificate file content;
and thirdly, the client information in the machine code of the current host is different from the client information in the license certificate file content.
5. The method for realizing license detection function based on ambari heartbeat mechanism according to claim 4, wherein the method comprises the following steps:
the step 1 comprises the following steps:
writing a license checksum generation tool by using c or c + +; the system is used for collecting various hardware indexes of a server to generate a machine code, and making a license according to the machine code, wherein the license comprises client information, license type (trial or contract), maintenance time (expiration time is automatically generated), an applicant, a contract number, a salesperson and an automatic generation application date.
6. The method for realizing license detection function based on ambari heartbeat mechanism according to claim 5, wherein the method comprises the following steps:
in the running process, the product page can be reminded through an interface 10 days before the maintenance time period in the license certificate file, the license expires after 10 days, and after the expiration, the product page can jump to a license expiration page for trial permission to access the product page and is not allowed to be used, but each component of the big data can be normally served, the data can be processed, and if the big data component is restarted, the big data component cannot normally work.
CN201911357105.1A 2019-12-25 2019-12-25 Method for realizing license detection function based on ambari heartbeat mechanism Pending CN111209539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911357105.1A CN111209539A (en) 2019-12-25 2019-12-25 Method for realizing license detection function based on ambari heartbeat mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911357105.1A CN111209539A (en) 2019-12-25 2019-12-25 Method for realizing license detection function based on ambari heartbeat mechanism

Publications (1)

Publication Number Publication Date
CN111209539A true CN111209539A (en) 2020-05-29

Family

ID=70785198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911357105.1A Pending CN111209539A (en) 2019-12-25 2019-12-25 Method for realizing license detection function based on ambari heartbeat mechanism

Country Status (1)

Country Link
CN (1) CN111209539A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114039848A (en) * 2021-09-30 2022-02-11 济南浪潮数据技术有限公司 Method, device and equipment for realizing high availability of InCloudInsight management platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497374A (en) * 2011-12-13 2012-06-13 方正国际软件有限公司 Off-line available software license centralized security authentication system based on cloud computation, and method of the same
US8788316B1 (en) * 2011-06-07 2014-07-22 The Mathworks, Inc. Usage license
CN108875316A (en) * 2018-05-31 2018-11-23 中链科技有限公司 Licensing generation and verification method and server based on block chain
CN109460639A (en) * 2018-12-04 2019-03-12 郑州云海信息技术有限公司 A kind of license authentication control method, device, terminal and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788316B1 (en) * 2011-06-07 2014-07-22 The Mathworks, Inc. Usage license
CN102497374A (en) * 2011-12-13 2012-06-13 方正国际软件有限公司 Off-line available software license centralized security authentication system based on cloud computation, and method of the same
CN108875316A (en) * 2018-05-31 2018-11-23 中链科技有限公司 Licensing generation and verification method and server based on block chain
CN109460639A (en) * 2018-12-04 2019-03-12 郑州云海信息技术有限公司 A kind of license authentication control method, device, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114039848A (en) * 2021-09-30 2022-02-11 济南浪潮数据技术有限公司 Method, device and equipment for realizing high availability of InCloudInsight management platform

Similar Documents

Publication Publication Date Title
CN106203001B (en) Use the application license for the person of simultaneously providing
RU2488166C2 (en) Service-oriented conveyor-based architecture
CN105917690B (en) (NFV) system of intermodule communication, method and computer program in a network is virtualized based on network function
US8429124B2 (en) On demand multi-location large database synchronization system
US8914626B1 (en) Providing configurable bootstrapping of software image execution
US8856077B1 (en) Account cloning service for cloud computing environments
CN109800056A (en) A kind of block chain dispositions method based on container
CN107247648B (en) Method, device and system for realizing remote project system supervision based on Docker
CN107153571A (en) A kind of dispositions method and device of virtual management node
CN108762898A (en) A kind of management method, terminal device and the computer readable storage medium of thread interface
CN108038665A (en) Business Rule Management method, apparatus, equipment and computer-readable recording medium
CN105678118B (en) A kind of software version generation method and device containing digital certificate
CN109858257B (en) Access control method and device
CN102053855B (en) Software generation system and method
CN111209539A (en) Method for realizing license detection function based on ambari heartbeat mechanism
CN106354493B (en) A kind of implementation method for the development mode solving traditional software exploitation pain spot
Kessin Building Web Applications with Erlang: Working with REST and Web Sockets on Yaws
CN111131474A (en) Method, device and medium for managing user protocol based on block chain
CN113610452B (en) Method, system, equipment and medium for managing key piece materials
CN109858874A (en) Payment approval process configuration method and device under a kind of more scenes
CN112256978B (en) Data processing method, device and medium based on data model
Paz Microsoft Azure Cosmos DB Revealed: A Multi-Model Database Designed for the Cloud
CN113886061A (en) Industry thing networking operation and maintenance platform
CN112418796A (en) Sub-process node activation method and device, electronic equipment and storage medium
CN111369246A (en) Calling authentication method and device of intelligent contract, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200529

RJ01 Rejection of invention patent application after publication