Category Archives: How to Fix

Mapped Statements collection does not contain value for XXXX

Today, I stepped into an interesting pit with mybatis. After a day’s searching, I didn’t find the problem. Let me tell you about the conventional solutions.

The command space of the mapping file of

    mybatis is inconsistent with the fully qualified name of the interface; it is possible that the name of the mapping file of mybatis is inconsistent with the class name of the interface; in another case, the method declared by the interface is not included in the mapping file.

But I checked n times! N times! There is no problem. It’s perfect, but it’s a mistake!

The result is that the XML file is not compiled!

When compiling, put the XML file in the folder like this

you can see that the XML file is not compiled.
We are here pom.xml Add the following code to the

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>
    </build>

Recompile

XML is compiled to solve the problem

Solution to cross domain sharing problem of session

Before discussing the cross domain sharing of session, we should first understand what session has done and has not done

    HTTP is stateless, that is to say, the server does not know who has visited it, but sometimes we need to keep this state. For example, if the user logs in every time, the user experience is really bad. Session solves this problem. It maintains the user login information on the server and generates a jsessionid for the customer The client will take this jsession ID with it the next time it visits the server, and the server will search the user information according to this ID. Of course, the disadvantages of session are also obvious. Session exists in the memory of the server. If there are too many sessions, the performance of the server will be affected. Because session is only in one server, when there are multiple servers, accessing other servers will definitely fail.

After making clear what session does and its defects, it is much easier to solve the problems existing in session. Let me briefly talk about five solutions

Session stickysession copy session centralized storage cookietoken

Session sticky: it means that requests from the same client will fall on the same server, because they will not fall on other servers, so cross domain problems will not occur. But the disadvantage of this scheme is very obvious, that is, no matter what algorithm is used, the user will decide which server the user’s request falls on, which may cause a single point of pressure, and if a server has problems, it may cause people in an area to be unable to access

Session replication: refers to the synchronization of session information between servers, that is, all session information is saved on each server. The disadvantages of doing so are also very obvious. As mentioned above, session is stored in memory, which will seriously affect the performance of the server. Of course, you can also store it in the database, but it will greatly affect the response speed. Another disadvantage is that when the traffic is too large, it will cause a lot of network overhead due to the problem of mutual synchronization

Session centralized storage: it refers to the centralized storage of sessions in a third-party server, which can be redis, database or other things. When you need to access it, go to this server. This also has some disadvantages. First of all, it is a single point problem. If the server goes down, all services are unavailable. Therefore, it is necessary to build a cluster here, which will waste server resources. Another point is that every time you verify, you need to check with this server, which will increase the network overhead and reduce the access speed

Cookie: the state information is no longer saved in the server, but in the client. Every time the client visits the server, it brings the information to the server. However, cookies also have many problems. The most concerned problem is security. Because information is stored on the client, it is easy to be stolen and tampered with. Of course, there are solutions to these security problems. This is not the main reason for restricting cookies. The real reason for restricting cookies is that many devices do not support * * cookies

Token: similar to cookie, token is maintained by client, and information is stored in client, which is platform independent. A token is essentially a string given by the server to the client, which contains some authentication information. It is equivalent to an identity token. You can get its service with this token. Compared with cookie, token is more flexible and can be generated anywhere. The permission system based on token is very easy to implement

Of course, the above five solutions are not the only ones. I just listed a few representative ones.

Solutions are used to solve problems. There is no good saying about the above solutions. Only the right one is the best.

The solution of PL / SQL can’t connect to the remote server after installing Oracle locally

Before, there was no Oracle client installed on the computer, just using PL/SQL to access the remote server. During this time, I want to install myself for fun. As a result, after installing Oracle 10g locally, PL/SQL can’t access the original server. Baidu didn’t find a feasible solution for a long time. Later, I thought of Google. It’s really professional. The first result I found solved my problem… I don’t want to talk too much nonsense. I want to talk about my problems and solutions.

 

Prompt when connecting to the server:

Ora-12514: the listener is currently unable to recognize the service requested in the link description

 

I think there is something wrong with the configuration. And then check it on the Internet. The solutions found (I used them and they are feasible) are as follows:

 

Configure listener of Oracle server

Modify the & lt; installation directory & gt;/network/admin/directory listener.ora and tnsnames.ora Two files. among

The listener file is as follows:

# listener.ora Network Configuration File: /oracle/app/product/10.1.0/db_ 1/network/admin/ listener.ora

# Generated by Oracle configuration tools.

SID_ LIST_ LISTENER =

(SID_ LIST =

(SID_ DESC =

(SID_ NAME = PLSExtProc)

(ORACLE_ HOME = /oracle/app/product/10.1.0/db_ 1)

(PROGRAM = extproc)

)

(SID_ DESC =
(GLOBAL_ Dbname = Demo1) # Demo1 is the Oracle instance name
(Oracle)_ HOME = /oracle/app/product/10.1.0/db_ 1)
(SID_ NAME = demo1)
)

)

LISTENER =

(DESCRIPTION_ LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

(address = (protocol = TCP) (host = 192.168.0.100) (Port = 1521)) # IP address is Oracle server

)

)

tnsnames.ora The document is amended as follows:

# tnsnames.ora Network Configuration File: /oracle/app/product/10.1.0/db_ 1/network/admin/ tnsnames.ora

# Generated by Oracle configuration tools.

Demo1 =
(description =
(address = (protocol = TCP) (host = 192.168.0.100) (Port = 1521))?The IP address is Oracle server
(connect)_ DATA =
(SERVER = DEDICATED)
(SERVICE_ Name = Demo1) # Demo1 is the Oracle instance name or service name, which can be modified by netmgr or netca
)

)

EXTPROC_ CONNECTION_ DATA =

(DESCRIPTION =

(ADDRESS_ LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(CONNECT_ DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

The above modifications can also be configured through netmgr and netca.

After modification, restart the listener

After modifying these configurations, you can connect to the server.

 

Feeling: I haven’t really used PL/SQL and Oracle before, but this time I have a problem I felt that the problem of crouching trough was very advanced. At that time, I was a little flustered. My first reaction was to ask others, but I was not willing to. So I went to the Internet to find a solution. Baidu didn’t find a feasible solution for a long time. Later, I asked in the classmate group, and no one knew the solution. Some students asked Google, so I became a living horse doctor and tried it I searched for it, and it turned out…. The result is what you see now ~ some things can’t only look at the surface, and can’t be scared by the problems. When you work hard to solve them, you will find that they are all small cases. Ha ha, it’s not bad. I haven’t solved a problem that makes me feel successful for a long time. come on.

MySQL driver compiling method of QT under windows and solutions to abnormal errors

2015-11-20

Recently, in the process of compiling QT’s MySQL driver with MinGW under windows, it was compiled through several twists and turns. In the process of compiling, there are many problems. In order to avoid similar errors in the subsequent driver compilation and facilitate the rapid completion of this driver compilation, the compilation methods are sorted out.

This method is illustrated by a case of my own compiling environment.

1、 Compiling environment

Operating system: win7 64 bit

MySQL service version: mysql-5.5.46-win32

QT version: 4.8.6

Compiling environment: MinGW 64 bit

2、 Compilation steps

(1) Generate libmysql. A file

Because MinGW compiler needs to use “. A” suffix static library file to connect with static library, but according to MySQL database, there is only “. Lib” format static library, so it needs to be converted. Two tools are needed for conversion reimp.exe and dlltool.exe The paths of these two tools need to be configured in the path environment variable. The conversion command is as follows:

First of all, open the CMD command input box and enter the Lib path under the MySQL installation path. For example, my path is: “C:// program files (x86)  MySQL  MySQL server 5.5  lib”.

Next, enter the following commands in turn:

reimp -d  libmysql.lib

dlltool -k -d  libmysql.def  -l libmysql.a

After successful execution, you can view the library file of libmysql. A in this path.

(2) Editor mysql.pro Engineering documents

Find it in the installation path of QT mysql.pro The path of my pro file is: “C:// Qt/4.8.6/SRC/plugins/sqldrivers/MySQL”.

open mysql.pro File, add the following configuration below:

INCLUDEPATH+=”C:/ProgramFiles(x86)/MySQL/MySQL Server 5.5/include/”

LIBS+= -L”C:/ProgramFiles(x86)/MySQL/MySQL Server 5.5/lib/” –llibmysql

The second line can also be written as follows:

LIBS+= “C:/ProgramFiles(x86)/MySQL/MySQL Server 5.5/lib/libmysql.a”

Makefile Makefile.Debug 、 Makefile.Release Three makefile files and others. As shown in the figure below:

(3) Edit makefile file

Take the debug version as an example. open Makefile.Debug File, find LIBS = “XXXX” line and modify it. Because there is a problem with this configuration generated.

The original configuration is as follows:

LIBS = -L”c:\Qt\4.8.6\lib”debug\qsqlmysqld_ resource_ res.o -llibmysql “-LC:/ProgramFiles(x86)/MySQL/MySQL Server 5.5/lib/” -llibmysql -lQtSqld4 -lQtCored4

According to our intention, according to makefile’s syntax rules, we can clearly find the problem. First of all, “L” must be placed outside the path of the configuration library. Second, the – llibmysql command has repetition.

It is revised as follows:

LIBS = -L”c:\Qt\4.8.6\lib”debug\qsqlmysqld_ resource_ res.o -L “C:/Program Files(x86)/MySQL/MySQLServer 5.5/lib/” -llibmysql -lQtSqld4 -lQtCored4

Or it can be modified as follows:

LIBS = -L”c:\Qt\4.8.6\lib”debug\qsqlmysqld_ resource_ res.o “C:/Program Files(x86)/MySQL/MySQL Server5.5/lib/libmysql.a” -lQtSqld4 -lQtCored4

The release version of makefile is modified in the same way.

(4) Execute the make command

Use the mingw32 make command to execute makefile. If no parameter is added, it will be executed by default Makefile.Debug . You can write debug or release or both after mingw32 make command to execute the corresponding version of makefile.

For example, execute debug and release makefile at the same time. The command is as follows:

mingw32-make debug release

After successful execution, you can see qsqlmysqld. A qsqlmysqld.dll Two library files, in the release folder, see qsqlmysql. A qsqlmysql.dll Two library files.

These four library files are the static library and dynamic library driven by MySQL of debug and release versions.

(5) Copy the driver file to the specified directory

Copy the four driver files generated in the previous step to the database driver directory of QT, that is, under the path of “C:: (QT) ﹣ 4.8.6 ﹣ plugins ﹣ sqldrivers”.

(6) Copy libmysql.dll File to specified directory

Install the libmysql.dll Copy the dynamic library file to the bin directory of QT, i.e. “C:// Qt/4.8.6/plugins/sqldrivers”. At this point, use QT to write a program to connect to MySQL database.

3、 Test whether the driver is available

Write demo program to test QT driver. The main codes are as follows:

#include <QtCore/QCoreApplication>  

#include <QDebug>  

#include <QStringList>  

#include <QString>  

#include <QSqlDatabase>  

int main(int argc, char *argv[])  

{  

    QCoreApplication a(argc, argv);  

    qDebug()<<“Available drivers:”;  

    QStringList drivers = QSqlDatabase::drivers();  

    foreach(QString driver,drivers)  

    qDebug()<<“\t”<<driver;  

    return a.exec();  

}  

Add in project file

QT       +=sql

Running this demo program, you can see “qmysql3” and “qmmysql” in the list of available drivers. As shown in the figure below:

4、 Common problems and Solutions

(1) Cannot find – llibmysql

“- llibmysql” cannot be found because the configuration in makefile is incorrect. After modifying Makefile, compile it again, and the compilation passes.

The solution to this problem is: check the configuration in Makefile, modify it to conform to the rules of makefile syntax, and then try again.

(2) Undefined reference to ‘MySQL’_ character_ set_ name@4 ’

This situation, as well as a series of undefined references related to MySQL, is due to a problem loading the MySQL library. After online query of relevant information, we know that it is the version problem of MySQL database. When using the link library in 64 bit MySQL database, we will report this error.

The solution is to install a 32-bit MySQL database and configure it mysql.pro File, compile the driver again, and the error will not appear again.

(3) Unrecognized command line option \ “- fno keep inline dllexport \”

The reason for this error is that the version of the compiler is relatively low. To query the version of the currently used gcc compiler is GCC – 4.4.0. The explanation of the online information is as follows:

this is because\”-fno-keep-inline-dllexport\” is the option of mingw 4.6.1, but i’musing 4.5. So I change it by installingcodelite-3.5.5377-mingw4.6.1-wx2.9.2.exe

The translation is as follows:

This is because the option “- fno keep inline dllexport” is a function of mingw4.6.1. The current version is too low, so the gcc compiler of version 4.6.1 or above is needed.

Later, the MinGW compiler environment of 4.8.1 version of gcc compiler was installed. When compiling this driver, the above error disappeared.

Therefore, the solution to this problem is to install the gcc compiler above 4.6.1.

How to use C + + function pointer array

2015-11-24

1、 Origin

Under what circumstances did you come up with an array of function pointers?Because there are a series of sequential functions in a program recently written, and the forms of these functions are basically the same, it is necessary to judge the execution result of each step, whether the execution is successful or not. If the execution is successful, the next function will continue to be executed. If the execution fails, the terminal will execute and exit.

Because there are many functions to be executed in turn, there are five. To write code according to the conventional way of thinking is to judge the result of each step by if-else, and decide the content of the next step according to the result. At present, there are only five functions to be executed. If there are more similar functions to be executed in sequence, this function will be very long, not easy to read, and the code will not be beautiful.

Considering that the parameter list and return value of the current function are basically the same, we consider whether we can traverse the function pointer array, store the function pointer in the array and traverse the array, so as to execute the function pointed to by the corresponding pointer in turn, judge the results one by one, and do the corresponding processing. In this way, the result processing part can adopt a unified way, which is very convenient to judge, the code is also very simple and clear, and it is easy to read.

So online query related information, to understand the use of function pointer array. Through data query, the use of C + + function pointer array can be divided into two categories, one is the use of global function pointer array (the same as C language), the other is the use of C + + member function pointer array. Now the two cases are sorted out respectively.

2、 The use of global function pointer array in C

(1) Requirements

1. The parameter list and return value type of a series of functions to be called should be identical;

2. It is required to put the function pointer to be called into the function pointer array (if the function must have sequential execution, then the storage order of the function pointer should be consistent with the calling order);

3. When calling, take out the function pointer to be executed from the array and execute the corresponding function.

(2) Code case

Reference from: http://blog.csdn.net/feitianxuxue/article/details/7300291

 

#include <iostream> 

using namespace std; 

 

void function0(int); 

void function1(int); 

void function2(int); 

 

int _ tmain(int argc, _ TCHAR* argv[]) 

Void (* f [3]) (int) = {function0, function1, function2};// save the three function pointers in the array F

      intchoice;

      cout<< “Enter a number between 0 and 2,3 to end: “;

      cin>> choice;

//handle user selection

      while((choice >= 0) && (choice <3))

      {

//call a function in the array f

(* f [choice]) (choice);// F [choice] select the pointer whose position is choice in the array.

//the pointer is dereferenced to call the function, and choice is passed as an argument to the function.

             cout<< “Enter a number between 0 and 2,3 to end: “;

             cin>> choice;

      }

      cout<< “Program execution completed.” << endl;

      system(“pause”);

      return0;

}

 

void function0(int a)

{

      cout<< “You entered” << a << ” so function0 wascalled\n\n”; 

}

 

void function1(int b)

{

      cout<< “You entered” << b << ” so function1 wascalled\n\n”;

}

 

void function2(int c)

{

      cout<< “You entered” << c << ” so function2 wascalled\n\n”;

}

3、 The use of pointer array of member function in C + + class

(1) Requirements

When using the pointer array of member function in C + + class, it is different from that of C. The requirements are as follows:

1. It is required that the parameter list and return value type of the member function put into the function pointer array are completely consistent;

2. Define a function pointer array, and specify the length of the array (equal to the number of member functions to be stored), and assign the member function pointer to the corresponding array variable during initialization (if the function must have sequential execution, the storage order of the function pointer should be consistent with the calling order);

3. When calling, take out the function pointer to be executed from the array and execute the corresponding function. When calling, use “& gt; *” or “. *” to point to array elements, otherwise an error will be reported during compilation.

(2) Code case

Reference from: http://www.cppblog.com/dragon/archive/2010/12/02/135250.html

 

/*

* small program for testing pointer array of member function

* key points of the code have been marked in red

 */

#include <iostream>

using namespace std;

 

class Test

{

public:

   Test();

   ~Test();

 

private:

   void add5(){ res+=5;}

   void add6(){ res+=6;}

//this 2 is very important. If it is not written in VC, an error will be reported, but it is not reported in QT, but an error will be reported during the deconstruction!

    void (Test::*add[2])();

public:

   void DoAddAction();

   void Display();

private:

   int res;

};

 

Test::Test()

{

//pay attention to the writing here

    add[0]=&Test::add5;

    add[1]=&Test::add6;

   res=0;

}

 

Test::~Test()

{

 

}

 

void Test::DoAddAction()

{

    for (int i=0;i<2;i++)

    {

//using class member function pointer must have a call of “& gt; *” or “. *”

        (this->*add[i])();

    }

}

 

void Test::Display()

{

   cout<<“The res is:”<<res<<endl;

}

 

int main()

{

   Test * test=new Test();

   test->DoAddAction();

   test->Display();

   delete test;

   return 0;

}

4、 Summary

The above methods illustrate the method of using function pointer array in C and C + + classes. It is obvious that using function pointer array can call functions more conveniently, make the code concise and beautiful, and provide a level of code quality.

In the future program development process, we encounter similar problems. When we can use the function pointer array, we can try to only use the function pointer array to make the development easier and more fun.

Python uses CX_ Oracle batch insert error report ora-01036 error solution

Recently, in the process of using Python to write data import program, CX is used_ When the Oracle database was imported into Oracle database, there was an error of “ora-01036: illegal variable name/number”. After querying the data and trying, the problem was solved.

The Error statement is:

sql = ‘insert into \”mytable_ a\” values(%s,%s,%s)’

cursor.executemany (sql, data)

As a result, the error “ora-01036: illegal variable name/number” appears.

resolvent:

Change the place holder of parameter transfer to “: 1,: 2,: 3”,

The modified statement is as follows:

sql = ‘insert into \”mytable_ a\” values(:1, :2, :3)’

cursor.executemany (sql, data)

Execute again and solve the problem.

The solution to frequently pop up “cannot find a valid baseurl for repo” error prompt box in CentOS 6.7

The situation is: CentOS 6.7 server cannot connect to the external network normally, and can only be used in the internal network. The “cannot find a valid baseurl for repo” error box pops up frequently. Here’s a screenshot:

As the system is running normally, it does not need to be updated. Therefore, by adjusting the system settings and setting the system to “never check for updates” and “never update”, this error box will not appear in the system. As shown in the figure below:

Oracle quick replacement undo table space method

Undo table space is not enough. There are two ways to deal with it

1. Expand the table space size;

2. Create a new undo table space and delete the original one.

1、 Preliminary operation

Confirm undo table space name

select name from v$tablespace; 

Check the occupancy of undo table space and the storage location of data files;

select file_ name,bytes/1024/1024 from dba_ data_ files where tablespace_ name like ‘UNDOTBS1’; 

2、 Expand undo table space

alter   database  UNDOTBS1 datafile   ‘/opt/oracle/oradata/inms/undotbs02.dbf’   resize   4000M; 

3、 Create a new undo table space and delete the original one

1. Create a new undo table space and set the automatic extension parameters;

create undo tablespace undotbs2 datafile ‘/oradata/oradata/ddptest/UNDOTBS1.dbf’ size    2 1000m reuse autoextend on next 800m maxsize unlimited; 

2. Change the SPFILE configuration file dynamically;

alter system set undo_ tablespace=undotbs2 scope=both; 

3. Delete the original undo table space;

drop tablespace undotbs1 including contents; 

4. Confirm whether the deletion is successful;

select name from v$tablespace; 

5. Determine $Oracle_ HOME/dbs/ spfileoinms.ora Whether the content has changed:

$more spfileoinms.ora  

*.undo_ management=’AUTO’

*.undo_ retention=10800

*.undo_ tablespace=’UNDOTBS2′ 

If there is no change, execute the following statement:

SQL> create pfile from spfile; 

File created. 

6. Delete the data file of the original undo table space, and the file name is the result of the step.  

#rm $ORACLE_ BASE/oradata/$ORACLE_ SID/undotbs01.dbf

4、 Conclusion

According to the actual situation, expanding undo table space can only support for a period of time. After running for a period of time, the undo table space data file will eventually reach the upper limit. Therefore, the second scheme is adopted. You can use the script to replace the undotbs1 and undotbs2 table spaces alternately, which can quickly solve the problem.

(1) Script 1: replace the undotbs2 table space with undotbs1

create undo tablespace undotbs1 datafile ‘/u01/oracle/oradata/orcl/UNDOTBS1.dbf’ size 512m reuse autoextend on next 512m maxsize unlimited;

 

alter system set undo_ tablespace=undotbs1 scope=both;

 

drop tablespace undotbs2 including contents;

 

rm ‘/u01/oracle/oradata/orcl/UNDOTBS2.dbf’

(2) Script 2: replace the undotbs1 table space with undotbs2

create undo tablespace undotbs2 datafile ‘/u01/oracle/oradata/orcl/UNDOTBS2.dbf’ size 512m reuse autoextend on next 512m maxsize unlimited;

 

alter system set undo_ tablespace=undotbs2 scope=both;

 

drop tablespace undotbs1 including contents;

 

rm ‘/u01/oracle/oradata/orcl/UNDOTBS1.dbf’

 

 

Oracle data file space release

When the data of Oracle database takes up a large space, and the data stored in it does not take up such a large space, the reason may be that the user has deleted some data, but the size of the data file will not automatically shrink. At this time, if you want to reduce the size of the data file, you can use the following methods.

1、 Use the following statement to query data files that can free up space:

select a.file#,

a.name,

a.bytes/1024/1024 CurrentMB,

ceil(HWM * a.block_ size)/1024/1024 ResizeTo,

(a.bytes – HWM * a.block_ size)/1024/1024 ReleaseMB,

‘alter database datafile ”’ || a.name || ”’ resize ‘ ||

ceil(HWM * a.block_ size)/1024/1024 || ‘M;’ ResizeCmd

from v$datafile a,

(SELECT file_ id, MAX(block_ id + blocks – 1) HWM

FROM DBA_ EXTENTS

GROUP BY file_ id) b

where a.file# = b.file_ id(+)

And (a.bytes – HWM * a.block_ size) >0

and rownum < 10

View the data file that belongs to the system table space, and reset it.

2、 Find out the data file that needs to be reset, and execute the reset statement

An error is reported because the reset data file size needs to be set to an integer.

Adjust the size of resize to 16GB, 16384mb;

3、 View free disk space

The size of the system file is reduced to 16GB, the remaining space of the root disk is greatly increased to 19.6gb, and the utilization rate is reduced to 78%.

A solution to the problem that the number of nodes does not increase and the name of nodes is unstable after adding nodes dynamically in Hadoop cluster

Problem phenomenon

At present, there are three Hadoop clusters with 01, 02 and 03 nodes, among which 01 is the master node and 02 and 03 are the slave nodes. After dynamically adding 04 slave nodes, the number of nodes displayed in Hadoop web interface does not increase. Further observation shows that the contents of slave nodes in the node list are sometimes 02 and 04 nodes, and sometimes 02 and 03 nodes, which is very strange.

 

Analyze the reasons

Find the current/version file in the dataDir directory, and the datanodeuuid values in the 03 and 04 servers are exactly the same. It can be inferred that the master node treats 03 and 04 as the same server. The reason is that the 03 server has been started before, and the datanodeuuid has been recorded in the generated version. When the virtual machine is cloned, all the information is the same as the 03 server.

 

Solution

Considering that if it is not a clone but a direct installation, the dataDir and TMPDIR directories of the 04 server are blank, so stop the datanode and nodemanager services of the 04 server, delete all the files in the dataDir and TMPDIR directories, restart the datanode and nodemanager services, and observe again that the contents of the Hadoop cluster display three datanodes 02, 03 and 04, which are similar to the The expectation is consistent and the problem is solved.

matters needing attention

When adding new nodes by copying or cloning virtual machines, the following operations need to be done:

1. Modify the host name and IP address, restart the new node, and copy the/etc/hosts file to other nodes in the cluster (if using the local DNS server, this step can be omitted, just add the modified node to the domain name resolution record in the DNS server);

2. The new node needs to re run SSH keygen – t RSA to generate the public key and add it to authorized_ And copy it to other nodes in the cluster.

reference material:

1. Hadoop datanode starts normally, but there is no node in live nodes

https://blog.csdn.net/wk51920/article/details/51729460

2. Hadoop 2.7 dynamically adds and deletes nodes
in this paper

https://blog.csdn.net/Mark_ LQ/article/details/53393081

Method of canceling anydesk startup under Windows

Anydesk, a remote connection tool, is not used frequently after installation. It starts automatically every time it is turned on. It takes up resources. Hanging it in the windows tray is very eye-catching.

The solution is as follows:

In the start folder of the start menu, find anydesk, right-click and select Delete.

complete

Linux learning experience sharing

1. What’s the use of learning Linux?

Learning Linux well will let you break the limitation of windows, come and go freely in the open source world, there are a lot of free software for you to use, especially the students of computer department,.
If you only use Linux as the only tool to make a living, you can choose the direction mainly in the operation and maintenance, system level software development and other fields. Linux occupies the vast majority of the server market, such as the Internet industry, front-end web development, back-end web servers, databases, storage devices are basically running on Linux, so you have to fight with Linux to do software development Although I think Linux brings you a different world view. There is no good or bad technology, the key is to see how you understand it.

2. I think there are many English words in Linux. Is it difficult to learn them?

Many people may think that there are many English words and documents in Linux. Is it difficult for us to learn them, but these commands are just abbreviations of English words, such as LS – list, CD – change directory, PWD – print working directory, CP – copy, MV – move, RM – remove these commands are abbreviations of English words, as long as you understand the meaning (understand), this shoe command will be very simple.
Therefore, don’t be afraid of English. English, as the most widely circulated language in the world, always has its value. It is also necessary to study and further study. Why not learn English together while learning Linux?If you have such an idea, then I’m sure you can learn Linux well.

3. I want to learn Linux, but I’m too busy with my work. I can learn less every day, and then Bala

Linux is a skill that makes a lot of things. In fact, it doesn’t require you to spend a lot of time learning it, but requires you to keep on and accumulate it. So, for office workers, it is the key to be good at using fragmented time. As long as you take out half an hour every day and persist in learning for a year, there will be a breakthrough!
Finally, there is the saying: “if you want to learn, nothing is an excuse. If you don’t want to learn, everything is an excuse.”

4. Some people say that “learning Linux is going in laughing and coming out crying”. Is that right?

Those who say that everything (skills) is easy to get started and difficult to learn later are all excuses for not learning well. Linux is just a basic computer skill. It has no requirements for learners’ background, knowledge structure and age. As long as they make unremitting progress, there is nothing they can’t learn. Of course, in learning there will always be bottlenecks, this time we need to self-regulation, adhere to. There are a lot of things to remember in learning Linux. If you are too lazy to recite, study and understand the command options of Linux, you will find it difficult to learn. Or that sentence, down-to-earth, there will always be harvest.

5. My qualifications are average and I don’t have any foundation. Generally, I have to study Linux in non working hours. How long can I pass RHCE?

It varies from person to person how long they have passed the certification. According to past experience, most people spend 1 or 2 hours a day studying hard for 2 to 4 months, so they should be able to pass the RHCE. I personally don’t agree with the method of storming RHCE half a month, because the certificate is secondary to learning Linux, and the main thing is to improve my working ability. Certification like this can be used as a phased goal for you to learn Linux, but it is not the main purpose of your study.

6. I want to teach myself Linux. What’s a good textbook to recommend.
When it comes to teaching materials, there are quite a lot of Linux teaching materials on the market. If you really want to recommend them, you can recommend many books. Next, I mainly recommend a book that I think is more suitable for beginners: This is how to learn Linux written by Liu Trent.
This book was started in 2015, and is still in the process of being written. It is a relatively new book. Compared with the Linux books on the market a few years ago, it is more suitable for the current environment, so as to improve the efficiency Redhat7 is a teaching system. Compared with other books, you can learn a lot of useful things. For a classmate with zero basis in Linux, the knowledge of this book is certainly enough, and what you have learned can be used in work It’s OK in the RHCE exam. The main points and difficulties of Linux system management are all covered in it. It’s easy to learn in order, and you don’t have to worry about the fracture of the knowledge layer.

7. I want to learn Linux, but I have no patience. How can I persist?

I don’t think this is a case. Many beginners will ask this question. In fact, what I want to say is that patience should be cultivated slowly. One of the most important things in learning Linux is interest. Generally speaking, people who want to learn Linux are interested in Linux or have what they want. In addition, a good learning environment and a good example will naturally lead to patience If you keep learning, you will be in touch with Linux every day. You can turn books whenever you have time. Therefore, interest is the best teacher. Although this sentence is vulgar, it’s quite right.

8. I want to learn Linux. Can I completely study by myself without taking any training courses?

You can download a free copy of “this is how to learn Linux” http://www.linuxprobe.com/book Take a look at it by self-study, but I don’t recommend not to apply for classes at all. In fact, Linux is a simple thing: you will use it after you learn it. For example, when you take exams and use them in your work, you will be short of learning by yourself at the beginning, which will directly affect your study time and greatly increase the cost of study. Therefore, when you first get started, you still need a Linux teacher to guide you to get started;
when you get started, you need a Linux teacher to help you get started Secondly, in fact, there are certain rules in learning Linux. We can call it the knowledge architecture of Linux. If you just look at the content in the textbook without the teacher’s summary and explanation, it’s easy to forget after learning. If you follow the teacher to learn Linux at the beginning, you can establish the correct knowledge architecture of Linux. On the contrary, if you don’t set up a good structure at the beginning, even if you teach yourself to the intermediate level, you may find it difficult to learn in the face of some unfamiliar problems, and your interest in learning will weaken, leading to giving up in the end. In addition, if it’s class learning, you can find like-minded partners to study together in a class, which is also a kind of promotion for your own learning.

Generally speaking, they can learn by themselves, but they are difficult and easy to take detours. Knowledge on the Internet is scattered, and there are mistakes and loopholes. If there is a teacher’s advice, on the one hand, it can help you to summarize in time, on the other hand, it can also play a role in urging you to learn.