问:
Getting "No available slots for topology" error for storm nimbus
I am new to the apache-storm. I am trying to set up a local storm cluster. I have setup zookeeper using the following link and when I start zookeeper it's running fine.But when I start nimbus using start nimbus command I am seeing an error No slot available for topology in the nimbus.log file.

My nimbus.log file:

```SendThread(kubernetes.docker.internal:2181) [INFO] Opening socket connection to server kubernetes.docker.internal/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-05-25 14:51:37.260 o.a.s.z.ClientZookeeper main [INFO] Starting ZK Curator
    2020-05-25 14:51:37.260 o.a.s.s.o.a.c.f.i.CuratorFrameworkImpl main [INFO] Starting
    2020-05-25 14:51:37.261 o.a.s.s.o.a.z.ZooKeeper main [INFO] Initiating client connection, connectString=127.0.0.1:2181/storm sessionTimeout=20000 watcher=org.apache.storm.shade.org.apache.curator.ConnectionState@35beb15e
    2020-05-25 14:51:37.261 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Socket connection established to kubernetes.docker.internal/127.0.0.1:2181, initiating session
    2020-05-25 14:51:37.263 o.a.s.s.o.a.c.f.i.CuratorFrameworkImpl main [INFO] Default schema
    2020-05-25 14:51:37.264 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Opening socket connection to server kubernetes.docker.internal/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-05-25 14:51:37.265 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Session establishment complete on server kubernetes.docker.internal/127.0.0.1:2181, sessionid = 0x1000ebc40020006, negotiated timeout = 20000
    2020-05-25 14:51:37.266 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Socket connection established to kubernetes.docker.internal/127.0.0.1:2181, initiating session
    2020-05-25 14:51:37.266 o.a.s.s.o.a.c.f.s.ConnectionStateManager main-EventThread [INFO] State change: CONNECTED
    2020-05-25 14:51:37.270 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Session establishment complete on server kubernetes.docker.internal/127.0.0.1:2181, sessionid = 0x1000ebc40020007, negotiated timeout = 20000
    2020-05-25 14:51:37.271 o.a.s.s.o.a.c.f.s.ConnectionStateManager main-EventThread [INFO] State change: CONNECTED
    2020-05-25 14:51:41.791 o.a.s.n.NimbusInfo main [INFO] Nimbus figures out its name to 7480-GQY29H2.smarshcorp.com
    2020-05-25 14:51:41.817 o.a.s.d.n.Nimbus main [INFO] Starting Nimbus with conf {storm.messaging.netty.min_wait_ms=100, topology.backpressure.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, storm.resource.isolation.plugin=org.apache.storm.container.cgroup.CgroupManager, storm.zookeeper.auth.user=null, storm.messaging.netty.buffer_size=5242880, storm.exhibitor.port=8080, topology.bolt.wait.progressive.level1.count=1, pacemaker.auth.method=NONE, ui.filter=null, worker.profiler.enabled=false, executor.metrics.frequency.secs=60, supervisor.thrift.threads=16, ui.http.creds.plugin=org.apache.storm.security.auth.DefaultHttpCredentialsPlugin, supervisor.supervisors.commands=[], supervisor.queue.size=128, logviewer.cleanup.age.mins=10080, topology.tuple.serializer=org.apache.storm.serialization.types.ListDelegateSerializer, storm.cgroup.memory.enforcement.enable=false, drpc.port=3772, topology.max.spout.pending=null, topology.transfer.buffer.size=1000, nimbus.worker.heartbeats.recovery.strategy.class=org.apache.storm.nimbus.TimeOutWorkerHeartbeatsRecoveryStrategy, worker.metrics={CGroupMemory=org.apache.storm.metric.cgroup.CGroupMemoryUsage, CGroupMemoryLimit=org.apache.storm.metric.cgroup.CGroupMemoryLimit, CGroupCpu=org.apache.storm.metric.cgroup.CGroupCpu, CGroupCpuGuarantee=org.apache.storm.metric.cgroup.CGroupCpuGuarantee}, logviewer.port=8000, worker.childopts=-Xmx%HEAP-MEM%m -XX:+PrintGCDetails -Xloggc:artifacts/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=artifacts/heapdump, topology.component.cpu.pcore.percent=10.0, storm.daemon.metrics.reporter.plugins=[org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter], blacklist.scheduler.resume.time.secs=1800, drpc.childopts=-Xmx768m, nimbus.task.launch.secs=120, logviewer.childopts=-Xmx128m, storm.supervisor.hard.memory.limit.overage.mb=2024, storm.zookeeper.servers=[127.0.0.1], storm.messaging.transport=org.apache.storm.messaging.netty.Context, storm.messaging.netty.authentication=false, topology.localityaware.higher.bound=0.8, storm.cgroup.memory.limit.tolerance.margin.mb=0.0, storm.cgroup.hierarchy.name=storm, storm.metricprocessor.class=org.apache.storm.metricstore.NimbusMetricProcessor, topology.kryo.factory=org.apache.storm.serialization.DefaultKryoFactory, nimbus.assignments.service.threads=10, worker.heap.memory.mb=768, storm.network.topography.plugin=org.apache.storm.networktopography.DefaultRackDNSToSwitchMapping, supervisor.slots.ports=[6700, 6701, 6702, 6703], topology.stats.sample.rate=0.05, storm.local.dir=/Users/anshita.singh/storm/datadir/storm, topology.backpressure.wait.park.microsec=100, topology.ras.constraint.max.state.search=10000, topology.testing.always.try.serialize=false, nimbus.assignments.service.thread.queue.size=100, storm.principal.tolocal=org.apache.storm.security.auth.DefaultPrincipalToLocal, java.library.path=/usr/local/lib:/opt/local/lib:/usr/lib:/usr/lib64, nimbus.local.assignments.backend.class=org.apache.storm.assignments.InMemoryAssignmentBackend, worker.gc.childopts=, storm.group.mapping.service.cache.duration.secs=120, topology.multilang.serializer=org.apache.storm.multilang.JsonSerializer, drpc.request.timeout.secs=600, nimbus.blobstore.class=org.apache.storm.blobstore.LocalFsBlobStore, topology.state.synchronization.timeout.secs=60, topology.bolt.wait.progressive.level2.count=1000, topology.worker.shared.thread.pool.size=4, topology.executor.receive.buffer.size=32768, pacemaker.servers=[], supervisor.monitor.frequency.secs=3, storm.nimbus.retry.times=5, topology.transfer.batch.size=1, transactional.zookeeper.port=null, storm.auth.simple-white-list.users=[], topology.scheduler.strategy=org.apache.storm.scheduler.resource.strategies.scheduling.DefaultResourceAwareStrategy, storm.zookeeper.port=2181, storm.zookeeper.retry.intervalceiling.millis=30000, storm.cluster.state.store=org.apache.storm.cluster.ZKStateStorageFactory, nimbus.thrift.port=6627, blacklist.scheduler.tolerance.count=3, nimbus.thrift.threads=64, supervisor.supervisors=[], nimbus.seeds=[localhost], supervisor.slot.ports=-6700 -6701 -6702 -6703, storm.cluster.metrics.consumer.publish.interval.secs=60, logviewer.filter.params=null, topology.min.replication.count=1, nimbus.blobstore.expiration.secs=600, storm.group.mapping.service=org.apache.storm.security.auth.ShellBasedGroupsMapping, storm.nimbus.retry.interval.millis=2000, topology.max.task.parallelism=null, topology.backpressure.wait.progressive.level2.count=1000, drpc.https.keystore.password=*****, resource.aware.scheduler.constraint.max.state.search=100000, supervisor.heartbeat.frequency.secs=5, nimbus.credential.renewers.freq.secs=600, storm.supervisor.medium.memory.grace.period.ms=30000, storm.thrift.transport=org.apache.storm.security.auth.SimpleTransportPlugin, storm.cgroup.hierarchy.dir=/cgroup/storm_resources, storm.zookeeper.auth.password=null, ui.port=8081, drpc.authorizer.acl.strict=false, topology.message.timeout.secs=30, topology.error.throttle.interval.secs=10, topology.backpressure.check.millis=50, drpc.https.keystore.type=JKS, supervisor.memory.capacity.mb=4096.0, storm.metricstore.class=org.apache.storm.metricstore.rocksdb.RocksDbStore, drpc.authorizer.acl.filename=drpc-auth-acl.yaml, topology.builtin.metrics.bucket.size.secs=60, topology.spout.wait.park.microsec=100, storm.local.mode.zmq=false, pacemaker.client.max.threads=2, ui.header.buffer.bytes=4096, topology.shellbolt.max.pending=100, topology.serialized.message.size.metrics=false, drpc.max_buffer_size=1048576, drpc.disable.http.binding=true, storm.codedistributor.class=org.apache.storm.codedistributor.LocalFileSystemCodeDistributor, worker.profiler.childopts=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder, nimbus.supervisor.timeout.secs=60, storm.supervisor.cgroup.rootdir=storm, topology.worker.max.heap.size.mb=768.0, storm.zookeeper.root=/storm, topology.disable.loadaware.messaging=false, storm.supervisor.hard.memory.limit.multiplier=2.0, nimbus.topology.validator=org.apache.storm.nimbus.DefaultTopologyValidator, worker.heartbeat.frequency.secs=1, storm.messaging.netty.max_wait_ms=1000, topology.backpressure.wait.progressive.level1.count=1, topology.max.error.report.per.interval=5, nimbus.thrift.max_buffer_size=1048576, storm.metricstore.rocksdb.location=storm_rocks, storm.supervisor.low.memory.threshold.mb=1024, pacemaker.max.threads=50, ui.pagination=20, ui.disable.http.binding=true, supervisor.blobstore.download.max_retries=3, topology.enable.message.timeouts=true, logviewer.disable.http.binding=true, storm.messaging.netty.transfer.batch.size=262144, topology.spout.wait.progressive.level2.count=0, blacklist.scheduler.strategy=org.apache.storm.scheduler.blacklist.strategies.DefaultBlacklistStrategy, storm.metricstore.rocksdb.retention_hours=240, supervisor.run.worker.as.user=false, storm.messaging.netty.client_worker_threads=1, topology.tasks=null, supervisor.thrift.socket.timeout.ms=5000, storm.group.mapping.service.params=null, drpc.http.port=3774, transactional.zookeeper.root=/transactional, supervisor.blobstore.download.thread.count=5, logviewer.filter=null, pacemaker.kerberos.users=[], topology.spout.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, storm.blobstore.inputstream.buffer.size.bytes=65536, supervisor.worker.heartbeats.max.timeout.secs=600, supervisor.worker.timeout.secs=30, topology.worker.receiver.thread.count=1, logviewer.max.sum.worker.logs.size.mb=4096, topology.executor.overflow.limit=0, topology.batch.flush.interval.millis=1, nimbus.file.copy.expiration.secs=600, pacemaker.port=6699, topology.worker.logwriter.childopts=-Xmx64m, drpc.http.creds.plugin=org.apache.storm.security.auth.DefaultHttpCredentialsPlugin, nimbus.topology.blobstore.deletion.delay.ms=300000, storm.blobstore.acl.validation.enabled=false, ui.filter.params=null, topology.workers=1, blacklist.scheduler.tolerance.time.secs=300, storm.supervisor.medium.memory.threshold.mb=1536, topology.environment=null, drpc.invocations.port=3773, storm.metricstore.rocksdb.create_if_missing=true, nimbus.cleanup.inbox.freq.secs=600, client.blobstore.class=org.apache.storm.blobstore.NimbusBlobStore, topology.fall.back.on.java.serialization=true, storm.nimbus.retry.intervalceiling.millis=60000, storm.nimbus.zookeeper.acls.fixup=true, logviewer.appender.name=A1, ui.users=null, pacemaker.childopts=-Xmx1024m, storm.messaging.netty.server_worker_threads=1, scheduler.display.resource=false, ui.actions.enabled=true, storm.thrift.socket.timeout.ms=600000, storm.topology.classpath.beginning.enabled=false, storm.zookeeper.connection.timeout=15000, topology.tick.tuple.freq.secs=null, nimbus.inbox.jar.expiration.secs=3600, topology.debug=false, storm.zookeeper.retry.interval=1000, storm.messaging.netty.buffer.high.watermark=16777216, storm.blobstore.dependency.jar.upload.chunk.size.bytes=1048576, worker.log.level.reset.poll.secs=30, storm.exhibitor.poll.uripath=/exhibitor/v1/cluster/list, storm.zookeeper.retry.times=5, nimbus.code.sync.freq.secs=120, topology.component.resources.offheap.memory.mb=0.0, topology.spout.wait.progressive.level1.count=0, topology.state.checkpoint.interval.ms=1000, topology.priority=29, supervisor.localizer.cleanup.interval.ms=30000, nimbus.host=127.0.0.1, storm.health.check.dir=healthchecks, supervisor.cpu.capacity=400.0, topology.backpressure.wait.progressive.level3.sleep.millis=1, storm.cgroup.resources=[cpu, memory], storm.worker.min.cpu.pcore.percent=0.0, topology.classpath=null, storm.nimbus.zookeeper.acls.check=true, num.stat.buckets=20, topology.spout.wait.progressive.level3.sleep.millis=1, supervisor.localizer.cache.target.size.mb=10240, topology.worker.childopts=null, drpc.https.port=-1, topology.bolt.wait.park.microsec=100, topology.max.replication.wait.time.sec=60, storm.cgroup.cgexec.cmd=/bin/cgexec, topology.acker.executors=null, topology.bolt.wait.progressive.level3.sleep.millis=1, supervisor.worker.start.timeout.secs=120, supervisor.worker.shutdown.sleep.secs=3, logviewer.max.per.worker.logs.size.mb=2048, topology.trident.batch.emit.interval.millis=500, task.heartbeat.frequency.secs=3, supervisor.enable=true, supervisor.thrift.max_buffer_size=1048576, supervisor.blobstore.class=org.apache.storm.blobstore.NimbusBlobStore, topology.producer.batch.size=1, drpc.worker.threads=64, resource.aware.scheduler.priority.strategy=org.apache.storm.scheduler.resource.strategies.priority.DefaultSchedulingPriorityStrategy, blacklist.scheduler.reporter=org.apache.storm.scheduler.blacklist.reporters.LogReporter, storm.messaging.netty.socket.backlog=500, storm.cgroup.inherit.cpuset.configs=false, nimbus.queue.size=100000, drpc.queue.size=128, ui.disable.spout.lag.monitoring=true, topology.eventlogger.executors=0, pacemaker.base.threads=10, nimbus.childopts=-Xmx1024m, topology.spout.recvq.skips=3, storm.resource.isolation.plugin.enable=false, nimbus.monitor.freq.secs=10, storm.supervisor.memory.limit.tolerance.margin.mb=128.0, storm.disable.symlinks=false, topology.localityaware.lower.bound=0.2, transactional.zookeeper.servers=null, nimbus.task.timeout.secs=30, logs.users=null, pacemaker.thrift.message.size.max=10485760, ui.host=0.0.0.0, supervisor.thrift.port=6628, topology.bolt.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, pacemaker.thread.timeout=10, storm.meta.serialization.delegate=org.apache.storm.serialization.GzipThriftSerializationDelegate, dev.zookeeper.path=/tmp/dev-storm-zookeeper, topology.skip.missing.kryo.registrations=false, drpc.invocations.threads=64, storm.zookeeper.session.timeout=20000, storm.metricstore.rocksdb.metadata_string_cache_capacity=4000, storm.workers.artifacts.dir=workers-artifacts, topology.component.resources.onheap.memory.mb=128.0, storm.log4j2.conf.dir=log4j2, storm.cluster.mode=distributed, ui.childopts=-Xmx768m, task.refresh.poll.secs=10, supervisor.childopts=-Xmx256m, task.credentials.poll.secs=30, storm.health.check.timeout.ms=5000, storm.blobstore.replication.factor=3, worker.profiler.command=flight.bash, storm.messaging.netty.buffer.low.watermark=8388608}
    2020-05-25 14:51:41.877 o.a.s.z.LeaderElectorImp main [INFO] Queued up for leader lock.
    2020-05-25 14:51:41.907 o.a.s.n.NimbusInfo main-EventThread [INFO] Nimbus figures out its name to 7480-GQY29H2.smarshcorp.com
    2020-05-25 14:51:41.929 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] Sync remote assignments and id-info to local
    2020-05-25 14:51:41.963 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormcode.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:41.999 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormcode.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.015 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormconf.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.035 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormjar.jar/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.052 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormconf.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.081 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormjar.jar/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.104 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] active-topology-blobs [Stock-Topology-1-1589133962,word-topology-1-1589738489] local-topology-blobs [word-topology-1-1589738489-stormcode.ser,Stock-Topology-1-1589133962-stormcode.ser,word-topology-1-1589738489-stormconf.ser,Stock-Topology-1-1589133962-stormjar.jar,Stock-Topology-1-1589133962-stormconf.ser,word-topology-1-1589738489-stormjar.jar] diff-topology-blobs []
    2020-05-25 14:51:42.239 o.a.s.d.m.ClientMetricsUtils main [INFO] Using statistics reporter plugin:org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter
    2020-05-25 14:51:42.297 o.a.s.d.m.r.JmxPreparableReporter main [INFO] Preparing...
    2020-05-25 14:51:42.322 o.a.s.m.StormMetricsRegistry main [INFO] Started statistics report plugin...
    2020-05-25 14:51:42.327 o.a.s.d.n.Nimbus main [INFO] Starting nimbus server for storm version '2.1.0'
    2020-05-25 14:51:42.408 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] active-topology-dependencies [] local-blobs [word-topology-1-1589738489-stormcode.ser,Stock-Topology-1-1589133962-stormcode.ser,word-topology-1-1589738489-stormconf.ser,Stock-Topology-1-1589133962-stormjar.jar,Stock-Topology-1-1589133962-stormconf.ser,word-topology-1-1589738489-stormjar.jar] diff-topology-dependencies []
2020-05-25 14:51:42.409 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] Accepting leadership, all active topologies and corresponding dependencies found locally.
        2020-05-25 14:51:42.409 o.a.s.z.LeaderListenerCallbackFactory main-EventThread [INFO] 7480-GQY29H2.smarshcorp.com gained leadership.
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
 2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:42.619 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:51:45.096 o.a.s.d.n.Nimbus timer [INFO] TRANSITION: word-topology-1-1589738489 GAIN_LEADERSHIP null false
 2020-05-25 14:51:45.098 o.a.s.d.n.Nimbus timer [INFO] TRANSITION: Stock-Topology-1-1589133962 GAIN_LEADERSHIP null false
  2020-05-25 14:51:52.682 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
 2020-05-25 14:51:52.682 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
 2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
 2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:51:52.684 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:51:52.684 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:51:52.685 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:52.686 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:51:52.686 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:52.687 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
 2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
  2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
2020-05-25 14:52:02.736 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:52:12.774 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:12.774 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:12.775 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:12.775 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:22.810 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
2020-05-25 14:52:22.811 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:22.811 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
```

<p>Here is my <strong>storm.yml</strong>:</p>

```storm.zookeeper.servers:
     - "127.0.0.1"

nimbus.host: "127.0.0.1"
ui.port: 8081
storm.local.dir: "/Users/anshita.singh/storm/datadir/storm"
supervisor.slot.ports:
    -6700
    -6701
    -6702
    -6703

# storm.zookeeper.servers:
#     - "server1"
#     - "server2"
#
# nimbus.seeds: ["host1", "host2", "host3"]
#
#
# ##### These may optionally be filled in:
#
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"

## Metrics Consumers
## max.retain.metric.tuples
## - task queue will be unbounded when max.retain.metric.tuples is equal or less than 0.
## whitelist / blacklist
## - when none of configuration for metric filter are specified, it'll be treated as 'pass all'.
## - you need to specify either whitelist or blacklist, or none of them. You can't specify both of them.
## - you can specify multiple whitelist / blacklist with regular expression
## expandMapType: expand metric with map type as value to multiple metrics
## - set to true when you would like to apply filter to expanded metrics
## - default value is false which is backward compatible value
## metricNameSeparator: separator between origin metric name and key of entry from map
## - only effective when expandMapType is set to true
## - default value is "."
# topology.metrics.consumer.register:
#   - class: "org.apache.storm.metric.LoggingMetricsConsumer"
#     max.retain.metric.tuples: 100
#     parallelism.hint: 1
#   - class: "org.mycompany.MyMetricsConsumer"
#     max.retain.metric.tuples: 100
#     whitelist:
#       - "execute.*"
#       - "^__complete-latency$"
#     parallelism.hint: 1
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"
#     expandMapType: true
#     metricNameSeparator: "."

## Cluster Metrics Consumers
# storm.cluster.metrics.consumer.register:
#   - class: "org.apache.storm.metric.LoggingClusterMetricsConsumer"
#   - class: "org.mycompany.MyMetricsConsumer"
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"
#
# storm.cluster.metrics.consumer.publish.interval.secs: 60

# Event Logger
# topology.event.logger.register:
#   - class: "org.apache.storm.metric.FileBasedEventLogger"
#   - class: "org.mycompany.MyEventLogger"
#     arguments:
#       endpoint: "event-logger.mycompany.org"

# Metrics v2 configuration (optional)
#storm.metrics.reporters:
#  # Graphite Reporter
#  - class: "org.apache.storm.metrics2.reporters.GraphiteStormReporter"
#    daemons:
#        - "supervisor"
#        - "nimbus"
#        - "worker"
#    report.period: 60
#    report.period.units: "SECONDS"
#    graphite.host: "localhost"
#    graphite.port: 2003
#
#  # Console Reporter
#  - class: "org.apache.storm.metrics2.reporters.ConsoleStormReporter"
#    daemons:
#        - "worker"
#    report.period: 10
#    report.period.units: "SECONDS"
#    filter:
#        class: "org.apache.storm.metrics2.filters.RegexFilter"
#        expression: ".*my_component.*emitted.*"
```

<p>Can anyone tell me what configuration I have missed, if any? And please let me know if any else information is needed to debug this?</p>

<p><strong>My environment:</strong></p>

<ol>
<li>Apache-storm-2.1.0    </li>
<li>Apache-zookeeper-3.6.1</li>
</ol>

<p><strong><em>Solution:</em></strong></p>

<p>Run below command:</p>

```storm admin remove_corrupt_topologies
```

答:
Looks like there was some corrupted topologies were there. When I ran this command it fix this issue:</p>

```<code>storm admin remove_corrupt_topologies
</code>```

Body:
I am new to the apache-storm. I am trying to set up a local storm cluster. I have setup zookeeper using the following link and when I start zookeeper it's running fine.But when I start nimbus using start nimbus command I am seeing an error No slot available for topology in the nimbus.log file.

My nimbus.log file:

SendThread(kubernetes.docker.internal:2181) [INFO] Opening socket connection to server kubernetes.docker.internal/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-05-25 14:51:37.260 o.a.s.z.ClientZookeeper main [INFO] Starting ZK Curator
    2020-05-25 14:51:37.260 o.a.s.s.o.a.c.f.i.CuratorFrameworkImpl main [INFO] Starting
    2020-05-25 14:51:37.261 o.a.s.s.o.a.z.ZooKeeper main [INFO] Initiating client connection, connectString=127.0.0.1:2181/storm sessionTimeout=20000 watcher=org.apache.storm.shade.org.apache.curator.ConnectionState@35beb15e
    2020-05-25 14:51:37.261 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Socket connection established to kubernetes.docker.internal/127.0.0.1:2181, initiating session
    2020-05-25 14:51:37.263 o.a.s.s.o.a.c.f.i.CuratorFrameworkImpl main [INFO] Default schema
    2020-05-25 14:51:37.264 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Opening socket connection to server kubernetes.docker.internal/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2020-05-25 14:51:37.265 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Session establishment complete on server kubernetes.docker.internal/127.0.0.1:2181, sessionid = 0x1000ebc40020006, negotiated timeout = 20000
    2020-05-25 14:51:37.266 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Socket connection established to kubernetes.docker.internal/127.0.0.1:2181, initiating session
    2020-05-25 14:51:37.266 o.a.s.s.o.a.c.f.s.ConnectionStateManager main-EventThread [INFO] State change: CONNECTED
    2020-05-25 14:51:37.270 o.a.s.s.o.a.z.ClientCnxn main-SendThread(kubernetes.docker.internal:2181) [INFO] Session establishment complete on server kubernetes.docker.internal/127.0.0.1:2181, sessionid = 0x1000ebc40020007, negotiated timeout = 20000
    2020-05-25 14:51:37.271 o.a.s.s.o.a.c.f.s.ConnectionStateManager main-EventThread [INFO] State change: CONNECTED
    2020-05-25 14:51:41.791 o.a.s.n.NimbusInfo main [INFO] Nimbus figures out its name to 7480-GQY29H2.smarshcorp.com
    2020-05-25 14:51:41.817 o.a.s.d.n.Nimbus main [INFO] Starting Nimbus with conf {storm.messaging.netty.min_wait_ms=100, topology.backpressure.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, storm.resource.isolation.plugin=org.apache.storm.container.cgroup.CgroupManager, storm.zookeeper.auth.user=null, storm.messaging.netty.buffer_size=5242880, storm.exhibitor.port=8080, topology.bolt.wait.progressive.level1.count=1, pacemaker.auth.method=NONE, ui.filter=null, worker.profiler.enabled=false, executor.metrics.frequency.secs=60, supervisor.thrift.threads=16, ui.http.creds.plugin=org.apache.storm.security.auth.DefaultHttpCredentialsPlugin, supervisor.supervisors.commands=[], supervisor.queue.size=128, logviewer.cleanup.age.mins=10080, topology.tuple.serializer=org.apache.storm.serialization.types.ListDelegateSerializer, storm.cgroup.memory.enforcement.enable=false, drpc.port=3772, topology.max.spout.pending=null, topology.transfer.buffer.size=1000, nimbus.worker.heartbeats.recovery.strategy.class=org.apache.storm.nimbus.TimeOutWorkerHeartbeatsRecoveryStrategy, worker.metrics={CGroupMemory=org.apache.storm.metric.cgroup.CGroupMemoryUsage, CGroupMemoryLimit=org.apache.storm.metric.cgroup.CGroupMemoryLimit, CGroupCpu=org.apache.storm.metric.cgroup.CGroupCpu, CGroupCpuGuarantee=org.apache.storm.metric.cgroup.CGroupCpuGuarantee}, logviewer.port=8000, worker.childopts=-Xmx%HEAP-MEM%m -XX:+PrintGCDetails -Xloggc:artifacts/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=artifacts/heapdump, topology.component.cpu.pcore.percent=10.0, storm.daemon.metrics.reporter.plugins=[org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter], blacklist.scheduler.resume.time.secs=1800, drpc.childopts=-Xmx768m, nimbus.task.launch.secs=120, logviewer.childopts=-Xmx128m, storm.supervisor.hard.memory.limit.overage.mb=2024, storm.zookeeper.servers=[127.0.0.1], storm.messaging.transport=org.apache.storm.messaging.netty.Context, storm.messaging.netty.authentication=false, topology.localityaware.higher.bound=0.8, storm.cgroup.memory.limit.tolerance.margin.mb=0.0, storm.cgroup.hierarchy.name=storm, storm.metricprocessor.class=org.apache.storm.metricstore.NimbusMetricProcessor, topology.kryo.factory=org.apache.storm.serialization.DefaultKryoFactory, nimbus.assignments.service.threads=10, worker.heap.memory.mb=768, storm.network.topography.plugin=org.apache.storm.networktopography.DefaultRackDNSToSwitchMapping, supervisor.slots.ports=[6700, 6701, 6702, 6703], topology.stats.sample.rate=0.05, storm.local.dir=/Users/anshita.singh/storm/datadir/storm, topology.backpressure.wait.park.microsec=100, topology.ras.constraint.max.state.search=10000, topology.testing.always.try.serialize=false, nimbus.assignments.service.thread.queue.size=100, storm.principal.tolocal=org.apache.storm.security.auth.DefaultPrincipalToLocal, java.library.path=/usr/local/lib:/opt/local/lib:/usr/lib:/usr/lib64, nimbus.local.assignments.backend.class=org.apache.storm.assignments.InMemoryAssignmentBackend, worker.gc.childopts=, storm.group.mapping.service.cache.duration.secs=120, topology.multilang.serializer=org.apache.storm.multilang.JsonSerializer, drpc.request.timeout.secs=600, nimbus.blobstore.class=org.apache.storm.blobstore.LocalFsBlobStore, topology.state.synchronization.timeout.secs=60, topology.bolt.wait.progressive.level2.count=1000, topology.worker.shared.thread.pool.size=4, topology.executor.receive.buffer.size=32768, pacemaker.servers=[], supervisor.monitor.frequency.secs=3, storm.nimbus.retry.times=5, topology.transfer.batch.size=1, transactional.zookeeper.port=null, storm.auth.simple-white-list.users=[], topology.scheduler.strategy=org.apache.storm.scheduler.resource.strategies.scheduling.DefaultResourceAwareStrategy, storm.zookeeper.port=2181, storm.zookeeper.retry.intervalceiling.millis=30000, storm.cluster.state.store=org.apache.storm.cluster.ZKStateStorageFactory, nimbus.thrift.port=6627, blacklist.scheduler.tolerance.count=3, nimbus.thrift.threads=64, supervisor.supervisors=[], nimbus.seeds=[localhost], supervisor.slot.ports=-6700 -6701 -6702 -6703, storm.cluster.metrics.consumer.publish.interval.secs=60, logviewer.filter.params=null, topology.min.replication.count=1, nimbus.blobstore.expiration.secs=600, storm.group.mapping.service=org.apache.storm.security.auth.ShellBasedGroupsMapping, storm.nimbus.retry.interval.millis=2000, topology.max.task.parallelism=null, topology.backpressure.wait.progressive.level2.count=1000, drpc.https.keystore.password=*****, resource.aware.scheduler.constraint.max.state.search=100000, supervisor.heartbeat.frequency.secs=5, nimbus.credential.renewers.freq.secs=600, storm.supervisor.medium.memory.grace.period.ms=30000, storm.thrift.transport=org.apache.storm.security.auth.SimpleTransportPlugin, storm.cgroup.hierarchy.dir=/cgroup/storm_resources, storm.zookeeper.auth.password=null, ui.port=8081, drpc.authorizer.acl.strict=false, topology.message.timeout.secs=30, topology.error.throttle.interval.secs=10, topology.backpressure.check.millis=50, drpc.https.keystore.type=JKS, supervisor.memory.capacity.mb=4096.0, storm.metricstore.class=org.apache.storm.metricstore.rocksdb.RocksDbStore, drpc.authorizer.acl.filename=drpc-auth-acl.yaml, topology.builtin.metrics.bucket.size.secs=60, topology.spout.wait.park.microsec=100, storm.local.mode.zmq=false, pacemaker.client.max.threads=2, ui.header.buffer.bytes=4096, topology.shellbolt.max.pending=100, topology.serialized.message.size.metrics=false, drpc.max_buffer_size=1048576, drpc.disable.http.binding=true, storm.codedistributor.class=org.apache.storm.codedistributor.LocalFileSystemCodeDistributor, worker.profiler.childopts=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder, nimbus.supervisor.timeout.secs=60, storm.supervisor.cgroup.rootdir=storm, topology.worker.max.heap.size.mb=768.0, storm.zookeeper.root=/storm, topology.disable.loadaware.messaging=false, storm.supervisor.hard.memory.limit.multiplier=2.0, nimbus.topology.validator=org.apache.storm.nimbus.DefaultTopologyValidator, worker.heartbeat.frequency.secs=1, storm.messaging.netty.max_wait_ms=1000, topology.backpressure.wait.progressive.level1.count=1, topology.max.error.report.per.interval=5, nimbus.thrift.max_buffer_size=1048576, storm.metricstore.rocksdb.location=storm_rocks, storm.supervisor.low.memory.threshold.mb=1024, pacemaker.max.threads=50, ui.pagination=20, ui.disable.http.binding=true, supervisor.blobstore.download.max_retries=3, topology.enable.message.timeouts=true, logviewer.disable.http.binding=true, storm.messaging.netty.transfer.batch.size=262144, topology.spout.wait.progressive.level2.count=0, blacklist.scheduler.strategy=org.apache.storm.scheduler.blacklist.strategies.DefaultBlacklistStrategy, storm.metricstore.rocksdb.retention_hours=240, supervisor.run.worker.as.user=false, storm.messaging.netty.client_worker_threads=1, topology.tasks=null, supervisor.thrift.socket.timeout.ms=5000, storm.group.mapping.service.params=null, drpc.http.port=3774, transactional.zookeeper.root=/transactional, supervisor.blobstore.download.thread.count=5, logviewer.filter=null, pacemaker.kerberos.users=[], topology.spout.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, storm.blobstore.inputstream.buffer.size.bytes=65536, supervisor.worker.heartbeats.max.timeout.secs=600, supervisor.worker.timeout.secs=30, topology.worker.receiver.thread.count=1, logviewer.max.sum.worker.logs.size.mb=4096, topology.executor.overflow.limit=0, topology.batch.flush.interval.millis=1, nimbus.file.copy.expiration.secs=600, pacemaker.port=6699, topology.worker.logwriter.childopts=-Xmx64m, drpc.http.creds.plugin=org.apache.storm.security.auth.DefaultHttpCredentialsPlugin, nimbus.topology.blobstore.deletion.delay.ms=300000, storm.blobstore.acl.validation.enabled=false, ui.filter.params=null, topology.workers=1, blacklist.scheduler.tolerance.time.secs=300, storm.supervisor.medium.memory.threshold.mb=1536, topology.environment=null, drpc.invocations.port=3773, storm.metricstore.rocksdb.create_if_missing=true, nimbus.cleanup.inbox.freq.secs=600, client.blobstore.class=org.apache.storm.blobstore.NimbusBlobStore, topology.fall.back.on.java.serialization=true, storm.nimbus.retry.intervalceiling.millis=60000, storm.nimbus.zookeeper.acls.fixup=true, logviewer.appender.name=A1, ui.users=null, pacemaker.childopts=-Xmx1024m, storm.messaging.netty.server_worker_threads=1, scheduler.display.resource=false, ui.actions.enabled=true, storm.thrift.socket.timeout.ms=600000, storm.topology.classpath.beginning.enabled=false, storm.zookeeper.connection.timeout=15000, topology.tick.tuple.freq.secs=null, nimbus.inbox.jar.expiration.secs=3600, topology.debug=false, storm.zookeeper.retry.interval=1000, storm.messaging.netty.buffer.high.watermark=16777216, storm.blobstore.dependency.jar.upload.chunk.size.bytes=1048576, worker.log.level.reset.poll.secs=30, storm.exhibitor.poll.uripath=/exhibitor/v1/cluster/list, storm.zookeeper.retry.times=5, nimbus.code.sync.freq.secs=120, topology.component.resources.offheap.memory.mb=0.0, topology.spout.wait.progressive.level1.count=0, topology.state.checkpoint.interval.ms=1000, topology.priority=29, supervisor.localizer.cleanup.interval.ms=30000, nimbus.host=127.0.0.1, storm.health.check.dir=healthchecks, supervisor.cpu.capacity=400.0, topology.backpressure.wait.progressive.level3.sleep.millis=1, storm.cgroup.resources=[cpu, memory], storm.worker.min.cpu.pcore.percent=0.0, topology.classpath=null, storm.nimbus.zookeeper.acls.check=true, num.stat.buckets=20, topology.spout.wait.progressive.level3.sleep.millis=1, supervisor.localizer.cache.target.size.mb=10240, topology.worker.childopts=null, drpc.https.port=-1, topology.bolt.wait.park.microsec=100, topology.max.replication.wait.time.sec=60, storm.cgroup.cgexec.cmd=/bin/cgexec, topology.acker.executors=null, topology.bolt.wait.progressive.level3.sleep.millis=1, supervisor.worker.start.timeout.secs=120, supervisor.worker.shutdown.sleep.secs=3, logviewer.max.per.worker.logs.size.mb=2048, topology.trident.batch.emit.interval.millis=500, task.heartbeat.frequency.secs=3, supervisor.enable=true, supervisor.thrift.max_buffer_size=1048576, supervisor.blobstore.class=org.apache.storm.blobstore.NimbusBlobStore, topology.producer.batch.size=1, drpc.worker.threads=64, resource.aware.scheduler.priority.strategy=org.apache.storm.scheduler.resource.strategies.priority.DefaultSchedulingPriorityStrategy, blacklist.scheduler.reporter=org.apache.storm.scheduler.blacklist.reporters.LogReporter, storm.messaging.netty.socket.backlog=500, storm.cgroup.inherit.cpuset.configs=false, nimbus.queue.size=100000, drpc.queue.size=128, ui.disable.spout.lag.monitoring=true, topology.eventlogger.executors=0, pacemaker.base.threads=10, nimbus.childopts=-Xmx1024m, topology.spout.recvq.skips=3, storm.resource.isolation.plugin.enable=false, nimbus.monitor.freq.secs=10, storm.supervisor.memory.limit.tolerance.margin.mb=128.0, storm.disable.symlinks=false, topology.localityaware.lower.bound=0.2, transactional.zookeeper.servers=null, nimbus.task.timeout.secs=30, logs.users=null, pacemaker.thrift.message.size.max=10485760, ui.host=0.0.0.0, supervisor.thrift.port=6628, topology.bolt.wait.strategy=org.apache.storm.policy.WaitStrategyProgressive, pacemaker.thread.timeout=10, storm.meta.serialization.delegate=org.apache.storm.serialization.GzipThriftSerializationDelegate, dev.zookeeper.path=/tmp/dev-storm-zookeeper, topology.skip.missing.kryo.registrations=false, drpc.invocations.threads=64, storm.zookeeper.session.timeout=20000, storm.metricstore.rocksdb.metadata_string_cache_capacity=4000, storm.workers.artifacts.dir=workers-artifacts, topology.component.resources.onheap.memory.mb=128.0, storm.log4j2.conf.dir=log4j2, storm.cluster.mode=distributed, ui.childopts=-Xmx768m, task.refresh.poll.secs=10, supervisor.childopts=-Xmx256m, task.credentials.poll.secs=30, storm.health.check.timeout.ms=5000, storm.blobstore.replication.factor=3, worker.profiler.command=flight.bash, storm.messaging.netty.buffer.low.watermark=8388608}
    2020-05-25 14:51:41.877 o.a.s.z.LeaderElectorImp main [INFO] Queued up for leader lock.
    2020-05-25 14:51:41.907 o.a.s.n.NimbusInfo main-EventThread [INFO] Nimbus figures out its name to 7480-GQY29H2.smarshcorp.com
    2020-05-25 14:51:41.929 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] Sync remote assignments and id-info to local
    2020-05-25 14:51:41.963 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormcode.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:41.999 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormcode.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.015 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormconf.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.035 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormjar.jar/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.052 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/Stock-Topology-1-1589133962-stormconf.ser/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.081 o.a.s.c.StormClusterStateImpl main [INFO] set-path: /blobstore/word-topology-1-1589738489-stormjar.jar/7480-GQY29H2.smarshcorp.com:6627-1
    2020-05-25 14:51:42.104 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] active-topology-blobs [Stock-Topology-1-1589133962,word-topology-1-1589738489] local-topology-blobs [word-topology-1-1589738489-stormcode.ser,Stock-Topology-1-1589133962-stormcode.ser,word-topology-1-1589738489-stormconf.ser,Stock-Topology-1-1589133962-stormjar.jar,Stock-Topology-1-1589133962-stormconf.ser,word-topology-1-1589738489-stormjar.jar] diff-topology-blobs []
    2020-05-25 14:51:42.239 o.a.s.d.m.ClientMetricsUtils main [INFO] Using statistics reporter plugin:org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter
    2020-05-25 14:51:42.297 o.a.s.d.m.r.JmxPreparableReporter main [INFO] Preparing...
    2020-05-25 14:51:42.322 o.a.s.m.StormMetricsRegistry main [INFO] Started statistics report plugin...
    2020-05-25 14:51:42.327 o.a.s.d.n.Nimbus main [INFO] Starting nimbus server for storm version '2.1.0'
    2020-05-25 14:51:42.408 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] active-topology-dependencies [] local-blobs [word-topology-1-1589738489-stormcode.ser,Stock-Topology-1-1589133962-stormcode.ser,word-topology-1-1589738489-stormconf.ser,Stock-Topology-1-1589133962-stormjar.jar,Stock-Topology-1-1589133962-stormconf.ser,word-topology-1-1589738489-stormjar.jar] diff-topology-dependencies []
2020-05-25 14:51:42.409 o.a.s.n.LeaderListenerCallback main-EventThread [INFO] Accepting leadership, all active topologies and corresponding dependencies found locally.
        2020-05-25 14:51:42.409 o.a.s.z.LeaderListenerCallbackFactory main-EventThread [INFO] 7480-GQY29H2.smarshcorp.com gained leadership.
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
        2020-05-25 14:51:42.603 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
        2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
 2020-05-25 14:51:42.604 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:51:42.618 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:42.619 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:51:45.096 o.a.s.d.n.Nimbus timer [INFO] TRANSITION: word-topology-1-1589738489 GAIN_LEADERSHIP null false
 2020-05-25 14:51:45.098 o.a.s.d.n.Nimbus timer [INFO] TRANSITION: Stock-Topology-1-1589133962 GAIN_LEADERSHIP null false
  2020-05-25 14:51:52.682 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
 2020-05-25 14:51:52.682 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
 2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
 2020-05-25 14:51:52.683 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:51:52.684 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:51:52.684 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:51:52.685 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:52.686 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:51:52.686 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
 2020-05-25 14:51:52.687 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
 2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:02.734 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
 2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
  2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:02.735 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
2020-05-25 14:52:02.736 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:02.737 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:52:12.773 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:12.774 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
 2020-05-25 14:52:12.774 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:12.774 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:12.775 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:12.775 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[4, 4] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[1, 1] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[2, 2] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor word-topology-1-1589738489:[3, 3] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[1, 1] not alive
2020-05-25 14:52:22.809 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[3, 3] not alive
2020-05-25 14:52:22.810 o.a.s.d.n.HeartbeatCache timer [INFO] Executor Stock-Topology-1-1589133962:[2, 2] not alive
2020-05-25 14:52:22.811 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: word-topology
2020-05-25 14:52:22.811 o.a.s.s.EvenScheduler timer [ERROR] No available slots for topology: Stock-Topology

Here is my storm.yml:

storm.zookeeper.servers:
     - "127.0.0.1"

nimbus.host: "127.0.0.1"
ui.port: 8081
storm.local.dir: "/Users/anshita.singh/storm/datadir/storm"
supervisor.slot.ports:
    -6700
    -6701
    -6702
    -6703

# storm.zookeeper.servers:
#     - "server1"
#     - "server2"
#
# nimbus.seeds: ["host1", "host2", "host3"]
#
#
# ##### These may optionally be filled in:
#
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"

## Metrics Consumers
## max.retain.metric.tuples
## - task queue will be unbounded when max.retain.metric.tuples is equal or less than 0.
## whitelist / blacklist
## - when none of configuration for metric filter are specified, it'll be treated as 'pass all'.
## - you need to specify either whitelist or blacklist, or none of them. You can't specify both of them.
## - you can specify multiple whitelist / blacklist with regular expression
## expandMapType: expand metric with map type as value to multiple metrics
## - set to true when you would like to apply filter to expanded metrics
## - default value is false which is backward compatible value
## metricNameSeparator: separator between origin metric name and key of entry from map
## - only effective when expandMapType is set to true
## - default value is "."
# topology.metrics.consumer.register:
#   - class: "org.apache.storm.metric.LoggingMetricsConsumer"
#     max.retain.metric.tuples: 100
#     parallelism.hint: 1
#   - class: "org.mycompany.MyMetricsConsumer"
#     max.retain.metric.tuples: 100
#     whitelist:
#       - "execute.*"
#       - "^__complete-latency$"
#     parallelism.hint: 1
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"
#     expandMapType: true
#     metricNameSeparator: "."

## Cluster Metrics Consumers
# storm.cluster.metrics.consumer.register:
#   - class: "org.apache.storm.metric.LoggingClusterMetricsConsumer"
#   - class: "org.mycompany.MyMetricsConsumer"
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"
#
# storm.cluster.metrics.consumer.publish.interval.secs: 60

# Event Logger
# topology.event.logger.register:
#   - class: "org.apache.storm.metric.FileBasedEventLogger"
#   - class: "org.mycompany.MyEventLogger"
#     arguments:
#       endpoint: "event-logger.mycompany.org"

# Metrics v2 configuration (optional)
#storm.metrics.reporters:
#  # Graphite Reporter
#  - class: "org.apache.storm.metrics2.reporters.GraphiteStormReporter"
#    daemons:
#        - "supervisor"
#        - "nimbus"
#        - "worker"
#    report.period: 60
#    report.period.units: "SECONDS"
#    graphite.host: "localhost"
#    graphite.port: 2003
#
#  # Console Reporter
#  - class: "org.apache.storm.metrics2.reporters.ConsoleStormReporter"
#    daemons:
#        - "worker"
#    report.period: 10
#    report.period.units: "SECONDS"
#    filter:
#        class: "org.apache.storm.metrics2.filters.RegexFilter"
#        expression: ".*my_component.*emitted.*"

Can anyone tell me what configuration I have missed, if any? And please let me know if any else information is needed to debug this?

My environment:

Apache-storm-2.1.0

Apache-zookeeper-3.6.1

Solution:

Run below command:

storm admin remove_corrupt_topologies

Body:
Looks like there was some corrupted topologies were there. When I ran this command it fix this issue:

storm admin remove_corrupt_topologies


来源: stackexchange

问:
Operation requires privilege escalation
I have a trouble with ansible.

I tried to create some VLAN but I got back this error: "operation requires privilege escalation"

ansible.cfg:

```<code>[defaults]

inventory = hosts
host_key_checking = false
gather_facts = false
timeout = 1000
</code>```

hosts:

```<code>[switch]
sw-este ansible_host=192.168.99.10 ansible_network_os=ios
</code>```

Playbook:

```<code>---
- name: Crear las VLAN y configurar las interfaces
  hosts: sw-este
  gather_facts: false
  connection: network_cli

  tasks:

  - name: create VLAN
    ios_vlan:
      vlan_id: "{{ item.id }}"
      name: "{{ item.name }}"
      state: present

    with_items:
      - { id : 21, name : Contabilidad }
      - { id : 23, name : Ingenieria }
</code>```

And here is result of:

ansible-playbook roles/Basic_Config/tasks/create_vlan.yml -k -u
  ansible -vvv

```<code>ansible-playbook 2.5.0
  config file = /root/Training/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Using /root/Training/ansible.cfg as config file
SSH password:
Parsed /root/Training/hosts inventory source with ini plugin

PLAYBOOK: create_vlan.yml ******************************************************
1 plays in roles/Basic_Config/tasks/create_vlan.yml

PLAY [Crear las VLAN y configurar las interfaces] ******************************
META: ran handlers

TASK [create VLAN] *************************************************************
task path: /root/Training/roles/Basic_Config/tasks/create_vlan.yml:9
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
<192.168.99.10> ESTABLISH LOCAL CONNECTION FOR USER: root
<192.168.99.10> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" && echo ansible-tmp-1523359559.78-25490853974926="` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" ) && sleep 0'
<192.168.99.10> PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmplAtgR2 TO /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py
<192.168.99.10> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 323, in <module>
    main()
  File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 314, in main
    load_config(module, commands)
  File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
  File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
ansible.module_utils.connection.ConnectionError: operation requires privilege escalation

failed: [sw-este] (item={u'id': 21, u'name': u'Contabilidad'}) => {
    "changed": false,
    "item": {
        "id": 21,
        "name": "Contabilidad"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 323, in <module>\n    main()\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
<192.168.99.10> ESTABLISH LOCAL CONNECTION FOR USER: root
<192.168.99.10> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" && echo ansible-tmp-1523359560.84-82791789077640="` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" ) && sleep 0'
<192.168.99.10> PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmphTJUVi TO /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py
<192.168.99.10> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 323, in <module>
    main()
  File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 314, in main
    load_config(module, commands)
  File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
  File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
ansible.module_utils.connection.ConnectionError: operation requires privilege escalation

failed: [sw-este] (item={u'id': 23, u'name': u'Ingenieria'}) => {
    "changed": false,
    "item": {
        "id": 23,
        "name": "Ingenieria"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 323, in <module>\n    main()\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
    to retry, use: --limit @/root/Training/roles/Basic_Config/tasks/create_vlan.retry

PLAY RECAP *********************************************************************
sw-este                    : ok=0    changed=0    unreachable=0    failed=1
</code>```

I tried with connection: local, with become_method: enable but nothing works

答:
Use the "-K" and "-b" options which will cause Ansible to prompt you for a "BECOME" password.

So your new command line would be:

```<code>ansible-playbook roles/Basic_Config/tasks/create_vlan.yml -Kkb -u ansible -vvv
</code>```

ContentLicense: CC BY-SA 3.0

Title: Operation requires privilege escalation

Body:
I have a trouble with ansible.

I tried to create some VLAN but I got back this error: "operation requires privilege escalation"

ansible.cfg:

[defaults]

inventory = hosts
host_key_checking = false
gather_facts = false
timeout = 1000

hosts:

[switch]
sw-este ansible_host=192.168.99.10 ansible_network_os=ios

Playbook:

---
- name: Crear las VLAN y configurar las interfaces
  hosts: sw-este
  gather_facts: false
  connection: network_cli

  tasks:

  - name: create VLAN
    ios_vlan:
      vlan_id: "{{ item.id }}"
      name: "{{ item.name }}"
      state: present

    with_items:
      - { id : 21, name : Contabilidad }
      - { id : 23, name : Ingenieria }

And here is result of:

ansible-playbook roles/Basic_Config/tasks/create_vlan.yml -k -u
  ansible -vvv

ansible-playbook 2.5.0
  config file = /root/Training/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Using /root/Training/ansible.cfg as config file
SSH password:
Parsed /root/Training/hosts inventory source with ini plugin

PLAYBOOK: create_vlan.yml ******************************************************
1 plays in roles/Basic_Config/tasks/create_vlan.yml

PLAY [Crear las VLAN y configurar las interfaces] ******************************
META: ran handlers

TASK [create VLAN] *************************************************************
task path: /root/Training/roles/Basic_Config/tasks/create_vlan.yml:9
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
<192.168.99.10> ESTABLISH LOCAL CONNECTION FOR USER: root
<192.168.99.10> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" && echo ansible-tmp-1523359559.78-25490853974926="` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" ) && sleep 0'
<192.168.99.10> PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmplAtgR2 TO /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py
<192.168.99.10> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 323, in <module>
    main()
  File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 314, in main
    load_config(module, commands)
  File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
  File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
ansible.module_utils.connection.ConnectionError: operation requires privilege escalation

failed: [sw-este] (item={u'id': 21, u'name': u'Contabilidad'}) => {
    "changed": false,
    "item": {
        "id": 21,
        "name": "Contabilidad"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 323, in <module>\n    main()\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
<192.168.99.10> ESTABLISH LOCAL CONNECTION FOR USER: root
<192.168.99.10> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" && echo ansible-tmp-1523359560.84-82791789077640="` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" ) && sleep 0'
<192.168.99.10> PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmphTJUVi TO /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py
<192.168.99.10> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py && sleep 0'
<192.168.99.10> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 323, in <module>
    main()
  File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 314, in main
    load_config(module, commands)
  File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
  File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
ansible.module_utils.connection.ConnectionError: operation requires privilege escalation

failed: [sw-este] (item={u'id': 23, u'name': u'Ingenieria'}) => {
    "changed": false,
    "item": {
        "id": 23,
        "name": "Ingenieria"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 323, in <module>\n    main()\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
    to retry, use: --limit @/root/Training/roles/Basic_Config/tasks/create_vlan.retry

PLAY RECAP *********************************************************************
sw-este                    : ok=0    changed=0    unreachable=0    failed=1

I tried with connection: local, with become_method: enable but nothing works

Body:
Use the "-K" and "-b" options which will cause Ansible to prompt you for a "BECOME" password.

So your new command line would be:

ansible-playbook roles/Basic_Config/tasks/create_vlan.yml -Kkb -u ansible -vvv

ContentLicense: CC BY-SA 4.0


问:
MySQL Selecting multiple fields with one query that uses COUNT(*)
I have a doubt on a mysql query. Believe me I have googled a lot before coming and even searched SO but didn't exactly find the answer looking for. My question is, is the following statement considered proper as I am counting the rows, plus, also fetching the values of different fields?

```<code>SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem
</code>```

Or, while using COUNT(*) should I not fetch the other field values in the same query? Is this a valid practice?

答:
This query:

```<code>SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem
</code>```

Why?  Your query is an aggregation query because it has COUNT(*).  But, otp_code and otp_validity are in the SELECT, but not in the GROUP BY.

Presumably, you intend on of the following:

```<code>SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem
GROUP BY otp_code, otp_validity;
</code>```

This returns one row per otp_code/otp_validity pair, with the counts for that pair.

Or:

```<code>SELECT COUNT(*) OVER () as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem;
</code>```

This returns every row with the overall count of rows returned by the query.

Or:

```<code>SELECT COUNT(*) as cnt, MIN(otp_code), MIN(otp_validity)
FROM otp
WHERE otp_mem = :mem
GROUP BY otp_code, otp_validity;
</code>```

This returns one row with sample values from the other columns.

Body:
I have a doubt on a mysql query. Believe me I have googled a lot before coming and even searched SO but didn't exactly find the answer looking for. My question is, is the following statement considered proper as I am counting the rows, plus, also fetching the values of different fields?

SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem

Or, while using COUNT(*) should I not fetch the other field values in the same query? Is this a valid practice?

Body:
This query:

SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem

Why?  Your query is an aggregation query because it has COUNT(*).  But, otp_code and otp_validity are in the SELECT, but not in the GROUP BY.

Presumably, you intend on of the following:

SELECT COUNT(*) as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem
GROUP BY otp_code, otp_validity;

This returns one row per otp_code/otp_validity pair, with the counts for that pair.

Or:

SELECT COUNT(*) OVER () as cnt, otp_code, otp_validity
FROM otp
WHERE otp_mem = :mem;

This returns every row with the overall count of rows returned by the query.

Or:

SELECT COUNT(*) as cnt, MIN(otp_code), MIN(otp_validity)
FROM otp
WHERE otp_mem = :mem
GROUP BY otp_code, otp_validity;

This returns one row with sample values from the other columns.


问:
How to run a Django celery task every 6am and 6pm daily?
Hi I have Django Celery in my project. Currently its running every 12hour a day (Midnight/00:00am and 12:00pm). But I want it to run every 6am and 6pm a day. How can I do that? Thanks in advance.

Task:

```<code>from celery.task import periodic_task
from celery.schedules import crontab
from xxx.views import update_xx_task, execute_yy_task

@periodic_task(run_every=crontab(minute=0, hour='*/12'),
    queue='nonsdepdb3115', options={'queue': 'nonsdepdb3115'})
def xxx_execute_xx_task():
    execute_yy_task()
    update_xx_task()
</code>```

答:
Better do this by the way:

In your celery.py file

```<code>import os

from celery import Celery
from celery.schedules import crontab

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Moex.settings')

app = Celery('Moex',
             backend='rpc://',
             broker='pyamqp://', )

app.config_from_object('django.conf:settings', namespace='CELERY', )

app.conf.update(result_expires=3600,
                enable_utc=True,
                timezone='Europe/Moscow', )

app.conf.beat_schedule = {
    "every day between 6 AM & 18 PM": {
        "task": "xxx_execute_xx_task",  # <---- Name of task
        "schedule": crontab(hour='6, 18',
                            minute=0,
                            )
    },
    "every minute": {
        "task": "check_if_need_update_prices",
        'schedule': 60.0,
    }
}

app.autodiscover_tasks()
</code>```

Then in your tasks.py file

```<code>import requests
from celery import shared_task, states

@shared_task(bind=True,
             name='xxx_execute_xx_task',
             max_retries=3,
             soft_time_limit=20)
def xxx_execute_xx_task(self):
    # do something
    data = requests.get(url='https://stackoverflow.com/questions/32449845/'
                            'how-to-run-a-django-celery-task-every-6am-and-6pm-daily')
if data.status_code == 200:
    task.update_state(state=states.SUCCESS)
    if data:
        self.update_state(state=states.SUCCESS)
    else:
        self.update_state(state=states.FAILURE)
</code>```

Body:
Hi I have Django Celery in my project. Currently its running every 12hour a day (Midnight/00:00am and 12:00pm). But I want it to run every 6am and 6pm a day. How can I do that? Thanks in advance.

Task:

from celery.task import periodic_task
from celery.schedules import crontab
from xxx.views import update_xx_task, execute_yy_task

@periodic_task(run_every=crontab(minute=0, hour='*/12'),
    queue='nonsdepdb3115', options={'queue': 'nonsdepdb3115'})
def xxx_execute_xx_task():
    execute_yy_task()
    update_xx_task()

Body:
Better do this by the way:

In your celery.py file

import os

from celery import Celery
from celery.schedules import crontab

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Moex.settings')

app = Celery('Moex',
             backend='rpc://',
             broker='pyamqp://', )

app.config_from_object('django.conf:settings', namespace='CELERY', )

app.conf.update(result_expires=3600,
                enable_utc=True,
                timezone='Europe/Moscow', )

app.conf.beat_schedule = {
    "every day between 6 AM & 18 PM": {
        "task": "xxx_execute_xx_task",  # <---- Name of task
        "schedule": crontab(hour='6, 18',
                            minute=0,
                            )
    },
    "every minute": {
        "task": "check_if_need_update_prices",
        'schedule': 60.0,
    }
}

app.autodiscover_tasks()

Then in your tasks.py file

import requests
from celery import shared_task, states

@shared_task(bind=True,
             name='xxx_execute_xx_task',
             max_retries=3,
             soft_time_limit=20)
def xxx_execute_xx_task(self):
    # do something
    data = requests.get(url='https://stackoverflow.com/questions/32449845/'
                            'how-to-run-a-django-celery-task-every-6am-and-6pm-daily')
if data.status_code == 200:
    task.update_state(state=states.SUCCESS)
    if data:
        self.update_state(state=states.SUCCESS)
    else:
        self.update_state(state=states.FAILURE)


问:
Send an email using SMTP and control sender address
I'm trying to send an email using c# App, the next code is working.

```<code>SmtpClient MailClient = new SmtpClient("smtp.gmail.com");
MailClient.EnableSsl = false;
MailClient.Credentials = new NetworkCredential("Ryan.White", "Password");
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("Sender.name@gmail.com");
Msg.To.Add(new MailAddress("Ryan.White@gmail.com"));
Msg.Subject = "testSub";
Msg.Body = "testBody";

MailClient.Send(Msg);
</code>```

But Gmail's SMTP server puts gmail e-mail address (Ryan.White@gmail.com) as the sender,

regardless the MSG.FROM address (Sender.name@gmail.com).

Is it possible to send an email and control the sender address using C#/.NET ?

Or alternatively send an email without authentication?

I know that in UNIX you can control the sender address in 'Mail' command.

答:
Gmail is doing that for security reasons, otherwise it would be easy for spammers to send emails that appear to come from fake addresses.

You have coded this correctly, and C# will attempt to set the from address as Sender.Name@gmail.com, but the SMTP server has the final say.  If you had authorization to send as another user, this would work, like in the case of an Exchange server environment where you are authenticated as an admin.  However, Gmail doesn't seem to allow this.  You would need to login as Sender.name to be able to send emails as that user.

Body:
I'm trying to send an email using c# App, the next code is working.

SmtpClient MailClient = new SmtpClient("smtp.gmail.com");
MailClient.EnableSsl = false;
MailClient.Credentials = new NetworkCredential("Ryan.White", "Password");
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("Sender.name@gmail.com");
Msg.To.Add(new MailAddress("Ryan.White@gmail.com"));
Msg.Subject = "testSub";
Msg.Body = "testBody";

MailClient.Send(Msg);

But Gmail's SMTP server puts gmail e-mail address (Ryan.White@gmail.com) as the sender,

regardless the MSG.FROM address (Sender.name@gmail.com).

Is it possible to send an email and control the sender address using C#/.NET ?

Or alternatively send an email without authentication?

I know that in UNIX you can control the sender address in 'Mail' command.


问:
laravel route not rendering all the components as expected
I have the following in my web.php

```<code>Route::resource('admin/post', 'Admin\PostController');
</code>```

The problem is, when I hit loclhost/admin/post/create it does not load my view as expected.

It doesn't load a pic and a few components in my editor in the view but when I change it to :

```<code>Route::resource('admin', 'Admin\PostController');
</code>```

It loads the view as expected!

An explanation of why this is happening and how to fix it will be highly appreciated!

答:
If you put Route::resource('post', 'Admin\PostController');
inside the group it work's fine! Then you can access
admin/post and post/ and this two routes will use all methods of Admin\PostController.

```<code>Route::group(['prefix' => 'admin'], function () {
    Route::resource('post', 'Admin\PostController');
});
</code>```

Now you can  access loclhost/admin/post/create

Body:
I have the following in my web.php

Route::resource('admin/post', 'Admin\PostController');

The problem is, when I hit loclhost/admin/post/create it does not load my view as expected.

It doesn't load a pic and a few components in my editor in the view but when I change it to :

Route::resource('admin', 'Admin\PostController');

It loads the view as expected!

An explanation of why this is happening and how to fix it will be highly appreciated!

Body:
If you put Route::resource('post', 'Admin\PostController');
inside the group it work's fine! Then you can access
admin/post and post/ and this two routes will use all methods of Admin\PostController.

Route::group(['prefix' => 'admin'], function () {
    Route::resource('post', 'Admin\PostController');
});

Now you can  access loclhost/admin/post/create


问:
Blur effect on the right side of scrolling container
I want to achieve blur effect on the items at the end of scrollable container. But it stays on one item even if scrolled further. It should stick to the right side only.

Initial pic

when scrolled to the right

.main-container .scrollable-nav {
    width: 75%;
    overflow-x: scroll;
    position: absolute;
}

.list-item-container {
    list-style: none;
    display: flex;
    font-size: 20px;
}

li {
    padding-right: 30px;
}

.right-bg::after {
    content: '';
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    width: 60px;
    height: 100%;
    right: 0;
    position: absolute;
    z-index: 9999999;
    margin-left: auto;
    top: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .7) 40%, #fff 70%);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="main-container">
    <div class="scrollable-nav right-bg">
        <ul class="list-item-container ">
            <li class="m-item">menuItem1</li>
            <li class="m-item">menuItem2</li>
            <li class="m-item">menuItem3</li>
            <li class="m-item">menuItem4</li>
            <li class="m-item">menuItem5</li>
            <li class="m-item">menuItem6</li>
            <li class="m-item">menuItem7</li>
            <li class="m-item">menuItem8</li>
        </ul>
    </div>
</div></code>```

Fiddle link: https://jsfiddle.net/uLd5bga1/2/

答:
You should give the pseudo element directly to the main-container.

.main-container {
  position: relative;
  width: 75%;
}

.main-container .scrollable-nav {
  width: 100%;
  overflow-x: scroll;
}

.list-item-container {
  list-style: none;
  display: flex;
  font-size: 20px;
}

li {
  padding-right: 30px;
}

.main-container::after {
  content: '';
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 60px;
  height: calc(100% - 20px);
  right: 0;
  position: absolute;
  z-index: 9999999;
  margin-left: auto;
  top: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .7) 40%, #fff 70%);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="main-container">
  <div class="scrollable-nav right-bg">
    <ul class="list-item-container ">
      <li class="m-item">menuItem1</li>
      <li class="m-item">menuItem2</li>
      <li class="m-item">menuItem3</li>
      <li class="m-item">menuItem4</li>
      <li class="m-item">menuItem5</li>
      <li class="m-item">menuItem6</li>
      <li class="m-item">menuItem7</li>
      <li class="m-item">menuItem8</li>
    </ul>
  </div>
</div></code>```

Body:
I want to achieve blur effect on the items at the end of scrollable container. But it stays on one item even if scrolled further. It should stick to the right side only.

Initial pic

when scrolled to the right

.main-container .scrollable-nav {
    width: 75%;
    overflow-x: scroll;
    position: absolute;
}

.list-item-container {
    list-style: none;
    display: flex;
    font-size: 20px;
}

li {
    padding-right: 30px;
}

.right-bg::after {
    content: '';
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    width: 60px;
    height: 100%;
    right: 0;
    position: absolute;
    z-index: 9999999;
    margin-left: auto;
    top: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .7) 40%, #fff 70%);
}

menuItem1

menuItem2

menuItem3

menuItem4

menuItem5

menuItem6

menuItem7

menuItem8

Fiddle link: https://jsfiddle.net/uLd5bga1/2/

Body:
You should give the pseudo element directly to the main-container.

.main-container {
  position: relative;
  width: 75%;
}

.main-container .scrollable-nav {
  width: 100%;
  overflow-x: scroll;
}

.list-item-container {
  list-style: none;
  display: flex;
  font-size: 20px;
}

li {
  padding-right: 30px;
}

.main-container::after {
  content: '';
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 60px;
  height: calc(100% - 20px);
  right: 0;
  position: absolute;
  z-index: 9999999;
  margin-left: auto;
  top: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .7) 40%, #fff 70%);
}

<div class="main-container">
  <div class="scrollable-nav right-bg">
    <ul class="list-item-container ">
      <li class="m-item">menuItem1</li>
      <li class="m-item">menuItem2</li>
      <li class="m-item">menuItem3</li>
      <li class="m-item">menuItem4</li>
      <li class="m-item">menuItem5</li>
      <li class="m-item">menuItem6</li>
      <li class="m-item">menuItem7</li>
      <li class="m-item">menuItem8</li>
    </ul>
  </div>
</div>


问:
How to print this pattern in MS SQL Server?
I am new to SQL server and started solve some question, but not sure how to print triangle in sql</p>

```<code>*****
****
***
**
*
</code>```

答:
So you can use while loop to iterate and replicate to print * mutiple times, try this</p>

```<code>DECLARE @i INT = 5

WHILE(@i>0)
BEGIN
   PRINT REPLICATE('* ', @i);
   SET @i = @i - 1;
END
</code>```

Body:
I am new to SQL server and started solve some question, but not sure how to print triangle in sql

*****
****
***
**
*

Body:
So you can use while loop to iterate and replicate to print * mutiple times, try this

DECLARE @i INT = 5

WHILE(@i>0)
BEGIN
   PRINT REPLICATE('* ', @i);
   SET @i = @i - 1;
END


问:
jQuery: Change highlight fade-to color?
Is it possible to change the color that the jQuery highlight effect fade's to?

Right now it starts the highlight at yellow, then fades to white and then fades out.

I ultimately what to highlight the background color with yellow, then just fade to transparent.

答:
I've just come across this behavior as well in jQuery UI 1.8.9, it seems to be a bug.

The way around it for me was to define the background color of the element I was highlighting in the CSS instead of letting it default to transparent.

If the background color isn't set (i.e. it is transparent), assuming you haven't changed the highlight color, then it will fade the element to yellow then to white and then fade out.

However, if you set the background color of the element you are highlighting it will fade to yellow then to the element's original color when you highlight it.

Title: jQuery: Change highlight fade-to color?


问:
Loop in an update SQL Server query sent by MS Access vba
I am using MS Access vba as the interface and SQL Server as database server.

I want to update a set of rows in a table CANDIDAT_TESTS. What I am now doing is update one by one and I loop with a for loop; it works, but it takes too much time.

I would like to reduce the number of query by looping in one query.

My code:

```<code>This is the entire code
</code>```

´´´ varSession = "2020"
    Set cnx = getConnectionBD(varSession)

```<code>rsSCE.Open "SELECT DISTINCT LIBELLE_DEPARTEMENT, LIBELLE_SOUS_CENTRE, NUM_SOUS_CENTRE " _
    & " FROM VIEW_CANDIDATS_SCE " _
    & " WHERE NUM_REGION = " & Me.LIST_REGION & " AND NUM_EXAMEN = " & Me.LIST_EXAMEN _
    & " ORDER BY LIBELLE_DEPARTEMENT, LIBELLE_SOUS_CENTRE", cnx, adOpenStatic, adLockOptimistic
varTabSCE = rsSCE.GetRows
'On initialise les jurys parce que les jurys sont par région
jury = 0

'On parcourt les sous-centres par départements
For j = 1 To rsSCE.RecordCount
    rsSerie.Open "SELECT DISTINCT NUM_SERIE, ABREVIATION_SERIE " _
        & " FROM VIEW_CANDIDATS_SCE " _
        & " WHERE NUM_SOUS_CENTRE = " & varTabSCE(2, j - 1) & " AND NUM_EXAMEN = " & Me.LIST_EXAMEN _
        & " ORDER BY ABREVIATION_SERIE", cnx, adOpenStatic, adLockOptimistic
    varTabSerie = rsSerie.GetRows

    'On parcourt les séries du sce j
    For k = 1 To rsSerie.RecordCount
        'on initialise le curseur à 0 étant donné que les numéros d'ordre sont par série
        cursor = 0
        rsCandidats.Open "SELECT ID FROM CANDIDAT_TESTS " _
            & " WHERE NUM_SOUS_CENTRE = " & varTabSCE(2, j - 1) & " AND NUM_SERIE = " & varTabSerie(0, k - 1) _
            & " ORDER BY NOMS, DATE_DE_NAISSANCE", cnx, adOpenStatic, adLockOptimistic
        varTabCandidats = rsCandidats.GetRows

        nbCanddidats = rsCandidats.RecordCount
        nbJurys = RoundUp(nbCanddidats / 250)

        'On parcourt les jurys de la série k du sce j
        numJury = nbJurys
        For l = 1 To nbJurys
            jury = jury + 1

            If numJury > 1 Then
                'On parcourt les candidats du jury l pour leur attribuer le numéro d'ordre et le jury
                For m = 250 * (l - 1) + 1 To 250 * (l - 1) + 250
                    cursor = cursor + 1
                    rsUpdate.Open "UPDATE CANDIDAT_TESTS " _
                        & " SET NUMERO_ORDRE = " & cursor & ", JURY = " & jury _
                        & " WHERE ID = " & varTabCandidats(0, m - 1), cnx, adOpenStatic, adLockOptimistic

                    Set rsUpdate = Nothing
                Next m
            ElseIf numJury = 1 Then
                'On parcourt les candidats du dernier jury pour leur attribuer le numéro d'ordre et le jury
                For m = 250 * (l - 1) + 1 To nbCanddidats
                    cursor = cursor + 1
                    rsUpdate.Open "UPDATE CANDIDAT_TESTS " _
                        & " SET NUMERO_ORDRE = " & cursor & ", JURY = " & jury _
                        & " WHERE ID = " & varTabCandidats(0, m - 1), cnx, adOpenStatic, adLockOptimistic

                    Set rsUpdate = Nothing
                Next m
            End If
            numJury = numJury - 1

        Next l

        Set rsCandidats = Nothing
        Set rsSerie = Nothing
    Next k

    Set rsSCE = Nothing
Next j ´´´
</code>```

Is there any way I could transform the for m loop to a single query? Because I am looping this block of code again.

Thanks to y'all

答:
Rather than repeatedly executing a SQL statement for every iteration of the loop, it is likely to be more efficient to iterate over a single recordset and update the value of each record encountered, for example, using DAO:

```<code>With CurrentDb.OpenRecordset _
    ( _
        "select numero_ordre from candidat_tests " & _
        "where id >= " & varTabCandidats(0, 250 * (l - 1)) & " and " & _
        "id <= " & varTabCandidats(0, 250 * (l - 1) + 249) & " " &  _
        "order by id"
    )
    If Not .EOF Then
        .MoveFirst
        cursor = 1
        Do Until .EOF
            .Edit
            !numero_ordre = cursor
            .Update
            .MoveNext
            cursor = cursor + 1
        Loop
    End If
    .Close
End With
</code>```

Without knowledge of the varTabCandidats function, the above is obviously untested.

Body:
I am using MS Access vba as the interface and SQL Server as database server.

I want to update a set of rows in a table CANDIDAT_TESTS. What I am now doing is update one by one and I loop with a for loop; it works, but it takes too much time.

I would like to reduce the number of query by looping in one query.

My code:

This is the entire code

´´´ varSession = "2020"
    Set cnx = getConnectionBD(varSession)

rsSCE.Open "SELECT DISTINCT LIBELLE_DEPARTEMENT, LIBELLE_SOUS_CENTRE, NUM_SOUS_CENTRE " _
    & " FROM VIEW_CANDIDATS_SCE " _
    & " WHERE NUM_REGION = " & Me.LIST_REGION & " AND NUM_EXAMEN = " & Me.LIST_EXAMEN _
    & " ORDER BY LIBELLE_DEPARTEMENT, LIBELLE_SOUS_CENTRE", cnx, adOpenStatic, adLockOptimistic
varTabSCE = rsSCE.GetRows
'On initialise les jurys parce que les jurys sont par région
jury = 0

'On parcourt les sous-centres par départements
For j = 1 To rsSCE.RecordCount
    rsSerie.Open "SELECT DISTINCT NUM_SERIE, ABREVIATION_SERIE " _
        & " FROM VIEW_CANDIDATS_SCE " _
        & " WHERE NUM_SOUS_CENTRE = " & varTabSCE(2, j - 1) & " AND NUM_EXAMEN = " & Me.LIST_EXAMEN _
        & " ORDER BY ABREVIATION_SERIE", cnx, adOpenStatic, adLockOptimistic
    varTabSerie = rsSerie.GetRows

    'On parcourt les séries du sce j
    For k = 1 To rsSerie.RecordCount
        'on initialise le curseur à 0 étant donné que les numéros d'ordre sont par série
        cursor = 0
        rsCandidats.Open "SELECT ID FROM CANDIDAT_TESTS " _
            & " WHERE NUM_SOUS_CENTRE = " & varTabSCE(2, j - 1) & " AND NUM_SERIE = " & varTabSerie(0, k - 1) _
            & " ORDER BY NOMS, DATE_DE_NAISSANCE", cnx, adOpenStatic, adLockOptimistic
        varTabCandidats = rsCandidats.GetRows

        nbCanddidats = rsCandidats.RecordCount
        nbJurys = RoundUp(nbCanddidats / 250)

        'On parcourt les jurys de la série k du sce j
        numJury = nbJurys
        For l = 1 To nbJurys
            jury = jury + 1

            If numJury > 1 Then
                'On parcourt les candidats du jury l pour leur attribuer le numéro d'ordre et le jury
                For m = 250 * (l - 1) + 1 To 250 * (l - 1) + 250
                    cursor = cursor + 1
                    rsUpdate.Open "UPDATE CANDIDAT_TESTS " _
                        & " SET NUMERO_ORDRE = " & cursor & ", JURY = " & jury _
                        & " WHERE ID = " & varTabCandidats(0, m - 1), cnx, adOpenStatic, adLockOptimistic

                    Set rsUpdate = Nothing
                Next m
            ElseIf numJury = 1 Then
                'On parcourt les candidats du dernier jury pour leur attribuer le numéro d'ordre et le jury
                For m = 250 * (l - 1) + 1 To nbCanddidats
                    cursor = cursor + 1
                    rsUpdate.Open "UPDATE CANDIDAT_TESTS " _
                        & " SET NUMERO_ORDRE = " & cursor & ", JURY = " & jury _
                        & " WHERE ID = " & varTabCandidats(0, m - 1), cnx, adOpenStatic, adLockOptimistic

                    Set rsUpdate = Nothing
                Next m
            End If
            numJury = numJury - 1

        Next l

        Set rsCandidats = Nothing
        Set rsSerie = Nothing
    Next k

    Set rsSCE = Nothing
Next j ´´´

Is there any way I could transform the for m loop to a single query? Because I am looping this block of code again.

Thanks to y'all

Body:
Rather than repeatedly executing a SQL statement for every iteration of the loop, it is likely to be more efficient to iterate over a single recordset and update the value of each record encountered, for example, using DAO:

With CurrentDb.OpenRecordset _
    ( _
        "select numero_ordre from candidat_tests " & _
        "where id >= " & varTabCandidats(0, 250 * (l - 1)) & " and " & _
        "id <= " & varTabCandidats(0, 250 * (l - 1) + 249) & " " &  _
        "order by id"
    )
    If Not .EOF Then
        .MoveFirst
        cursor = 1
        Do Until .EOF
            .Edit
            !numero_ordre = cursor
            .Update
            .MoveNext
            cursor = cursor + 1
        Loop
    End If
    .Close
End With

Without knowledge of the varTabCandidats function, the above is obviously untested.


问:
Using GroupByKey with having each key in its own window
I have an unbounded source of data (Kafka stream) as the input for my beam job.

The characteristic of data:

They are groups of element (group size is between 5-20 elements).

The key of each group is an unique identifier and only used for that group.

The maximum time difference between the first element and last element in a group is less than 2 seconds.

What I want to perform is:

Grouping them together by their key

Processing each group individually.

I figured out that I can use GroupByKey function to achieve this.

But then , since it is an unbounded source, I need to apply windowing otherwise the GroupBy will never finish.

The problem is that, I can't find a windowing function that allows me to do it without chopping data.

My question: Is there a way that can allow me to group each key in its own window, and close it after a certain amount of time? Thank you very much

答: You could probably try to use Session windows where every session will correspond to the group in your input dataset.


问:
The Threejs model sets the position to (0, 0, 0), but the scene display is not (0, 0, 0)
I encountered problems with the model setting position when I developed with Threejs today

This is my loader Gltf Model code  (typescript)

```<code>const loadGltf = (url: string, name: string) => {
    loader.load(url, (gltf) => {

        const object = gltf.scene.children[0]
        object.name = name
        object.position.set(0, 0, 0)

        if (scene) {
            scene.add(object)
            scene.add(new THREE.BoxHelper(object, new THREE.Color(0xffff00)))
        }

    })
}
</code>```

but..the scene show like this

The position of sphereMesh is (0, 0, 0)

I checked the document for a long time, but there is no relevant description.
How can I solve this problem?
If you understand, can you tell me? This can do me a great favor!!

答:
I think the gltf model you're loading has its origin set as away from the object itself. If this is a model you've created, try opening it in Blender or a similar program and make sure its origin point is located on the model itself. </p>

<p>When you call yourObject.position.set() in threejs it will be relative to the origin point of the 3D shape, rather than the physical object that you see visually. </p>

Body:
I encountered problems with the model setting position when I developed with Threejs today

This is my loader Gltf Model code  (typescript)

const loadGltf = (url: string, name: string) => {
    loader.load(url, (gltf) => {

        const object = gltf.scene.children[0]
        object.name = name
        object.position.set(0, 0, 0)

        if (scene) {
            scene.add(object)
            scene.add(new THREE.BoxHelper(object, new THREE.Color(0xffff00)))
        }

    })
}

but..the scene show like this

The position of sphereMesh is (0, 0, 0)

I checked the document for a long time, but there is no relevant description.
How can I solve this problem?
If you understand, can you tell me? This can do me a great favor!!

Body:
I think the gltf model you're loading has its origin set as away from the object itself. If this is a model you've created, try opening it in Blender or a similar program and make sure its origin point is located on the model itself.

When you call yourObject.position.set() in threejs it will be relative to the origin point of the 3D shape, rather than the physical object that you see visually.