when i reload apache I get this error - apache2

I have this error when I get status of service apache2.
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since ج 2018-02-23 15:31:18 WET; 1min 23s ago
Docs: man:systemd-sysv-generator(8)
Process: 4329 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS
Process: 4310 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCE

Check if all folders for apache are created. Like "logs" and other. Same for your sites check if you specified folder for logs and if it is actually created.

Related

render() times out after 60 seconds with 503 - Service Temporarily Unavailable

This code times out in a CakePHP 4.3.3 template with a
503 - Service Temporarily Unavailable.
In a none-CakePHP script it works [it shows after 6 minutes DONE].
ini_set("max_execution_time", "0");
sleep(360);
die("DONE");
The template is called like this:
$this->render("/General/index", "Study");
I didn't find anything regarding a max execution time for rendering but as I can clearly reduce it to the above MCVE, it must be something CakePHP relevant because in CakePHP it stops after 60 seconds, in a PHP file timeout.php, placed directly in the webroot directory, it works.
What am I doing wrong, what I haven't set up properly?
I think, I should present the log entry:
[proxy_fcgi:error] [pid 1813:tid 140621247407872] (70007)The timeout
specified has expired: [client XXXX:56968] AH01075: Error dispatching
request to :
The server is running under Apache/nginx.
I don't understand why a stand-alone script on the same server and same domain works, but under CakePHP it ran into the timeout - with the exactly identical 3 lines of code.
The solution was - after investigating the log error - the Apache2 Timeout.
Additionally, I had to set the nginx timeout settings:
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
fastcgi_send_timeout 3600s;
fastcgi_read_timeout 3600s;
After applying the above settings for Apache and nginx it works also under CakePHP.

mongod.service active : failed (failed to start mongodb server)

I just started learning mongodb everything was going well until I tried stoping the server using sudo systemctl stop mongod and restarting it usingsudo systemctl start mongod.
now its showing:-
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-01-16 12:39:04 IST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 357998 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 357998 (code=exited, status=1/FAILURE)
Jan 16 12:39:04 prabal-computer systemd[1]: Started MongoDB Database Server.
Jan 16 12:39:04 prabal-computer mongod[357998]: {"t":{"$date":"2021-01-16T07:09:04.669Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"main">
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Failed with result 'exit-code'.
lines 1-11/11 (END)
whenever I am trying to start and see the status using sudo systemctl status mongod,this error appears.
note: I have already tried reinstalling the mongodb

Zabbix agent can't connect to Zabbix5.0 server

I installed zabbix agent on Ubuntu 18.04 server. I changed the IP address and hostname pointing to the Zabbix server in zabbix_agentd.config file in /etc. And Restart Zabbix agent. Seems like the server is running, but the agent is not conneting to the server. How can I fix it?
/etc/zabbix# sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-07-29 15:26:30 NZST; 5s ago
Process: 16401 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 16403 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 16406 (zabbix_agentd)
Tasks: 6 (limit: 2325)
CGroup: /system.slice/zabbix-agent.service
├─16406 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─16407 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─16408 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─16409 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─16410 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─16411 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Jul 29 15:26:29 UbuntuServe-001 systemd[1]: Starting Zabbix Agent...
Jul 29 15:26:30 UbuntuServe-001 systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
Jul 29 15:26:30 UbuntuServe-001 systemd[1]: Started Zabbix Agent.
Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
The /run/zabbix directory does not exists. Remove the PIDFILE= line from config file, and zabbxi will create the pid file in temporary directory. Alternatively, create /run/zabbix directory and chown it to zabbix user.

Replace zookeeper server from zookeeper ensemble (with SolrCloud)

I have a SolrCloud cluster (6.6) setup with external Zookeeper Ensemble (3.4.8) of 5 nodes. Recently, one machine (ip1:port1) that run 1 Zookeeper with id=1 went down. This is what I've done to replace zookeeper:
Start zookeeper in another machine with the same id (=1).
Change zoo.cfg in 4 live zookeeper to match new zookeeper server and restart.
Update ZK_HOST variable in solr.in.sh to match new zookeeper server.
Restart solr.
After that, my solr cluster seemed to functioning well, but in solr.log, it looked like solr client and zookeeper servers still try to connect to the old zookeeper:
Solr log
2017-12-01 15:04:38.782 WARN (Timer-0-SendThread(ip1:port1)) [ ] o.a.z.ClientCnxn Client session timed out, have not heard from server in 30029ms for sessionid 0x0
2017-12-01 15:04:40.807 WARN (Timer-0-SendThread(ip1:port1)) [ ] o.a.z.ClientCnxn Client session timed out, have not heard from server in 31030ms for sessionid 0x0
Zookeeper log:
2017-12-01 13:53:57,972 [myid:] - INFO [main-SendThread(ip1:port1):ClientCnxn$SendThread#1032] - Opening socket connection to server ip1:port1. Will not attempt to authenticate using SASL (unknown error)
2017-12-01 13:54:03,972 [myid:] - WARN [main-SendThread(ip1:port1):ClientCnxn$SendThread#1162] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
2017-12-01 13:54:05,074 [myid:] - INFO [main-SendThread(ip1:port1):ClientCnxn$SendThread#1032] - Opening socket connection to server ip1:port1. Will not attempt to authenticate using SASL (unknown error)
2017-12-01 13:54:06,974 [myid:] - WARN [main-SendThread(ip1:port1):ClientCnxn$SendThread#1162] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
I've done some search in add/remove zookeeper but didn't find a document for it. My zookeeper version (3.4.7) is not supported for dynamic reconfiguration (which is in zookeeper 3.5).
Is there a way I can manually remove/add zookeeper server from ensemble?
Thanks for your attention!

Which ports should I open in firewall on nodes with Apach Flink?

When I try to run my flow on Apache Flink standalone cluster I see the following exception:
java.lang.IllegalStateException: Update task on instance aaa0859f6af25decf1f5fc1821ffa55d # app-2 - 4 slots - URL: akka.tcp://flink#192.168.38.98:46369/user/taskmanager failed due to:
at org.apache.flink.runtime.executiongraph.Execution$6.onFailure(Execution.java:954)
at akka.dispatch.OnFailure.internal(Future.scala:228)
at akka.dispatch.OnFailure.internal(Future.scala:227)
at akka.dispatch.japi$CallbackBridge.apply(Future.scala:174)
at akka.dispatch.japi$CallbackBridge.apply(Future.scala:171)
at scala.PartialFunction$class.applyOrElse(PartialFunction.scala:123)
at scala.runtime.AbstractPartialFunction.applyOrElse(AbstractPartialFunction.scala:28)
at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:136)
at scala.concurrent.Future$$anonfun$onFailure$1.apply(Future.scala:134)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka.tcp://flink#192.168.38.98:46369/user/taskmanager#1804590378]] after [10000 ms]
at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:333)
at akka.actor.Scheduler$$anon$7.run(Scheduler.scala:117)
at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599)
at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109)
at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:597)
at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:467)
at akka.actor.LightArrayRevolverScheduler$$anon$8.executeBucket$1(Scheduler.scala:419)
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:423)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
at java.lang.Thread.run(Thread.java:745)
Seems like port 46369 blocked by firewall. It is true because I read configuration section and open these ports only:
6121:
comment: Apache Flink TaskManager (Data Exchange)
6122:
comment: Apache Flink TaskManager (IPC)
6123:
comment: Apache Flink JobManager
6130:
comment: Apache Flink JobManager (BLOB Server)
8081:
comment: Apache Flink JobManager (Web UI)
The same ports described in flink-conf.yaml:
jobmanager.rpc.address: app-1.stag.local
jobmanager.rpc.port: 6123
jobmanager.heap.mb: 1024
taskmanager.heap.mb: 2048
taskmanager.numberOfTaskSlots: 4
taskmanager.memory.preallocate: false
blob.server.port: 6130
parallelism.default: 4
jobmanager.web.port: 8081
state.backend: jobmanager
restart-strategy: none
restart-strategy.fixed-delay.attempts: 2
restart-strategy.fixed-delay.delay: 60s
So, I have two questions:
This exception related to blocked ports. Right?
Which ports should I open on firewall for standalone Apache Flink cluster?
UPDATE 1
I found configuration problem in masters and slaves files (I skip new line separators between hosts described in these files). I fixed it and now I see other exceptions:
flink--taskmanager-0-app-1.stag.local.log
flink--taskmanager-0-app-2.stag.local.log
I have 2 nodes:
app-1.stag.local (with running job and task managers)
app-2.stag.local (with running task manager)
As you can see from these logs the app-1.stag.local task manager can't connect to other task manager:
java.io.IOException: Connecting the channel failed: Connecting to remote task manager + 'app-2.stag.local/192.168.38.98:35806' has failed. This might indicate that the remote task manager has been lost.
but app-2.stag.local has open port:
2016-03-18 16:24:14,347 INFO org.apache.flink.runtime.io.network.netty.NettyServer - Successful initialization (took 39 ms). Listening on SocketAddress /192.168.38.98:35806
So, I think problem related to firewall but I don't understand where I can configure this port (or range of ports) in Apache Flink.
I have found a problem: taskmanager.data.port parameter was set to 0 by default (but documentation say what it should be set to 6121).
So, I set this port in flink-conf.yaml and now all works fine.

Resources