Author Archives: Robins

Django Use logging Module Cannot Operate the File Error: logging error Permission Error [WinError 32]

Causes:

This problem is only encountered during development, and the configuration is written to setting Py configuration file. We define the log file size. When the log is full, we will encounter this problem, because when running Django with pychart, we enable both processes to initialize setting Py configuration, one is accessed normally, and the other is used to monitor code changes (you will find that Django will rebuild itself every time you modify some code, which is completed by this process). Because it occupies the handle of the file, it fails during archiving

Solution:

Method 1: add the — noreload parameter when starting Django

For example, python manage py runserver 127.0.0.1:8080 –noreload

After adding the — noreload parameter, when the development server is started, the Python code of Django project is modified, and the server will not restart automatically

Method 2:

Expand log files

Modify setting.Py to expand maxbytes

Phoenix Startup Error: Error: ERROR 726 (43M10): Inconsistent namespace mapping properties. Cannot initiate connection as SYSTEM:CATALOG is found but client does not have phoenix.schema.

Phoenix startup error:

Error: ERROR 726 (43M10): Inconsistent namespace mapping properties. Cannot initiate connection as SYSTEM:CATALOG is found but client does not have phoenix.schema.isNamespaceMappingEnabled enabled (state=43M10,code=726)

One more system: catalog table is found in HBase. The error message indicates connection mapping error.

Check the HBase configuration file and find that the following lines can not be used (the culprit)

<property>
  <name>phoenix.schema.isNamespaceMappingEnabled</name>
  <value>true</value>
</property>

<property>
  <name>phoenix.schema.mapSystemTablesToNamespace</name>
  <value>true</value>
</property>

After deleting some configuration information, distribute the file to other machines.

Delete the system: catalog table in HBase (the deletion instructions are as follows)

Restart HBase and Phoenix

appear:

Inconsistent namespace mapping properties. Ensure that config phoenix.schema.isNamespaceMappingEnabled is consistent on client and server. (state=43M10,code=726)

Reason: the HBase configuration file is not synchronized to Phoenix. Continue to repeat the previous steps, delete multiple tables, and modify the Phoenix file.

Restart HBase and Phoenix again

Phoenix will create several new tables, as shown in the figure above. Success.

HBase configuration files are basically hbase-site.xml

[Solved] HDFS Filed to Start namenode Error: Premature EOF from inputStream;Failed to load FSImage file, see error(s) above for more info

I. Description

After starting Hadoop, it was found that the HDFS web interface could not be opened and the 50070 could not be opened, so JPS found that a namenode was missing:

Check the log information and find the following errors:

2022-01-03 23:54:10,993 INFO org.apache.hadoop.hdfs.server.namenode.FSImage: Planning to load image: FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563)
2022-01-03 23:54:10,999 ERROR org.apache.hadoop.hdfs.server.namenode.FSImage: Failed to load image from FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563)
java.io.IOException: Premature EOF from inputStream
    at org.apache.hadoop.io.IOUtils.readFully(IOUtils.java:212)
    at org.apache.hadoop.hdfs.server.namenode.FSImageFormat$LoaderDelegator.load(FSImageFormat.java:222)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:962)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:946)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImageFile(FSImage.java:807)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:738)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772)
2022-01-03 23:54:11,015 INFO org.apache.hadoop.hdfs.server.namenode.FSImage: Planning to load image: FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas2/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563)
2022-01-03 23:54:11,015 ERROR org.apache.hadoop.hdfs.server.namenode.FSImage: Failed to load image from FSImageFile(file=/export/servers/hadoop-3.1.4/hadoopDatas/namenodeDatas2/current/fsimage_0000000000000052563, cpktTxId=0000000000000052563)
java.io.IOException: Premature EOF from inputStream
    at org.apache.hadoop.io.IOUtils.readFully(IOUtils.java:212)
    at org.apache.hadoop.hdfs.server.namenode.FSImageFormat$LoaderDelegator.load(FSImageFormat.java:222)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:962)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:946)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImageFile(FSImage.java:807)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:738)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772)
2022-01-03 23:54:11,021 WARN org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Encountered exception loading fsimage
java.io.IOException: Failed to load FSImage file, see error(s) above for more info.
    at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:752)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:336)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:1132)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:747)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:652)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:723)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:966)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:939)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1705)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1772)

II. Solution

According to the error information, it is found that there is an error in reading the file, followed by the file path name. Here, I make an error in reading two files, and then delete the file with the error in the log (it can be backed up in advance)

I have deleted (.MD5 can not be deleted). After restarting HDFS, you can find that namenode has started

Re-enter the HDFS page

[Solved] IDEA Compile Error: java: Compilation failed: internal java compiler error

java: Compilation failed: internal java compiler error

1. view the project jdk(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings ->Project

2. view the project jdk(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings -> Modules -> (Name of the project to be modified) -> Sources ->

3. view Java configuration in idea
File ->Setting ->Build,Execution,Deployment -> Compiler -> Java Compiler

4.  Clear IDEA cache, restart IDEA
File -> Invalidate Caches/Restart

5. Reload All Maven Projects

[Solved] Idea Error: Error running ‘Application‘: Command line is too long

When a new project is started in idea, it sometimes reports an error running ‘application’: command line is too long Short command line for application or aalso for spring boot default configuration, the error message is as follows:

Solution:

First find the idea/workspace.xml file inside the project, then find the <component name=”PropertiesComponent”></component > tag, which looks like this

Then add a line in the component tag <property name=”dynamic.classpath” value=”true” />, which would look like this

In this way, no error will be reported when starting the project.

[Solved] MySQL Workbench 8.0 Error: SSL connection error: SSL is required but the server doesn‘t support it

When MySQL workbench 8.0 connects to the database, it prompts:

The solution is as follows.

1、Create a connection in workbench first, close workbench
2. Open C:\Users[username]\AppData\Roaming\MySQL\Workbench\connections.xml, find the information about this connection, then change <value type=”int” key=”useSSL”>2</value> to <value type=”int” key=”useSSL”>1</value
3. Reopen workbench and double click on the connection information to connect to the database

 

MySQL Workbench 8.0 has ssl connection turned on by default, change the value to 1 to turn off SSL connection

[Solved] error: Can’t connect to MySQL server on ‘localhost:3306’ (10061)

When you start MySQL with the command, the prompt is: can’t connect to MySQL server on ‘localhost: 3306’ (10061). The solution steps are as follows:

1. Start CMD as an administrator and enter the command to start the MySQL server: Net start mysql

2. Enter the login account and password of Mysql to start successfully: MySQL – U root – P

redis Connect Error: InvalidDataAccessApiUsageException: MISCONF Redis is configured to save RDB snapshots

Application startup connection exception.

org.springframework.dao.InvalidDataAccessApiUsageException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.. channel: [id: 0x2f971a28, L:/127.0.0.1:57418 - R:127.0.0.1/127.0.0.1:6379] command: (BRPOP), params: [[114, 101, 116, 114, 121, 95, 109, 115, 103], 216000]; 

The problem is that persistence is abnormal. I searched a lot on the Internet.

By modifying redis The stop writes on bgsave error option in the conf configuration can be solved

stop-writes-on-bgsave-error no