Tag Archives: apache

Apache was unable to start solving the requested operation has failed

How did “people you might know” find you on social software>>>

Httpd.conf configuration error. If Apache’s configuration file httpd.conf is wrong, starting it in windows will prompt the requested operation has failed. This is a depressing thing, because it takes half a day to check the error. In fact, you can start Apache in command line mode with parameters. Apache will prompt you which sentence is wrong, and then you can solve it

Check for errors:

Enter CMD and then the Apache installation directory (specifically your own installation directory) bin > httpd.exe -w -n “Apache2” -k start

Apache 2 is its own service name

[Solved] Apache Warning: DocumentRoot must be a directory

After changing the DocumentRoot to /home/test/www it prompts.
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory

[root@sl ~]# getsebool -a |grep httpd_enable_homedirs
httpd_enable_homedirs –> off
It turns out that SELinux does not allow home directories to be used as web directories

Modify SELinux settings
[root@sl ~]# setsebool httpd_enable_homedirs on

After restarting apache, everything is fine
[root@sl ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

[note] solve the problem of error during websocket Handshake: Net:: err when using workerman and Apache to create WSS service_ RESPONSE_ HEADER…

The error during websocket Handshake: Net:: err often appears in WSS services generated by Apache proxy_ RESPONSE_ HEADERS_ Truncated , but you can connect successfully by refreshing the page several times

No way was found in the official documents, and finally in the https://github.com/ratchetphp/Ratchet/issues/645 A solution has been found

This is not a worker’s warehouse, but the solution is universal

I could say that when some client disconnects without default websockt close protocol, ratchet keeps the connection “open”, but when a new user connects then ratchet reuses somehow the last “open”(closed) connection… Because the new client uses a old “active” connection, when it sends the HTTP handshake, ratchet complains because it isn’t the default message frame.

It’s the reuse of connections that causes this problem

Modify the configuration file of Apache conf.d/ssl.conf

Add a configuration disableeuse = on in the reverse proxy, and the problem is solved

ProxyPass /wss ws://127.0.0.1:8282/wss disablereuse=On
ProxyPassReverse /wss ws://127.0.0.1:8282/wss

Reference Links

https://github.com/ratchetphp/Ratchet/issues/645

http://doc.workerman.net/faq/secure-websocket-server.html

[Solved] Apache Startup Error: httpd: apr_sockaddr_info_get() failed for

When executing apachectl start, the following error will be prompted:

httpd: apr_ sockaddr_ info_ get() failed for shiwei
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

reason: the problem should be that servername is not set in/etc/httpd/conf/httpd.conf. So Apache will replace it with the name of the host. First, it will find out if there is a definition of the host in/etc/hosts

solutions:

(1) you can set the servername in httpd.conf file as follows: servername localhost:80

(2) fill in your own host name Bogon in/etc/hosts, as follows: 127.0.0.1 Shiwei (user name)

NoClassDefFoundError: Failed resolution of: Lorg/apache/http/conn/scheme/SchemeRegistry;

When the Android project is running on Android 9.0, it will flash back and report the following error

Java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/conn/scheme/SchemeRegistry;

terms of settlement:

Add the

<uses-library android:name="org.apache.http.legacy" android:required="false" />

Contribution by aizier River

The solution of losing vcruntime140.dll in the latest Apache installation

Php7 has been released for some time. It is said that there are some good improvements. The official also said that the speed is twice as fast as php5.6, and the performance has been greatly improved. In addition, the problem of migration from PHP5. X to php7 has also been released. Therefore, after the migration of PHP website in the future, the performance of the website can be greatly improved. Therefore, in order to try, I have also installed php7.0 locally on my computer.

The local installation of the computer is Wamp integration package, PHP is still in version 5.2; I went directly to Wamp’s official website to download the latest Wamp integration package, but when I installed httpd, I was prompted that there was a lack of vcruntime140.dll. I tried many ways to find a solution.

Visual C + + redistributable 2015 is required to run the latest version of Apache and php7 under windows, while the previous version does not need to be that high. This component is a necessary component to run the C + + application established by visual studio 2015. One time installation can solve the environmental problems. Go to the Microsoft official website to download the installation program, install it again, and restart the computer.

Download address: https://www.microsoft.com/en-US/download/details.aspx?id=48145

You can install both 64 bit and 32-bit.

Sharing experience is to make you less detours – Hua Weijun.

On the way of growing into a technology bull, we go together!

Finally, don’t believe this method recommended by Baidu. It’s useless and a waste of time!!!

Blog: Zhao Huawei’s we media blog | cion personal homepage | php programmer | website development | website outsourcing

[How to Solve] log4j: WARN Please initialize the log4j system properly

Using log4j, the alarms are as follows.

log4j: WARN No appenders could be found for logger

log4j: WARN Please initialize the log4j system properly.

maven project, build the source folder “/src/test/resources” under the project.

Create a file log4j.properties under the above path.

Copy the following content to log4j.properties

# For Testing Guys
# Set root logger level to error
log4j.rootLogger=INFO, Console

###### Console appender definition #######

# All outputs currently set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{3}] %m%n
#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

###### File appender definition #######
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=spring.log
log4j.appender.File.Append=false
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
log4j.rootLogger=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=firestorm.log

log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.logger.com.codefutures=DEBUG

pom.xmlweb.xml is missing and is set to true

1 web.xml is missing and <failOnMissingWebXml&> is set to true

The reason is that there is a lack of information in the project web.xml , and & lt; failonmissingwebxml &> is set to true

Solution: A. if the project needs web.xml To copy one web.xml Just add it to the project.

You can also use eclipse to generate: there are two ways

1. Right click on the project — &> Java EE tools — &> generate deployment descriptor stub. Then the system will display it in Src/main/webapp/Web_ Add INF file to create web.xml Documents. Error resolution!

2. Right click Project – &> properties – &> project faces to remove the check of dynamic web module, click apply, and then check it again, click the further configuration availber that appears below, and then select the generated directory to generate web.xml

        

        

B. if the project does not require web.xml , you need to pom.xml There are two ways to configure & lt; failonmissingwebxml &> to false

      1.

<build&>
    <plugins&>
        <plugin&>
            <groupId&>org.apache.maven.plugins</groupId&>
            <artifactId&>maven-war-plugin</artifactId&>
            <version&>2.6</version&>
            <configuration&>
                <failOnMissingWebXml&>false</failOnMissingWebXml&>
            </configuration&>
        </plugin&>
    </plugins&>
</build&>

      2.

<properties&>
    <failOnMissingWebXml&>false</failOnMissingWebXml&>
</properties&>

Yarn configures multi queue capacity scheduler

First configure the hadoop/etc/capacity-scheduler.xml file

<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
<configuration>

   <!-- The maximum number of jobs the capacity scheduler can hold-->
  <property&>
    <name&>yarn.scheduler.capacity.maximum-applications</name>
    <value&>10000</value>
    <description&>
      Maximum number of applications that can be pending and running.
    </description>
  </property>

  <!-- How much of the total resources of the queue can be occupied by the MRAppMaster process started in the current queue
        This parameter allows you to limit the number of submitted Jobs in the queue
  --&>
  <property&>
    <name&>yarn.scheduler.capacity.maximum-am-resource-percent</name&>
    <value&>0.1</value&>
    <description&>
      Maximum percent of resources in the cluster which can be used to run 
      application masters i.e. controls number of concurrent running
      applications.
    </description&>
  </property&>

  <!-- What strategy is used to calculate when allocating resources to a Job
  --&>
  <property>
    <name&>yarn.scheduler.capacity.resource-calculator</name>
    <value&>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
    <description>
      The ResourceCalculator implementation to be used to compare 
      Resources in the scheduler.
      The default i.e. DefaultResourceCalculator only uses Memory while
      DominantResourceCalculator uses dominant-resource to compare 
      multi-dimensional resources such as Memory, CPU etc.
    </description&>
  </property>

   <!-- What sub queues are in the root queue, new a, b queues are added----&>
  <property&>
    <name&>yarn.scheduler.capacity.root.queues</name>
    <value&>default,a,b</value>
    <description>
      The queues at the this level (root is the root queue).
    </description>
  </property>

  <!-- Percentage of capacity occupied by the default queue in the root queue
        The capacity of all subqueues must add up to 100
  --&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.capacity</name&>
    <value&>40</value&>
    <description&>Default queue target capacity.</description&>
  </property&>
  
  <property&>
    <name&>yarn.scheduler.capacity.root.a.capacity</name&>
    <value&>30</value&>
    <description&>Default queue target capacity.</description&>
  </property>
  
  <property>
    <name&>yarn.scheduler.capacity.root.b.capacity</name>
    <value&>30</value>
    <description&>Default queue target capacity.</description>
  </property>

    <!-- Limit percentage of users in the queue that can use the resources of this queue
  --&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.user-limit-factor</name&>
    <value&>1</value&>
    <description&>
      Default queue user limit a percentage from 0.0 to 1.0.
    </description&>
  </property&>
  
   <property&>
    <name&>yarn.scheduler.capacity.root.a.user-limit-factor</name&>
    <value&>1</value&>
    <description&>
      Default queue user limit a percentage from 0.0 to 1.0.
    </description&>
  </property&>
  
   <property&>
    <name&>yarn.scheduler.capacity.root.b.user-limit-factor</name&>
    <value&>1</value&>
    <description&>
      Default queue user limit a percentage from 0.0 to 1.0.
    </description&>
  </property&>

  <!-- The maximum value of the percentage of capacity occupied by the default queue in the root queue
  --&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.maximum-capacity</name&>
    <value&>100</value&>
    <description&>
      The maximum capacity of the default queue. 
    </description&>
  </property&>
  
   <property&>
    <name&>yarn.scheduler.capacity.root.a.maximum-capacity</name&>
    <value&>100</value&>
    <description&>
      The maximum capacity of the default queue. 
    </description&>
  </property&>
  
   <property&>
    <name&>yarn.scheduler.capacity.root.b.maximum-capacity</name&>
    <value&>100</value&>
    <description&>
      The maximum capacity of the default queue. 
    </description&>
  </property&>

    <!-- The state of the default queue in the root queue
  --&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.state</name&>
    <value&>RUNNING</value&>
    <description&>
      The state of the default queue. State can be one of RUNNING or STOPPED.
    </description&>
  </property&>
  
    <property&>
    <name&>yarn.scheduler.capacity.root.a.state</name&>
    <value&>RUNNING</value&>
    <description>
      The state of the default queue. State can be one of RUNNING or STOPPED.
    </description&>
  </property&>

  
    <property&>
    <name&>yarn.scheduler.capacity.root.b.state</name&>
    <value&>RUNNING</value&>
    <description&>
      The state of the default queue. State can be one of RUNNING or STOPPED.
    </description&>
  </property&>

  <!-- Restrict users who submit to the default queue, i.e. access rights--&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.acl_submit_applications</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can submit jobs to the default queue.
    </description&>
  </property&>
  
  <property&>
    <name&>yarn.scheduler.capacity.root.a.acl_submit_applications</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can submit jobs to the default queue.
    </description&>
  </property&>
  
  <property&>
    <name&>yarn.scheduler.capacity.root.b.acl_submit_applications</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can submit jobs to the default queue.
    </description&>
  </property&>
<!-- set as admin--&>
  <property&>
    <name&>yarn.scheduler.capacity.root.default.acl_administer_queue</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can administer jobs on the default queue.
    </description&>
  </property&>
  
  <property&>
    <name&>yarn.scheduler.capacity.root.a.acl_administer_queue</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can administer jobs on the default queue.
    </description&>
  </property&>
  
  <property&>
    <name&>yarn.scheduler.capacity.root.b.acl_administer_queue</name&>
    <value&>*</value&>
    <description&>
      The ACL of who can administer jobs on the default queue.
    </description&>
  </property&>

  <property&>
    <name&>yarn.scheduler.capacity.node-locality-delay</name&>
    <value&>40</value&>
    <description&>
      Number of missed scheduling opportunities after which the CapacityScheduler 
      attempts to schedule rack-local containers. 
      Typically this should be set to number of nodes in the cluster, By default is setting 
      approximately number of nodes in one rack which is 40.
    </description&>
  </property&>

  <property&>
    <name&>yarn.scheduler.capacity.queue-mappings</name&>
    <value&></value&>
    <description>
      A list of mappings that will be used to assign jobs to queues
      The syntax for this list is [u|g]:[name]:[queue_name][,next mapping]*
      Typically this list will be used to map users to queues,
      for example, u:%user:%user maps all users to queues with the same name
      as the user.
    </description&>
  </property&>

  <property>
    <name&>yarn.scheduler.capacity.queue-mappings-override.enable</name&>
    <value&>false</value>
    <description>
      If a queue mapping is present, will it override the value specified
      by the user?This can be used by administrators to place jobs in queues
      that are different than the one specified by the user.
      The default is false.
    </description>
  </property>

</configuration>

Use the refresh command after configuration

yarn rmadmin -refreshQueues

Then enter the yarn interface of the cluster, and you can see that the queue becomes three

Then the next step is how to set the job to run in other queues

You know, it’s up to mapred to decide which queue the job runs on- default.xml It’s decided in the document

So you need to change this configuration:

1. If idea is used, it can be used

conf.set (” mapred.job.queue .name”, “a”);

This specifies that the job should be run in the a queue

2. If you run jar package on Linux, you can use

hadoop jar hadoop-mapreduce-examples-2.7.2.jar wordcount -D mapreduce.job.queuename=a/mapjoin/output3

As shown in the figure, the job switches to the a queue

The key technologies in hadoop-3.0.0 configuration yarn.nodemanager.aux -Services item

In the configuration of hadoop-3.0.0-alpha4, the default value of yarn.nodemanager.aux-services is “mapreduce.shuffle”, but if you continue to use this value in hadoop-2.2, the NodeManager will fail to start, and the following error will be reported in logs/yarn-biadmin-nodemanager-hostname.log.

java.lang.IllegalArgumentException: The ServiceName: mapreduce.shuffle set in yarn.nodemanager.aux-services is invalid.The valid service name should only contain a-zA-Z0-9_ and can not start with numbers

at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.AuxServices.serviceInit(AuxServices.java:115)

at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)

at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl.serviceInit(ContainerManagerImpl.java:303)

at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)

at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)

at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:406)

at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)

at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:748)

at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:809)

2017-07-21 03:21:42,946 INFO org.apache.hadoop.yarn.server.nodemanager.NodeManager: SHUTDOWN_MSG:

/************************************************************

SHUTDOWN_MSG: Shutting down NodeManager at slave1/127.0.0.1

************************************************************/

Solution.

Change the value of “mapreduce.shuffle” to “mapreduce_shuffle” in yarn.nodemanager.aux-services.

Note: You need to change it in yarn-site.xml of each node at /usr/hadoop/hadoop-3.0.0-alpha4/etc/hadoop