Author Archives: Robins

[Solved] Hbase Startup Normally but Execute Error: Server is not running yet

Error reporting information

hbase:001:0> list
TABLE

ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet

There are two solutions
the first is because of the Hadoop mode
the cluster is not shut down normally, and Hadoop enters the installation mode, resulting in external inaccessibility. You can access it by turning off the security mode.

Start Hadoop first and then

HDFS dfsadmin – safemode get # view security mode
HDFS dfsadmin – safemode leave # turn off security mode
you can also view it through the Hadoop web page

Then restart HBase to access the client. The general problem can be solved.

Method 2: jar package conflict
slf4j-log4j12-1.7.25.Jar exists in both Hadoop and HBase and is started at the same time. The service cannot be accessed due to occupation

Solution: delete slf4j-log4j12-1.7.25.jar in HBase. this file is in HBase/lib/client-facing-hirdparty/.

Then remove the export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP=”true” comment from hbase-env.sh. You can remove the quotes, or just insert them if the configuration file does not have this information. The default value is false, which means that Hadoop’s libs are included.

Then restart HBase. If stop-HBase.sh is invalid. You can kill the process with the kill command

It is recommended to use one and two closing sequences at the same time. Close HBase first and then Hadoop

Linux Configure Redis make Commands Error [Solved]

An error is reported in the make command for configuring redis on Linux

1. After decompressing the redis file, execute the make command and an error is reported:

Solution:

The reason is that the GCC version of Linux system is too low, and the GCC installed by Yum is 4.8.5.GCC needs to be upgraded

Command line input:

yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile
gcc -v

Decompress the redis file again

Execute the make command, as shown in the following figure, OK!

[Solved] Error: A is only ever to be used as the child of element, never rendereddirectly.Please wrap your in a .

There is a problem with the react routing version. Check the package JSON file, check the version of react router dom. If it is version 6, this problem will occur.

In the V6 version of react router, route has changed its usage.

  import React from "react"
  import Home from "./pages/home"
  import Mine from "./pages/mine"

  import {BrowserRouter, Routes, Route} from 'react-router-dom'

  function App() {
      return (
        <div className="App">
          <BrowserRouter>
            <Routes>
              <Route path="/home"  element={<Home/>}></Route>
              <Route path="/mine" element={<Mine/>}></Route>
            </Routes>
          </BrowserRouter>
        </div>
      )  
  }
  export default App;

In the V5 version,

  import React from "react"
  import Home from "./pages/home"
  import Mine from "./pages/mine"

  import {BrowserRouter, Routes, Route} from 'react-router-dom'

  function App() {
      return (
        <div className="App">
          <BrowserRouter>
              <Route path="/home"  component={Home}></Route>
              <Route path="/mine" component={Mine}></Route>
          </BrowserRouter>
        </div>
      )
      
  }
  export default App;

[Solved] appium Error: A new session could not be created

Error reported in appium:

selenium. common. exceptions. SessionNotCreatedException: Message: A new session could not be created. (Original error: Command failed: C:\\WINDOWS\\system32\\cmd.exe /s /c “D:\\tools\\Android\\android-sdk\\platform-tools\\adb.exe -s 127.0.0.1:62001 shell “ps ‘uiautomator'””

Execute the command in the error message in CMD:

The error message reported is: bad PID ‘uiautomator’

Solution:

1. Find ADB.JS file In the appium installation directory. directory:\appium\node_modules\appium\node_Modules\appium-ADB\lib
2. Open ADB.JS, find the following code:

ADB.prototype.shell = function (cmd, cb) {
  if (cmd.indexOf('"') === -1) {
    cmd = '"' + cmd + '"';
  }
  var execCmd = 'shell ' + cmd;
  this.exec(execCmd, cb);
};

3. Add the following code below the above code

//add
ADB.prototype.shell_grep = function (cmd, grep, cb){
    if (cmd.indexOf('"') == -1){
        cmd = '"' + cmd + '"';
    }
    var execCmd = 'shell' + cmd + '| grep ' + grep;
    this.exec(execCmd, cb);
};

4. Find the following code:

ADB.prototype.getPIDsByName = function (name, cb) {
  logger.debug("Getting all processes with '" + name + "'");
  this.shell("ps '" + name + "'", function (err, stdout) {
    if (err) return cb(err);
    stdout = stdout.trim();
    var procs = [];
    var outlines = stdout.split("\n");
    _.each(outlines, function (outline) {
      if (outline.indexOf(name) !== -1) {
        procs.push(outline);
      }
    });
    if (procs.length < 1) {
      logger.debug("No matching processes found");
      return cb(null, []);
    }
    var pids = [];
    _.each(procs, function (proc) {
      var match = /[^\t ]+[\t ]+([0-9]+)/.exec(proc);
      if (match) {
        pids.push(parseInt(match[1], 10));
      }
    });
    if (pids.length !== procs.length) {
      var msg = "Could not extract PIDs from ps output. PIDS: " +
                JSON.stringify(pids) + ", Procs: " + JSON.stringify(procs);
      return cb(new Error(msg));
    }
    cb(null, pids);
  });
};

4. Comment out the above code, start with/* and end with */comment

5. Replace with the following code

//replace
ADB.prototype.getPIDsByName = function (name, cb) {
  logger.debug("Getting all processes with '" + name + "'");
  this.shell_grep("ps", name, function (err, stdout) {
    if (err) {
      logger.debug("No matching processes found");
      return cb(null, []);
    }
    var pids = [];
    _.each(procs, function (proc) {
    var match = /[^\t ]+[\t ]+([0-9]+)/.exec(proc);
    if (match) {
    pids.push(parseInt(match[1], 10));
    }
    });
    if (pids.length !== procs.length) {
      var msg = "Could not extract PIDs from ps output. PIDS: " +
      JSON.stringify(pids) + ", Procs: " + JSON.stringify(procs);
      return cb(new Error(msg));
    }
    cb(null, pids);
  });
};

6. Restart appium

[Solved] reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

Jetty service used by backend

report errors

2022-01-11 17:20:24.362  WARN 4784 --- [ctor-http-nio-3] r.netty.http.client.HttpClientConnect    : [id: 0x3eaaea4e, L:0.0.0.0/0.0.0.0:58790 ! R:localhost/127.0.0.1:8090] The connection observed an error

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

2022-01-11 17:20:24.362 ERROR 4784 --- [ctor-http-nio-3] a.w.r.e.AbstractErrorWebExceptionHandler : [31e53fe7-21772]  500 Server Error for HTTP GET "/status"

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ HTTP GET "/status" [ExceptionHandlingWebHandler]
Stack trace:

explain

Call the back-end service jetty through the gateway service spring cloud gateway and report an exception

reason

The back-end service automatically disconnects after the socket timeout, and the gateway service takes the disconnected connection from the httpclient connection pool to request

Reappearance

Spring Cloud GateWay : 2.2.1.RELEASE

Spring Cloud : Hoxton.SR1

Spring Boot : 2.3.4.RELEASE

Server uses springboot emulation

GateWay

spring:
  application:
    name: gateway
  cloud:
    gateway:
      httpclient:
        pool:
          max-idle-time: 60000ms
      routes:
      - id: dev
        uri: ${service-url.dev-service}/status
        predicates:
        - Path=/status
service-url:
  dev-service: http://localhost:8080
server:
  port: 8098

Server

spring:
  application:
    name: dev
server:
  tomcat:
    connection-timeout: 100ms

Jmeter

Threads:300
period seconds:5
Loop Count:20

explain:

Max idle time: maximum idle connection time

Connection timeout: timeout of socket read().

Gateway’s max idle time: the connection is released after 60000ms, and the connection timeout of the server is disconnected after 100ms. At this time, gateway will take the disconnected connection request from the connection pool, resulting in an error

 

Solution:

Because the server is the provider and the gateway is the consumer, try to ensure that the consumer disconnects before the provider, and the time for setting Max idle time is not greater than connection timeout

Jetty services

Jetty modified jetty.http.Idletimeout or http.timeout. Default 30000ms

 

[Solved] SpringBoot Access Redis Error: java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime

Complete error reporting information:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed;
nested exception is java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime(Ljava/time/Duration;)V] with root cause

java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime(Ljava/time/Duration;)V

Reason 1:

Other components in Maven depend on the old version of jedis and need to be excluded

Solution to cause 1:

In <dependency></dependency> Add and exclude the dependency of old jedis

<exclusions>
    <exclusion>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
    </exclusion>
</exclusions>

Reload Maven’s dependent components and run them again.

Reason 2:

Jedispoolconfig and jedissentinelpool use Apache Commons-pool2 package for Commons

Although no error will be reported when compiling the code, the runtime will prompt that the package cannot be found. (suspected to be the reason for using reflection)

Solution to cause 2:

In POM XML <dependencies></dependencies> Add the following configuration to the:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-pool2</artifactId>
    <version>2.11.1</version>
</dependency>

Reload Maven’s dependent components and run them again.

[Solved] Linux Start solr Error: Your Max Processes Limit is currently 31202. It should be set to 65000 to avoid operational disruption.

Execute the startup specification after entering the bin directory

./solr start

report errors

What should I do?

View system limits

 ulimit -a

Now you need to change the system limit and log in to the root account

Locate the file/etc/security/limits At the end of conf, add the following two lines [added by default in some systems]

* soft nofile 65535
* hard nofile 65535

Then locate the file/etc/security/limits d/20-nproc.conf

Change 4096 to 65535

Login again and take effect after modification

Matplotlib.pyplot Plug-in Chinses Font Error: RuntimeWarning: Glyph 26376 missing from current font

Using Matplotlib When drawing with pyplot, add a Chinese font, which indicates that the font cannot be found. The solution is as follows

1. Download simhei Ttf (BOLD) font file;

2. Copy to D:\Python38\Lib\site-packages\matplotlib\mpl-data\fonts\ttf (My Catalog)

3. Modify the file D:\Python38\Lib\site-packages\matplotlib\mpl-data\matplotlibrc

 font.family         : sans-serif   
 # remove the previous #     
 font.sans-serif     : SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif  
 # remove the previous #, and add SimHei after the colon
 axes.unicode_minus  : False
 # remove the previous #, and change the True to False

4. Add code

# set the font
plt.rcParams['font.sans-serif'] = ['KaiTi', 'SimHei', 'FangSong'] 
plt.rcParams['font.size'] = 12 
plt.rcParams['axes.unicode_minus'] = False

5. Delete the buffer directory of Matplotlib
in the python environment of the terminal, enter the following command to view the font cache path of Matplotlib:

import matplotlib
matplotlib.get_cachedir()

Then exit the python environment and delete the cache directory on the terminal using the RM - RF + path

6. The font configuration is completed and can be used normally

K8s binary deployment start API-server error: Error: unknown flag: –etcdservers

 systemctl status kube-apiserver  failed to startup

check the error in the log

cat /var/log/messages|grep kube-apiserver|grep -i error

Jan 11 11:22:44 m1 kube-apiserver: --logtostderr                      log to standard error instead of files
Jan 11 11:25:16 m1 kube-apiserver: Error: unknown flag: --etcdservers
Jan 11 11:25:16 m1 kube-apiserver: --alsologtostderr                  log to standard error as well as files
Jan 11 11:25:16 m1 kube-apiserver: --logtostderr    

【Error: unknown flag: --etcdservers】 that I wrote the wrong string.

I copied the pdf content of the textbook; --etcdservers copied out and pasted into notepad, and found that the [-] symbol was missing.

chrome browser copy pdf - line feed content to notepad++ less [-] symbol

so pay attention to the differences in copying content.

Successful startup after correction